aboutsummaryrefslogtreecommitdiffstats
path: root/setupdisk.sh
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-02 10:42:44 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-02 10:42:44 -0500
commitf063af2cf37ddb9e542e8b085f350f79802e87e8 (patch)
tree4e48de891cdc623c5782263b7bf7c85fd6be0762 /setupdisk.sh
parentd9af1744baa9db3b6c9c7eb9df057b965aa6e3ed (diff)
parent6a4f0a701b1f4d72cdd46bfe506a2dd517bd4932 (diff)
Merge branch 'cleanup' into chapter7
Diffstat (limited to 'setupdisk.sh')
-rw-r--r--setupdisk.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/setupdisk.sh b/setupdisk.sh
index 569cb2d..6d13436 100644
--- a/setupdisk.sh
+++ b/setupdisk.sh
@@ -20,7 +20,15 @@ p
w
q
EOF
-
+if [[ "$?" -ne 0 ]]; then
+ printf "%b" " ${IGRN}Creating partition ${IWHT}${LFS_DISK}${LFS_PART} \
+${IRED}FAILED!${RST}\n"
+ exit 1
+fi
printf "%b" " ${IGRN}Formatting ${IWHT}${LFS_DISK}${LFS_PART} with \
-${YLW}EXT4${IGRN} filesystem and label ${IWHT}${LFS_VER}${RST}\n"
-sudo /sbin/mkfs -t ext4 -L "${LFS_VER}" -F "${LFS_DISK}${LFS_PART}" >/dev/null 2>&1
+${IWHT}${LFS_FS}${IGRN} filesystem and label ${IWHT}${LFS_VER}${RST}\n"
+if ! sudo /sbin/mkfs -t ${LFS_FS,,} -L "${LFS_VER}" -F "${LFS_DISK}${LFS_PART}" >/dev/null 2>&1; then
+ printf "%b" " ${IGRN}Creating ${IWHT}${LFS_FS}${IGRN} filesystem at \
+${IWHT}${LFS_DISK}${LFS_PART} ${IRED}FAILED!${RST}\n"
+ exit 1
+fi