jhalfs-X: chroot path

Dan Nicholson dbn.lists at gmail.com
Sat Aug 5 12:50:36 PDT 2006

On 8/5/06, George Boudreau <georgeb at linuxfromscratch.org> wrote:
>   Valid point, and the reason it never failed here is chroot resides in
> /usr/bin  (I know.. bad George, bad) So a solution is find out where
> chroot is and enter the full path.

You know, I finally gave up on the /bin vs. /sbin thing on my home box
and just gave all my users the full PATH. It's not like having an
executable outside of PATH is some kind of security initiative. But
this was on anduin where I have the "safe" PATH.

>    # Add chroot commands
>    CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"   <--NEW
>    i=1
>    for file in chapter06/*chroot* ; do
>      chroot=`cat $file | sed -e "s at chroot@$CHROOT_LOC@" | \  <--NEW
>                          sed -e '/#!\/bin\/sh/d' \
>                              -e 's@ \\\@ @g' | tr -d '\n' | \
>                         sed -e 's/  */ /g' \
>                             -e 's|\\$|&&|g' \
>                             -e 's|exit||g' \
>                             -e 's|$| -c|' \
>                             -e 's|"$$LFS"|$(MOUNT_PT)|' \
>                             -e 's|set -e||'`

That would work. Another would be to just say "You need a path
including /sbin and /usr/sbin" in the README.


More information about the alfs-discuss mailing list