LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   About chroot'ing in Chapter 6 of Cross-Compiled LFS? (https://www.linuxquestions.org/questions/linux-from-scratch-13/about-chrooting-in-chapter-6-of-cross-compiled-lfs-4175612629/)

ordealbyfire83 08-25-2017 03:53 PM

About chroot'ing in Chapter 6 of Cross-Compiled LFS?
 
I am trying to get LFS 7.9 on a machine with an arm processor (armv5). Recently I have tried building this natively, but it seems that gcc cannot currently be built that way on arm due to some linking problem with in-tree gmp builds. Perhaps this is fixed with newer versions of gcc and gmp, but on this particular machine 1 SBU is about 43 minutes so I didn't hang around to verify. This led me to try cross-compiling (from BLFS 7.9 x86_64) in the sense of the book "Cross Compiled Linux From Scratch", Version 3.0.0-SYSVINIT. There is no arm book so I roughly referred to this and this for arm-specific things but tried to follow the syntax as close to the letter as possible as http://www.clfs.org/view/CLFS-3.0.0-...-64/index.html but using the versions found in LFS 7.9 (which were usually only marginally newer).

Once in Chapter 6, there are two ways to proceed to building the final system, either to boot or to chroot. Of course chrooting from an x86_64 to arm is out of the question. So I made a tar archive "cd /media/clfs && tar cvfp archive.tar ./*" etc., extracted it on another drive, and mounted it on the arm machine to the same mount point as was built on my build machine.

However I cannot chroot. I have also replicated all of the environment variables from the build laptop onto the arm machine Is this to be expected?

Code:

root@arm-server:~# ldd /tools/bin/env
        libc.so.6 => /lib/arm-linux-gnueabi/libc.so.6 (0xb6d88000)
        /lib/ld-linux.so.3 (0xb6ed1000)

Code:

root@arm-server:~# chroot $CLFS /tools/bin/env -i /bin/bash                       
chroot: failed to run command '/tools/bin/env': No such file or directory

I have seen other similar problems when gcc spec adjustments were not made. I did do this part in Chapter 6 gcc. I am using gcc 5.3 if that matters. Any suggestions?

norobro 08-26-2017 03:10 PM

I have never tried anything like this but here are a couple of questions/observations.

Quote:

Originally Posted by ordealbyfire83 (Post 5751971)
... and mounted it on the arm machine to the same mount point as was built on my build machine.

What is the mount point on the arm? And what does $CLFS contain?

Quote:

root@arm-server:~# ldd /tools/bin/env
It looks to me like /tools/bin is mounted under / or you are already chroot'ed.

What is the result of:
Code:

# chroot $CLFS
# ls -l



All times are GMT -5. The time now is 02:18 AM.