LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS 7.1-Coreutils 8.15-After installation, exit and re-enter chroot env-utils inop (http://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-7-1-coreutils-8-15-after-installation-exit-and-re-enter-chroot-env-utils-inop-4175421656/)

mech0001 08-12-2012 12:34 AM

LFS 7.1-Coreutils 8.15-After installation, exit and re-enter chroot env-utils inop
 
Hi all,

System: WaryPuppy Linux running from usb stick on eeepc.

Page 140 of LFS. Completed install of Coreutils 8.15 and all steps
associated with this install. All tests pass. When I leave the chroot
environment and return, most coreutil programs don't work (ie. ls, ln,
cp, mv, etc). Error given is: bash: /bin/ls: No such file or directory. A few utils do work (echo, pwd, true). Files are there when checked outside chroot. Have tried using other/no configuration options and using 8.17. Same problem occurs.

Possibly related to chroot workaround issue: in order to successfully chroot, I have to mv lib _lib, then mv _lib lib when I get into chroot. Otherwise get segmentation fault. No other problems unresolved until now and sanity tests are all ok.

Any tips/suggestions on where to look?

Thanks,
mech

druuna 08-12-2012 03:18 AM

Quote:

Originally Posted by mech0001 (Post 4752122)
Page 140 of LFS. Completed install of Coreutils 8.15 and all steps associated with this install. All tests pass. When I leave the chroot environment and return, most coreutil programs don't work (ie. ls, ln, cp, mv, etc). Error given is: bash: /bin/ls: No such file or directory. A few utils do work (echo, pwd, true). Files are there when checked outside chroot. Have tried using other/no configuration options and using 8.17. Same problem occurs.

First question that pops up: Why leave the chrooted environment? And if you do need to, make sure you use the correct chroot command.

Quote:

Possibly related to chroot workaround issue: in order to successfully chroot, I have to mv lib _lib, then mv _lib lib when I get into chroot. Otherwise get segmentation fault.
This needs to be resolved first. No extra steps are needed/wanted to make the LFS book work. Something is definitely wrong if you have to move/remove/copy any extra stuff to make it work.

You did not post enough information to help you any further: Error message(s) and first occurrence of this chroot error might be handy.

Also: Is you host made fully compliant: http://www.linuxfromscratch.org/lfs/.../hostreqs.html (run script and fix possible problems).

mech0001 08-13-2012 12:12 AM

Thanks for the reply.

Answers to your questions:

Leave chroot when computer is shut down as I don't often have lots of consecutive time to work on tnis.

Chroot problem occurs after make install step of glibc. The glibc tests give the expected errors only(posix/bug-regex32, stdio-common/bug22, and posix/annexc). Make install step test/installation.pl returns "Your new glibc installation seems to be ok" message.

Where should I look for further error information?

Thanks

mech0001 08-13-2012 04:22 AM

There appears to be an error in my tools directory as invoking /tools/bin/env causes a segfault. Soooo, it's back to the beginning. I will let you know if this fixes the problem in
a couple of days or so.

mech

mech0001 08-18-2012 10:18 PM

It looks like I have to stay in the chroot environment throughout that section of package installation steps. After completing them, I am able to reenter this environment with the chroot command on page 191 (PDF 210). I would suggest not exiting the chrooted environment during this step if you encounter a similar problem. You could also try using the later command with the addition of +h at the end if your are only partway through the section.

Perhaps the chrooted environment creates memory allocations that are not legally accessible to root causing the segfault when /tools/bin/env -i is called.

I have not yet booted my installation so I will not call this solved yet.

mech

druuna 08-19-2012 05:05 AM

From chapter 6.64 up to and including chapter 9.3 you need to use the chroot command as shown in chapter 6.64.

If, for whatever reason, you leave the chrooted environment you need this command to re-enter:
Code:

chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login

If you rebooted, you also need to restore the virtual kernel file systems (6.2.2 and 6.2.3) _before_ you enter the chrooted environment:
Code:

mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys

No need to change the chroot command.


All times are GMT -5. The time now is 10:12 AM.