From 496f8f3e30013d75c22fc61cb1a490451de91b3c Mon Sep 17 00:00:00 2001 From: George Boudreau Date: Thu, 14 Sep 2006 00:14:37 +0000 Subject: [PATCH] Correct bug which occurs when restarting chroot phase --- CLFS/master.sh | 10 ++++++---- HLFS/master.sh | 10 ++++++---- LFS/master.sh | 12 +++++++----- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/CLFS/master.sh b/CLFS/master.sh index 68bd25a..3f42f97 100755 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -1224,10 +1224,12 @@ mk_SUDO: mk_TEMP #---------------CHROOT JAIL mk_SYSTOOLS: mk_SUDO - @mkdir \$(MOUNT_PT)/bin && \\ - cd \$(MOUNT_PT)/bin && \\ - ln -sf /tools/bin/bash bash; ln -sf bash sh - @sed -e 's|^ln -sv|ln -svf|' -i \$(CMDSDIR)/chroot/082-createfiles + @if [ ! -e \$(MOUNT_PT)/bin ]; then \\ + mkdir \$(MOUNT_PT)/bin; \\ + cd \$(MOUNT_PT)/bin && \\ + ln -svf /tools/bin/bash bash; ln -sf bash sh; \\ + fi; + @sudo sed -e 's|^ln -sv|ln -svf|' -i \$(CMDSDIR)/chroot/082-createfiles @\$(call echo_CHROOT_request) @\$(call echo_PHASE, Chroot systools) @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make SYSTOOLS") diff --git a/HLFS/master.sh b/HLFS/master.sh index 55c49e0..e7607ac 100755 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -584,10 +584,12 @@ mk_SUDO: mk_LUSER @touch \$@ mk_CHROOT: mk_SUDO - @mkdir \$(MOUNT_PT)/bin && \ - cd \$(MOUNT_PT)/bin && \ - ln -sf /tools/bin/bash bash; ln -sf bash sh - @sed -e 's|^ln -vs|ln -svf|' -i \$(CMDSDIR)/chapter06/064-createfiles + @if [ ! -e \$(MOUNT_PT)/bin ]; then \\ + mkdir \$(MOUNT_PT)/bin; \\ + cd \$(MOUNT_PT)/bin && \\ + ln -sf /tools/bin/bash bash; ln -sf bash sh; \\ + fi; + @sudo sed -e 's|^ln -sv|ln -svf|' -i $(CMDSDIR)/chapter06/064-createfiles @\$(call echo_CHROOT_request) @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT") @touch \$@ diff --git a/LFS/master.sh b/LFS/master.sh index 97cb02b..d051090 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -467,11 +467,13 @@ mk_SUDO: mk_LUSER # Also change the original symlink creation to include (f)orce to prevent failure due to # pre-existing links. # -mk_CHROOT: mk_LUSER - @mkdir \$(MOUNT_PT)/bin && \\ - cd \$(MOUNT_PT)/bin && \\ - ln -sf /tools/bin/bash bash; ln -sf bash sh - @sed -e 's|^ln -sv|ln -svf|' -i \$(CMDSDIR)/chapter06/063-createfiles +mk_CHROOT: mk_SUDO + @if [ ! -e \$(MOUNT_PT)/bin ]; then \\ + mkdir \$(MOUNT_PT)/bin; \\ + cd \$(MOUNT_PT)/bin && \\ + ln -sf /tools/bin/bash bash; ln -sf bash sh; \\ + fi; + @sudo sed -e 's|^ln -sv|ln -svf|' -i \$(CMDSDIR)/chapter06/063-createfiles @\$(call echo_CHROOT_request) @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT") @sudo restore-luser-env