Refactored

This commit is contained in:
Suikan 2021-07-01 20:57:24 +09:00
parent 3a5446c6ad
commit d51c88949b
6 changed files with 71 additions and 18 deletions

View file

@ -3,6 +3,12 @@
# Load configuration parameter
source config.sh
# Load functions
source common/confirmation.sh
source common/preinstall.sh
source common/parainstall.sh
source common/parainstall_msg.sh
# Varidate whether script is executed as sourced or not
(return 0 2>/dev/null) && sourced=1 || sourced=0
if [ $sourced -eq 0 ] ; then
@ -46,7 +52,9 @@ fi # "Void" is not found in the OS name.
# *******************************************************************************
# Common part of the parameter confirmation
source common/_confirmation.sh
if ! confirmation ; then
return 1
fi
# *******************************************************************************
# Pre-install stage
@ -61,7 +69,9 @@ else
fi
# Common part of the pre-install stage
source common/_preinstall.sh
if ! pre_install ; then
return 1
fi
# ADD "rd.auto=1 cryptdevice=/dev/sda2:${LUKS_NAME} root=/dev/mapper/${VGNAME}-${ROOTNAME}" to GRUB.
# This is magical part. I have not understood why this is required.
@ -75,7 +85,9 @@ sed -i "s#loglevel=4#loglevel=4 rd.auto=1 cryptdevice=/dev/sda2:${LUKS_NAME} roo
# *******************************************************************************
# Show common message to let the operator focus on the critical part
source common/_parainstall_msg.sh
if ! parainstall ; then
return 1
fi
# Ubuntu dependent message
cat <<HEREDOC