From a4d166155ededc1fff62aaa507819b3480b203fc Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Wed, 30 Jun 2021 20:55:32 +0900 Subject: [PATCH] Integrate to one script --- script/{yafde-ubuntu.sh => ubuntu-bento.sh} | 88 +++++++++++++++------ 1 file changed, 65 insertions(+), 23 deletions(-) rename script/{yafde-ubuntu.sh => ubuntu-bento.sh} (75%) diff --git a/script/yafde-ubuntu.sh b/script/ubuntu-bento.sh similarity index 75% rename from script/yafde-ubuntu.sh rename to script/ubuntu-bento.sh index 14fc373..5c1df42 100644 --- a/script/yafde-ubuntu.sh +++ b/script/ubuntu-bento.sh @@ -16,14 +16,17 @@ fi # "sourced" validation # Load configuration parameter source config.sh -# ----- Confirmations ----- +# ******************************************************************************* +# Confirmation and Passphrase setting +# ******************************************************************************* + # Distribution check uname -a | grep ubuntu -i > /dev/null if [ $? -eq 1 ] ; then # "Ubuntu" is not found in the OS name. - echo "*********************************************************************************" + echo "*******************************************************************************" uname -a cat < /dev/null # ps return 0 if process exists. + if [ $? -ne 0 ] ; then # If not exists + cat <&2 +The ubiquity installer terminated unexpectedly. + +Installation process terminated. +HEREDOC + return + + fi done # Perhaps, too neuvous. Wait 1 more sectond to avoid the rece condition. sleep 1 # 1sec. # Make target GRUB aware to the crypt partition +# This must do it after start of the file copy by ubiquity, but before the end of the file copy. echo "...Add GRUB_ENABLE_CRYPTODISK entry to /target/etc/default/grub " echo "GRUB_ENABLE_CRYPTODISK=y" >> /target/etc/default/grub -# Now, we just wait the end of installation by Ubiquity. -echo "...Waiting the for GUI installer finishes" + +# And then, wait for the end of Ubiquity process +echo "...Waiting the end of Ubiquity installer." wait $ubiquity_pid -echo "...The return value of qubiquity is : " $? - -# For surre ask the config.sh is edited -echo "Now, final stage. Do you continue? [Y/N]" -read YESNO -if [ ${YESNO} != "Y" -a ${YESNO} != "y" ] ; then - cat <&2 - -Installation terminated. -HEREDOC - return -fi # if YES - -# ****************************** Post-install stage ****************************** +# ******************************************************************************* +# Post-install stage +# ******************************************************************************* # Varidate whether script is executed as sourced or not (return 0 2>/dev/null) && sourced=1 || sourced=0