Stuck in 6.7.*Linux-4.9.9 API of Linux from scratch
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
first, create the cross-compile tools and put them in /mnt/lfs/tools;
then chroot with /mnt/lfs/tools as / ; use the tool chain in /mnt/lfs/tools to install all required software for my linux system.
When I try to install linux API headers from /mnt/lfs/resources/linux-4.4.9, I got the error.
There should be /mnt/lfs/tools/lib/gcc/x86_64-pc-linux-gnu/6.3.0 if everything goes well.
I don't know why I don't have directory of /mnt/lfs/tools/lib/gcc/x86_64-pc-linux-gnu while I only have an executable /mnt/lfs/tools/lib/gcc/x86_64-pc-linux-gnu
The "dest" in that line also looks like a typo. My lfs days were a long time ago.
Relying on memory, The destination is usually /usr/include/ ? It looks like you should have /mnt/lfs/<something> in there. The 'dest' is a tmpdir. At this stage, path errors are common. You're still using the static toolchain in ~/tools to build the system in /mnt/lfs, and /tools will be removed in time.
The "dest" in that line also looks like a typo. My lfs days were a long time ago.
Relying on memory, The destination is usually /usr/include/ ? It looks like you should have /mnt/lfs/<something> in there. The 'dest' is a tmpdir. At this stage, path errors are common. You're still using the static toolchain in ~/tools to build the system in /mnt/lfs, and /tools will be removed in time.
No, whatever else is wrong, the "dest" is correct. Installing the kernel headers deletes everything in the destination directory, so a temporary one is used for safety. Then a sanitised set of headers (not the full set) is copied to /usr/include. You can check the instructions here.
The OP's problem is that his makefile is trying to access binutils and it shouldn't be doing so for the headers_install target.
I'm having the same issue, could it have something to do with building on a 64-bit system? I have noted a couple of things:
1. ls will find this binary:
root:/sources/linux-4.9.9# ls -alh /tools/lib64/gcc/x86_64-pc-linux-gnu/6.3.0/>
-rwxr-xr-x 2 root root 1.8M Jul 23 18:48 /tools/lib64/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/as
2. Running it outputs an error saying it can't find it:
root:/sources/linux-4.9.9# /tools/lib64/gcc/x86_64-pc-linux-gnu/6.3.0/../../..>
bash: /tools/lib64/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/as: No such file or directory
3. readelf (from the lfs user shell) reports /lib64/ld-linux-x86-64.so.2:
lfs@ubuntu:~$ readelf -l /tools/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/as | grep interpreter
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
This is symlinked to /lib/x86_64-linux-gnu/ld-2.23.so in the lfs user shell
lfs@ubuntu:~$ ls -alh /lib64/ld-linux-x86-64.so.2
lrwxrwxrwx 1 root root 32 Jun 16 20:57 /lib64/ld-linux-x86-64.so.2 -> /lib/x86_64-linux-gnu/ld-2.23.so
but is not found in the chroot shell
I don't think I missed a step, but it is possible that the 64-bit ld is not being properly referenced.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.