Add erase all confirmation.

This commit is contained in:
Suikan 2021-06-28 23:43:12 +09:00
parent 0a4238165c
commit e39b2de861
3 changed files with 31 additions and 6 deletions

View file

@ -39,8 +39,19 @@ source config.sh
# ----- Format the disk and encrypt the LUKS partition ----- # ----- Format the disk and encrypt the LUKS partition -----
if [ ${ERASEALL} -eq 1 ] ; then if [ ${ERASEALL} -eq 1 ] ; then
# Optional : Create partitions for in the physical disk. # For sure ask ready to erase.
# Assign specified space and rest of disk to the EFI and LUKS partition, respectively. 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
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 if [ ${ISEFI} -eq 1 ] ; then
# Zap existing partition table and create new GPT # Zap existing partition table and create new GPT
sgdisk --zap-all "${DEV}" sgdisk --zap-all "${DEV}"
@ -108,4 +119,9 @@ HEREDOC
return return
fi fi
echo "1-pre-install.sh : Done." cat <<HEREDOC
1-pre-install.sh : Done. Next, run the Ubiquity installer.
HEREDOC

View file

@ -28,4 +28,9 @@ fi
# Make target GRUB aware to the crypt partition # Make target GRUB aware to the crypt partition
echo "GRUB_ENABLE_CRYPTODISK=y" >> /target/etc/default/grub echo "GRUB_ENABLE_CRYPTODISK=y" >> /target/etc/default/grub
echo "2-para-install.sh : Done." cat <<HEREDOC
2-para-install.sh : Done.
Make sure to click "Continue Testing", when the Ubiquity installer finishes.
HEREDOC

View file

@ -20,7 +20,7 @@ mount /dev/mapper/${VGNAME}-${LVROOTNAME} /target
# And mount other directories # And mount other directories
for n in proc sys dev etc/resolv.conf; do mount --rbind "/$n" "/target/$n"; done for n in proc sys dev etc/resolv.conf; do mount --rbind "/$n" "/target/$n"; done
# Change root # Change root and create the keyfile and ramfs image for Linux kernel.
cat <<HEREDOC | chroot /target /bin/bash cat <<HEREDOC | chroot /target /bin/bash
``` ```
# Mount the rest of partitions by target /etc/fstab # Mount the rest of partitions by target /etc/fstab
@ -50,4 +50,8 @@ update-initramfs -uk all
exit exit
HEREDOC HEREDOC
echo "3-para-install.sh : Done." cat <<HEREDOC
3-pro-install.sh : Done. Ready to reboot.
HEREDOC