From 6fe7cbce4bdf80bc357fa5501aa69590772cfc57 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 8 Apr 2021 14:15:59 -0500 Subject: Source preparechroot instead of sudo. If limited directory structure is created, then put a conditional around it if limited has already been done and if not, then touch a file. This keeps /mnt/lfs/tools from cropping up after cleanup stage for chapter 8 and this script is reran. --- lfs.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lfs.sh b/lfs.sh index 4d13d2a..9291767 100755 --- a/lfs.sh +++ b/lfs.sh @@ -70,14 +70,17 @@ to user ${IWHT}${USER}${RST}\n" fi # Create limited directory layout -mkdir -p "${LFS}"/sources -mkdir -p "${LFS}"/tools -mkdir -p "${LFS}"/bin -mkdir -p "${LFS}"/etc -mkdir -p "${LFS}"/lib -mkdir -p "${LFS}"/sbin -mkdir -p "${LFS}"/usr -mkdir -p "${LFS}"/var +if [[ ! -f "${LFS}"/sources/limited ]]; then + mkdir -p "${LFS}"/sources + mkdir -p "${LFS}"/tools + mkdir -p "${LFS}"/bin + mkdir -p "${LFS}"/etc + mkdir -p "${LFS}"/lib + mkdir -p "${LFS}"/sbin + mkdir -p "${LFS}"/usr + mkdir -p "${LFS}"/var + touch "${LFS}"/sources/limited +fi case $(uname -m) in x86_64) mkdir -p "${LFS}"/lib64 ;; @@ -142,7 +145,7 @@ chmod ugo+x preparechroot.sh chmod ugo+x insidechroot.sh printf "%b" "\n${CYN}PREPARING ${RED}CHROOT${CYN} ENVIRONMENT${RST}...\n" -sudo ./preparechroot.sh "${LFS}" +source preparechroot.sh "${LFS}" source createdirs.sh source essential.sh -- cgit v1.2.3-54-g00ecf