aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-08 14:15:59 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-08 14:15:59 -0500
commit6fe7cbce4bdf80bc357fa5501aa69590772cfc57 (patch)
tree7e850ea1062a76f840eba9245480c77506c4c416
parentcf106d825a7c6501b7217652a74f1e5a7385133d (diff)
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.
-rwxr-xr-xlfs.sh21
1 files 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