diff --git a/script/lib/confirmation_common.sh b/script/lib/confirmation_common.sh index ddf6caa..6082dd1 100644 --- a/script/lib/confirmation_common.sh +++ b/script/lib/confirmation_common.sh @@ -7,7 +7,7 @@ function confirmation_common(){ # Consistency check for the OVERWRITEINSTALL and ERASEALL if [ ${ERASEALL} -eq 1 -a ${OVERWRITEINSTALL} -eq 1 ] ; then - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ***** ERROR : Confliction between ERASEALL and OVERWRITEINSTALL ***** ...ERASEALL = ${ERASEALL} ...OVERWRITEINSTALL = ${OVERWRITEINSTALL} @@ -20,7 +20,7 @@ function confirmation_common(){ # Sanity check for volume group name if echo ${VGNAME} | grep "-" -i > /dev/null ; then # "-" is found in the volume group name. - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ***** ERROR : VGNAME is "${VGNAME}" ***** ..."-" is not allowed in the volume name. ...Check configuration in your config.sh @@ -32,7 +32,7 @@ function confirmation_common(){ # Sanity check for root volume name if echo ${LVROOTNAME} | grep "-" -i > /dev/null ; then # "-" is found in the volume name. - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ***** ERROR : LVROOTNAME is "${LVROOTNAME}" ***** ..."-" is not allowed in the volume name. ...Check configuration in your config.sh @@ -44,7 +44,7 @@ function confirmation_common(){ # Sanity check for swap volume name if echo ${LVSWAPNAME} | grep "-" -i > /dev/null ; then # "-" is found in the volume name. - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ***** ERROR : LVSWAPNAME is "${LVSWAPNAME}" ***** ..."-" is not allowed in the volume name. ...Check configuration in your config.sh @@ -63,7 +63,7 @@ function confirmation_common(){ HEREDOC read YESNO if [ ${YESNO} != "Y" -a ${YESNO} != "y" ] ; then - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ...Installation process terminated.. HEREDOC @@ -75,7 +75,7 @@ function confirmation_common(){ echo "Are you sure you want to erase entire ${DEV}? [Y/N]" read YESNO if [ ${YESNO} != "Y" -a ${YESNO} != "y" ] ; then - cat <<-HEREDOC 1>&2 + cat <<-HEREDOC ...Check your config.sh. The variable ERASEALL is ${ERASEALL}. ...Installation process terminated.. @@ -96,7 +96,7 @@ function confirmation_common(){ # Validate whether both are indentical or not if [ ${PASSPHRASE} != ${PASSPHRASE_C} ] ; then - cat <<-HEREDOC 1>&2 + cat <<-HEREDOC ***** ERROR : Passphrase doesn't match ***** ...Installation process terminated.. diff --git a/script/lib/pre_install_common.sh b/script/lib/pre_install_common.sh index 82d679c..e2606a8 100644 --- a/script/lib/pre_install_common.sh +++ b/script/lib/pre_install_common.sh @@ -48,7 +48,7 @@ function pre_install_common() { # Check whether successful open. If mapped, it is successful. if [ ! -e /dev/mapper/${CRYPTPARTNAME} ] ; then - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ***** ERROR : Cannot open LUKS volume "${CRYPTPARTNAME}" on ${DEV}${CRYPTPARTITION}. ***** ...Check passphrase and your config.txt @@ -83,7 +83,7 @@ function pre_install_common() { if [ ${OVERWRITEINSTALL} -eq 1 ] ; then # exist and overwrite install echo "...Logical volume "${VGNAME}-${LVROOTNAME}" already exists. OK." else # exist and not overwriteinstall - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}" already exists. ***** ...Check LVROOTNAME environment variable in your config.txt. HEREDOC @@ -91,7 +91,7 @@ function pre_install_common() { vgchange -a n ${VGNAME} echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." cryptsetup close ${CRYPTPARTNAME} - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ...Installation process terminated.. HEREDOC @@ -99,7 +99,7 @@ function pre_install_common() { fi else # not exsit if [ ${OVERWRITEINSTALL} -eq 1 ] ; then - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}" doesn't exist while overwrite install. ***** ...Check consistency of your config.txt. HEREDOC @@ -107,7 +107,7 @@ function pre_install_common() { vgchange -a n ${VGNAME} echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." cryptsetup close ${CRYPTPARTNAME} - cat <<- HEREDOC 1>&2 + cat <<- HEREDOC ...Installation process terminated.. HEREDOC diff --git a/script/ubuntu-kaiten-yaki.sh b/script/ubuntu-kaiten-yaki.sh index 11c1c0a..9cf0ff8 100644 --- a/script/ubuntu-kaiten-yaki.sh +++ b/script/ubuntu-kaiten-yaki.sh @@ -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. diff --git a/script/void-kaiten-yaki.sh b/script/void-kaiten-yaki.sh index ffc1e53..cc5b39a 100644 --- a/script/void-kaiten-yaki.sh +++ b/script/void-kaiten-yaki.sh @@ -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 @@ -67,7 +67,7 @@ function main() { # Show common message to let the operator focus on the critical part para_install_msg_common - + # Void-Linux dependent message cat <<- HEREDOC @@ -96,16 +96,17 @@ function main() { # Check if background checker still exist if ps $grub_check_and_modify_id > /dev/null ; then # If exists # If exist, the grub was not modifyed -> void-installer termianted unexpectedly - 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.