Reputation: 7773
I'm building a cross toolchain for an i686 linux robotics system. I am building the toolchain using my x86_64 Ubuntu 14.04 system. After building the toolchain for the target i686-linux-gnu
, I end up with a directory in my build directory with the name i686-linux-gnu
. This directory appears to have a number of folders that go in the root directory of the target system:
- build_directory
- i686-linux-gnu
- bin
- etc
- include
- lib
- libexec
- sbin
- share
- var
My assumption is that these are the supporting files that correspond with the toolchain that was built, and that these files are intended to exist on the target system
I have tried simply copying these directories into the root /
of the target system, overwriting any existing files. This came with disastrous results. For example, I was unable to run ls
or sudo
due to missing/incorrect library search paths. So I now have two questions:
Am I deploying these libraries to the target system correctly? If not, what is the correct deployment procedure?
If this is the correct deployment procedure, why would my search paths become broken? Shouldn't the system continue to use the default search paths /lib
, /usr/lib
, etc?
My toolchain build script is available as well on pastebin (due to the size).
Upvotes: 1
Views: 156
Reputation: 113
The question is a bit vague, so I'm making some assumptions. I assume you're creating a toolchain from scratch, and you're using only that script on pastebin.
I'm also assuming you intend to replace the entire filesystem on this device.
Your script isn't installing binaries for ls or sudo, for embedded systems it's common to use busybox for these.
I would like to also recommend you looking into buildroot, it's much easier than building your own toolchain from scratch, and it was what some vendors tell me to use when compiling libraries to their embedded systems.
If you really only wanted to deploy some libraries:
This doesn't look like the correct procedure, your toolchain may have created default files preparing for an empty root file system. You should try copying only the library you're interested in, and stuff related to it. It's hard to tell without knowing what libraries you're talking about
Look if you have a file like /etc/ld.so.conf, and/or a directory named /etc/ld.so.conf.d This is where the library search path is in a centos system.
Upvotes: 1