Merge branch 'feature/1' into develop

This commit is contained in:
Suikan 2021-07-02 23:42:43 +09:00
commit 084df751fb
2 changed files with 55 additions and 13 deletions

View file

@ -28,6 +28,7 @@ These scripts are tested with following environment.
- Ubuntu Mate 20.04.2 amd64 desktop - Ubuntu Mate 20.04.2 amd64 desktop
- void-live-x86_64-20210218-mate.iso - void-live-x86_64-20210218-mate.iso
- void-live-x86_64-musl-20210218-mate.iso - void-live-x86_64-musl-20210218-mate.iso
- void-live-x86_64-20210218.iso
# Installation # Installation
Start the PC with the LiveCD/LiveUSB of the distribution to install. Download this repository from github, and expand it. Start the PC with the LiveCD/LiveUSB of the distribution to install. Download this repository from github, and expand it.
@ -40,8 +41,6 @@ If you install two or more Void Linux in to the EFI system, only the last one ca
# Variants considerations # Variants considerations
Ubuntu has several variants ( flavors ). While I have tested only MATE flavor, other flavor may work correctly as far as it uses Ubiquity installer. Ubuntu has several variants ( flavors ). While I have tested only MATE flavor, other flavor may work correctly as far as it uses Ubiquity installer.
Void Linux has "base" variant which doesn't have GUI. Kaiten-yaki can't run correctly without GUI.
# Acknowledgments # Acknowledgments
These scripts are based on the script shared on the [myn's diary](https://myn.hatenablog.jp/entry/install-ubuntu-focal-with-lvm-on-luks). That page contains rich information, hint and techniques around the encrypted volume and Ubiquity installer. These scripts are based on the script shared on the [myn's diary](https://myn.hatenablog.jp/entry/install-ubuntu-focal-with-lvm-on-luks). That page contains rich information, hint and techniques around the encrypted volume and Ubiquity installer.

View file

@ -7,7 +7,7 @@ function main() {
# Load functions # Load functions
source lib/confirmation.sh source lib/confirmation.sh
source lib/preinstall.sh source lib/preinstall.sh
source lib/parainstall.sh # source lib/parainstall.sh # we have customized parainstall
source lib/parainstall_msg.sh source lib/parainstall_msg.sh
@ -48,7 +48,7 @@ function main() {
# ******************************************************************************* # *******************************************************************************
# Install essential packages. # Install essential packages.
xbps-install -y -Su xbps gptfdisk xterm xbps-install -y -Su xbps gptfdisk
# Common part of the pre-install stage # Common part of the pre-install stage
if ! pre_install ; then if ! pre_install ; then
@ -83,19 +83,38 @@ function main() {
# waitfor a console input # waitfor a console input
read dummy_var read dummy_var
# Start void-installer in the separate window # Start the background target/etc/default/grub cheker.
xterm -fa monospace -fs ${XTERMFONTSIZE} -e void-installer & # The definition of this function is down below.
grub_check_and_modify &
# Record the PID of the installer. # Record the PID of the background checker.
export INSTALLER_PID=$! grub_check_and_modify_id=$!
# Common part of the para-install. # Start void-installer
# Record the install PID, modify the /etc/default/grub of the target, void-installer
# and then, wait for the end of sintaller.
if ! parainstall ; then # 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 "...Deactivating all logical volumes in volume group \"${VGNAME}\"."
vgchange -a n ${VGNAME}
echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"."
cryptsetup close ${CRYPTPARTNAME}
cat <<-HEREDOC 1>&2
...The new logical volume has been deleted. You can retry Kaiten-yaki again.
...Installation process terminated.
HEREDOC
return 1 # with error status return 1 # with error status
fi fi
# At here, the installation was successful.
# ******************************************************************************* # *******************************************************************************
# Post-install stage # Post-install stage
# ******************************************************************************* # *******************************************************************************
@ -164,5 +183,29 @@ function main() {
return 0 return 0
} }
# This function will be executed in the background context, to watch the TUI installer.
function grub_check_and_modify() {
# While the /etc/default/grub in the install target is NOT existing, keep sleeping.
# If installer terminated without file copy, this script also terminates.
while [ ! -e ${TARGETMOUNTPOINT}/etc/default/grub ]
do
sleep 1 # 1sec.
done # while
# 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 installer, but before the end of the file copy.
echo "...Adding GRUB_ENABLE_CRYPTODISK entry to ${TARGETMOUNTPOINT}/etc/default/grub "
echo "GRUB_ENABLE_CRYPTODISK=y" >> ${TARGETMOUNTPOINT}/etc/default/grub
# succesfull return
return 0
} # para install
# Execute # Execute
main main