Add volume closing process

on unexpected finijsh of GUI/TUI installer.
This commit is contained in:
Suikan 2021-07-02 13:56:48 +09:00
parent 7ebd7fc535
commit 5cbe95252c

View file

@ -14,12 +14,17 @@ function parainstall() {
# Check if installer still exist # Check if installer still exist
if ! ps $INSTALLER_PID > /dev/null ; then # If not exists if ! ps $INSTALLER_PID > /dev/null ; then # If not exists
cat <<-HEREDOC 1>&2 cat <<-HEREDOC 1>&2
...The installer terminated unexpectedly. ***** ERROR : The GUI/TUI installer terminated unexpectedly. *****
...Delete the new logical volume "${VGNAME}-${LVROOTNAME}". ...Delete the new logical volume "${VGNAME}-${LVROOTNAME}".
HEREDOC HEREDOC
lvremove -f /dev/mapper/${VGNAME}-${LVROOTNAME} lvremove -f /dev/mapper/${VGNAME}-${LVROOTNAME}
echo "...Deactivate all logical volumes in volume group \"${VGNAME}\"."
vgchange -a n ${VGNAME}
echo "...Close LUKS volume \"${CRYPTPARTNAME}\"."
cryptsetup close ${CRYPTPARTNAME}
cat <<-HEREDOC 1>&2 cat <<-HEREDOC 1>&2
...The new logical volume is deleted. You can start Kaiten-yaki again.
...Installation process terminated. ...Installation process terminated.
HEREDOC HEREDOC
return 1 # with error status return 1 # with error status