Refactor the closing sequence.

All closing sequence is gathered to the post-install().
This commit is contained in:
Suikan 2022-05-10 22:22:30 +09:00
parent f725af8f44
commit 555bf5a38e
3 changed files with 18 additions and 33 deletions

View file

@ -395,12 +395,29 @@ function post_install() {
echo "...Unmounting all."
umount -R -l "${TARGETMOUNTPOINT}"
echo "...Post install process finished."
# Free LUKS volume as swap volume.
echo "...Disabling swap to release the LUKS volume."
swapoff -a
# Close LUKS
echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"."
vgchange -a n "${VGNAME}"
echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"."
cryptsetup close "${CRYPTPARTNAME}"
echo "...Post install process finished."
# Deleting the passphrase information.
echo "...Deleting passphrase information."
PASSPHRASE=""
export PASSPHRASE
# Finishing message
cat <<- HEREDOC
****************** Install process finished ******************
...Ready to reboot.
HEREDOC
return 0

View file

@ -66,22 +66,6 @@ function main() {
# The script is parameterized by env-variable to fit to the distribution
post_install
# Free LUKS volume as swap volume.
echo "...Disabling swap to release the LUKS volume."
swapoff -a
# Deleting the passphrase information.
echo "...Deleting passphrase information."
PASSPHRASE=""
export PASSPHRASE
# Finishing message
cat <<- HEREDOC
****************** Install process finished ******************
...Ready to reboot.
HEREDOC
# Normal end
return 0

View file

@ -81,22 +81,6 @@ function main() {
# The script is parameterized by env-variable to fit to the distribution
post_install
# Free LUKS volume as swap volume.
echo "...Disabling swap to release the LUKS volume."
swapoff -a
# Deleting the passphrase information.
echo "...Deleting passphrase information."
PASSPHRASE=""
export PASSPHRASE
# Finishing message
cat <<- HEREDOC
****************** Install process finished ******************
...Ready to reboot.
HEREDOC
# Normal end
return 0