Add and adjust erro rhanding.

Add error handling afer dd.
Error message of pre-install is now conditional.
This commit is contained in:
Suikan 2021-07-04 21:54:29 +09:00
parent 6810e4414a
commit 95d8c6f62c
2 changed files with 3 additions and 2 deletions

View file

@ -158,6 +158,7 @@ function pre_install() {
# Zap existing partition table
echo "...Erasing partition table of \"${DEV}\"."
dd if=/dev/zero of="${DEV}" bs=512 count=1
if is_error ; then return 1 ; fi; # If error, terminate
# Create MBR and allocate max storage for Linux partition
echo "...Creating a Linux partition on ${DEV} with MBR."
sfdisk "${DEV}" <<- HEREDOC