mirror of
https://github.com/suikan4github/kaiten-yaki.git
synced 2025-12-20 02:21:17 -03:00
Add volume protection logic
In cae of the unexpected quit of GUI/TUI installer, The target volume was deleted always. Changed it to delete only when
This commit is contained in:
parent
fb3720787c
commit
b9e490e5f3
4 changed files with 28 additions and 27 deletions
|
|
@ -24,7 +24,7 @@ function main() {
|
|||
HEREDOC
|
||||
read YESNO
|
||||
if [ ${YESNO} != "Y" -a ${YESNO} != "y" ] ; then
|
||||
cat <<- HEREDOC 1>&2
|
||||
cat <<- HEREDOC
|
||||
|
||||
...Installation process terminated..
|
||||
HEREDOC
|
||||
|
|
@ -177,16 +177,16 @@ function grub_check_and_modify() {
|
|||
|
||||
# Check if installer still exist
|
||||
if ! ps $INSTALLER_PID > /dev/null ; then # If not exists
|
||||
cat <<-HEREDOC 1>&2
|
||||
***** ERROR : The GUI/TUI installer terminated unexpectedly. *****
|
||||
...Deleting the new logical volume "${VGNAME}-${LVROOTNAME}".
|
||||
HEREDOC
|
||||
lvremove -f /dev/mapper/${VGNAME}-${LVROOTNAME}
|
||||
echo "***** ERROR : The GUI/TUI installer terminated unexpectedly. *****"
|
||||
if [ ${OVERWRITEINSTALL} -eq 0 ] ; then # If not over install, volume is new. So delete it
|
||||
echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"."
|
||||
lvremove -f /dev/mapper/${VGNAME}-${LVROOTNAME}
|
||||
fi
|
||||
echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"."
|
||||
vgchange -a n ${VGNAME}
|
||||
echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"."
|
||||
cryptsetup close ${CRYPTPARTNAME}
|
||||
cat <<-HEREDOC 1>&2
|
||||
cat <<-HEREDOC
|
||||
|
||||
...The new logical volume has been deleted. You can retry Kaiten-yaki again.
|
||||
...Installation process terminated.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue