jhalfs-X: chroot path

George Boudreau georgeb at linuxfromscratch.org
Sat Aug 5 12:45:09 PDT 2006


Dan Nicholson wrote:
> On 8/5/06, George Boudreau <georgeb at linuxfromscratch.org> wrote:
>> Dan Nicholson wrote:
>> >
>> > When doing the build with sudo, it bombs in a couple places where it
>> > expects the superuser path (/sbin:/usr/sbin). Particularly, the chroot
>> > call fails in Ch. 6. This is just a minor issue, and it was easy to
>> > just add them to my path and restart. Also, it's not really true to
>> > the book where you're expected to _be_ root, not just get his
>> > privileges.
>>    At what point does the failure occur. I cannot recall any problems
>> building where the cause was PATH. (I may have corrected the problem and
>> forgot about it.)
> 
> The part that I can think of is that CHROOT{1,2} are defined as "=
> chroot ...". So, in all the chapter06 targets, if `chroot' is not in
> your PATH, it bombs. I can't think of anything else. I suppose this
> could be changed to "CHROOT1= /usr/sbin/chroot ...".
> 
  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.

   # 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||'`

What do you think Manuel? You have been pounding out code changes all 
day.. I will leave this up to you.

> -- 
> Dan




More information about the alfs-discuss mailing list