diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-04-08 14:18:31 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-04-08 14:18:31 -0500 |
commit | 00cc0ad03f23002304f4eccdaa36edc8cca66618 (patch) | |
tree | 6ac78a34bdd3d41cb4965620851d2120b7fc5572 | |
parent | 67cb525d4086c6a5115f27eaab12f239dcc0dec8 (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-x | lfs.sh | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -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 @@ -151,6 +154,8 @@ sleep 3 # Create chapter7 log directory as non root user mkdir -p "${LFS}"/sources/log/chapter7 + +# Enter CHROOT for chapter 7 sudo chroot "${LFS}" /usr/bin/env -i \ HOME=/root \ TERM="${TERM}" \ |