From e39b2de861f23165323cc18eca505456c4ae13d4 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Mon, 28 Jun 2021 23:43:12 +0900 Subject: [PATCH] Add erase all confirmation. --- ubuntu/1-pre-install.sh | 22 +++++++++++++++++++--- ubuntu/2-para-install.sh | 7 ++++++- ubuntu/3-post-install.sh | 8 ++++++-- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/ubuntu/1-pre-install.sh b/ubuntu/1-pre-install.sh index d99ca94..2d52230 100644 --- a/ubuntu/1-pre-install.sh +++ b/ubuntu/1-pre-install.sh @@ -39,8 +39,19 @@ source config.sh # ----- Format the disk and encrypt the LUKS partition ----- if [ ${ERASEALL} -eq 1 ] ; then -# Optional : Create partitions for in the physical disk. -# Assign specified space and rest of disk to the EFI and LUKS partition, respectively. +# For sure ask ready to erase. + echo "Are you sure you want to erase entire ${DEV}? [Y/N]" + read YESNO + if [ YESNO != "Y" -a YESNO != "y" ] ; then + cat <&2 +Check config.sh. The ERASEALL is ${ERASEALL}. + +Installation terminates. +HEREDOC + return + fi + + # Assign specified space and rest of disk to the EFI and LUKS partition, respectively. if [ ${ISEFI} -eq 1 ] ; then # Zap existing partition table and create new GPT sgdisk --zap-all "${DEV}" @@ -108,4 +119,9 @@ HEREDOC return fi -echo "1-pre-install.sh : Done." +cat <> /target/etc/default/grub -echo "2-para-install.sh : Done." \ No newline at end of file +cat <