From 8381f6e7c3e2e06341985ace4956b5d23c1ef37c Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sun, 6 Aug 2006 09:53:10 +0000 Subject: [PATCH] Using the full path for chroot commands. --- CLFS/master.sh | 23 ++++++++++++++--------- HLFS/master.sh | 23 ++++++++++++++--------- LFS/master.sh | 15 ++++++++++++--- 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/CLFS/master.sh b/CLFS/master.sh index 4df0b38..4c7123f 100755 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -1022,15 +1022,20 @@ EOF # Add chroot commands if [ "$METHOD" = "chroot" ] ; then - chroot=`cat chroot/*chroot* | sed -e '/#!\/tools\/bin\/bash/d' \ - -e '/^export/d' \ - -e '/^logout/d' \ - -e 's@ \\\@ @g' | tr -d '\n' | sed -e 's/ */ /g' \ - -e 's|\\$|&&|g' \ - -e 's|exit||g' \ - -e 's|$| -c|' \ - -e 's|"$$CLFS"|$(MOUNT_PT)|'\ - -e 's|set -e||'` + CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`" + chroot=`cat chroot/*chroot* | \ + sed -e "s@chroot@$CHROOT_LOC@" \ + -e '/#!\/tools\/bin\/bash/d' \ + -e '/^export/d' \ + -e '/^logout/d' \ + -e 's@ \\\@ @g' | \ + tr -d '\n' | \ + sed -e 's/ */ /g' \ + -e 's|\\$|&&|g' \ + -e 's|exit||g' \ + -e 's|$| -c|' \ + -e 's|"$$CLFS"|$(MOUNT_PT)|'\ + -e 's|set -e||'` echo -e "CHROOT1= $chroot\n" >> $MKFILE fi diff --git a/HLFS/master.sh b/HLFS/master.sh index e3eb41c..626e3a2 100755 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -495,17 +495,22 @@ EOF # Add chroot commands + CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`" i=1 for file in chapter06/*chroot* ; do - chroot=`cat $file | sed -e '/#!\/bin\/sh/d' \ - -e '/^export/d' \ - -e '/^logout/d' \ - -e 's@ \\\@ @g' | tr -d '\n' | sed -e 's/ */ /g' \ - -e 's|\\$|&&|g' \ - -e 's|exit||g' \ - -e 's|$| -c|' \ - -e 's|"$$HLFS"|$(MOUNT_PT)|'\ - -e 's|set -e||'` + chroot=`cat $file | \ + sed -e "s@chroot@$CHROOT_LOC@" \ + -e '/#!\/bin\/sh/d' \ + -e '/^export/d' \ + -e '/^logout/d' \ + -e 's@ \\\@ @g' | \ + tr -d '\n' | \ + sed -e 's/ */ /g' \ + -e 's|\\$|&&|g' \ + -e 's|exit||g' \ + -e 's|$| -c|' \ + -e 's|"$$HLFS"|$(MOUNT_PT)|'\ + -e 's|set -e||'` echo -e "CHROOT$i= $chroot\n" >> $MKFILE i=`expr $i + 1` done diff --git a/LFS/master.sh b/LFS/master.sh index 9213733..b4f654c 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -378,11 +378,20 @@ EOF # Add chroot commands + CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`" i=1 for file in chapter06/*chroot* ; do - chroot=`cat $file | 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||'` + chroot=`cat $file | \ + sed -e "s@chroot@$CHROOT_LOC@" \ + -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||'` echo -e "CHROOT$i= $chroot\n" >> $MKFILE i=`expr $i + 1` done