From 73b3329cd79484090b071c27dfaff7ffba0ca75a Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Wed, 11 May 2022 07:16:08 +0900 Subject: [PATCH] Add "[Kaiten-Yaki]" to the message header --- script/config.sh | 2 +- script/lib/chrooted_job_ubuntu.sh | 12 +-- script/lib/chrooted_job_void.sh | 14 +-- script/lib/common.sh | 140 +++++++++++++++--------------- script/ubuntu-kaiten-yaki.sh | 20 ++--- script/void-kaiten-yaki.sh | 24 ++--- 6 files changed, 106 insertions(+), 106 deletions(-) diff --git a/script/config.sh b/script/config.sh index a4b0e8e..4ed7602 100644 --- a/script/config.sh +++ b/script/config.sh @@ -42,7 +42,7 @@ export LVEXT2SUFFIX="_var" # 5. LVEXT2 if needed # Set the size of EFI partition and swap partition. -# The unit is Byte. You can use M,G... notation. +# The unit is Byte. You can use M,G[Kaiten-Yaki] notation. # You CANNOT use the % notation. export EFISIZE="200M" diff --git a/script/lib/chrooted_job_ubuntu.sh b/script/lib/chrooted_job_ubuntu.sh index 9fdc473..2470a61 100644 --- a/script/lib/chrooted_job_ubuntu.sh +++ b/script/lib/chrooted_job_ubuntu.sh @@ -6,7 +6,7 @@ function chrooted_job() { mount -a # Prepare the crypto tool in the install target - echo "...Installing cryptsetup-initramfs package." + echo "[Kaiten-Yaki] Installing cryptsetup-initramfs package." apt -qq install -y cryptsetup-initramfs # Prepare a new key file to embed in to the ramfs. @@ -14,28 +14,28 @@ function chrooted_job() { # The new key is 4096byte length binary value. # Because this key is sotred as "cleartext", in the target file sysmte, # only root is allowed to access this key file. - echo "...Prepairing key file." + echo "[Kaiten-Yaki] Prepairing key file." mkdir /etc/luks dd if=/dev/urandom of=/etc/luks/boot_os.keyfile bs=4096 count=1 status=none chmod u=rx,go-rwx /etc/luks chmod u=r,go-rwx /etc/luks/boot_os.keyfile # Add the new key to the LUKS 2nd key slot. The passphrase is required to modify the LUKS keyslot. - echo "...Adding a key to the key file." + echo "[Kaiten-Yaki] Adding a key to the key file." printf %s "${PASSPHRASE}" | cryptsetup luksAddKey --iter-time "${ITERTIME}" -d - "${DEV}${CRYPTPARTITION}" /etc/luks/boot_os.keyfile # Register the LUKS voluem to /etc/crypttab to tell "This volume is encrypted" - echo "...Adding LUKS volume info to /etc/crypttab." + echo "[Kaiten-Yaki] Adding LUKS volume info to /etc/crypttab." echo "${CRYPTPARTNAME} UUID=$(blkid -s UUID -o value ${DEV}${CRYPTPARTITION}) /etc/luks/boot_os.keyfile luks,discard" >> /etc/crypttab # Add key file to the list of the intems in initramfs. # See https://cryptsetup-team.pages.debian.net/cryptsetup/README.initramfs.html for detail - echo "...Directing to include keyfile into the initramfs" + echo "[Kaiten-Yaki] Directing to include keyfile into the initramfs" echo "KEYFILE_PATTERN=/etc/luks/*.keyfile" >> /etc/cryptsetup-initramfs/conf-hook echo "UMASK=0077" >> /etc/initramfs-tools/initramfs.conf # Finally, update the ramfs initial image with the key file. - echo "...Upadting initramfs." + echo "[Kaiten-Yaki] Upadting initramfs." update-initramfs -uk all # Leave chroot diff --git a/script/lib/chrooted_job_void.sh b/script/lib/chrooted_job_void.sh index 2bb8430..a908bbb 100644 --- a/script/lib/chrooted_job_void.sh +++ b/script/lib/chrooted_job_void.sh @@ -6,7 +6,7 @@ function chrooted_job() { mount -a # Prepare the crypto tool in the install target - echo "...Installing cryptsetup-initramfs package." + echo "[Kaiten-Yaki] Installing cryptsetup-initramfs package." xbps-install -y lvm2 cryptsetup # Prepare a new key file to embed in to the ramfs. @@ -14,29 +14,29 @@ function chrooted_job() { # The new key is 4096byte length binary value. # Because this key is sotred as "cleartext", in the target file sysmte, # only root is allowed to access this key file. - echo "...Prepairing key file." + echo "[Kaiten-Yaki] Prepairing key file." mkdir /etc/luks dd if=/dev/urandom of=/etc/luks/boot_os.keyfile bs=4096 count=1 status=none chmod u=rx,go-rwx /etc/luks chmod u=r,go-rwx /etc/luks/boot_os.keyfile # Add the new key to the LUKS 2nd key slot. The passphrase is required to modify the LUKS keyslot. - echo "...Adding a key to the key file." + echo "[Kaiten-Yaki] Adding a key to the key file." printf %s "${PASSPHRASE}" | cryptsetup luksAddKey --iter-time "${ITERTIME}" -d - "${DEV}${CRYPTPARTITION}" /etc/luks/boot_os.keyfile # Register the LUKS voluem to /etc/crypttab to tell "This volume is encrypted" - echo "...Adding LUKS volume info to /etc/crypttab." + echo "[Kaiten-Yaki] Adding LUKS volume info to /etc/crypttab." echo "${CRYPTPARTNAME} UUID=$(blkid -s UUID -o value ${DEV}${CRYPTPARTITION}) /etc/luks/boot_os.keyfile luks,discard" >> /etc/crypttab # Add key file to the list of the intems in initramfs. # See https://man7.org/linux/man-pages/man5/dracut.conf.5.html for details. - echo "...Directing to include keyfile into the initramfs" + echo "[Kaiten-Yaki] Directing to include keyfile into the initramfs" echo 'install_items+=" /etc/luks/boot_os.keyfile /etc/crypttab " ' >> /etc/dracut.conf.d/10-crypt.conf # Finally, update the ramfs initial image with the key file. - echo "...Upadting initramfs." + echo "[Kaiten-Yaki] Upadting initramfs." xbps-reconfigure -fa - echo "...grub-mkconfig." + echo "[Kaiten-Yaki] grub-mkconfig." grub-mkconfig -o /boot/grub/grub.cfg # Leave chroot diff --git a/script/lib/common.sh b/script/lib/common.sh index e9d5ec9..ddd4fa0 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -9,11 +9,11 @@ function confirmation(){ if [ "${ERASEALL}" -ne 0 ] && [ "${OVERWRITEINSTALL}" -ne 0 ] ; then cat <<- HEREDOC ***** ERROR : Confliction between ERASEALL and OVERWRITEINSTALL ***** - ...ERASEALL = ${ERASEALL} - ...OVERWRITEINSTALL = ${OVERWRITEINSTALL} - ...Check configuration in your config.sh + [Kaiten-Yaki] ERASEALL = ${ERASEALL} + [Kaiten-Yaki] OVERWRITEINSTALL = ${OVERWRITEINSTALL} + [Kaiten-Yaki] Check configuration in your config.sh - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC return 1 # with error status fi @@ -22,10 +22,10 @@ function confirmation(){ if echo "${VGNAME}" | grep "-" -i > /dev/null ; then # "-" is found in the volume group name. cat <<- HEREDOC ***** ERROR : VGNAME is "${VGNAME}" ***** - ..."-" is not allowed in the volume name. - ...Check configuration in your config.sh + [Kaiten-Yaki] "-" is not allowed in the volume name. + [Kaiten-Yaki] Check configuration in your config.sh - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC return 1 # with error status fi # "-" is found in the volume group name. @@ -34,10 +34,10 @@ function confirmation(){ if echo "${LVROOTNAME}" | grep "-" -i > /dev/null ; then # "-" is found in the volume name. cat <<- HEREDOC ***** ERROR : LVROOTNAME is "${LVROOTNAME}" ***** - ..."-" is not allowed in the volume name. - ...Check configuration in your config.sh + [Kaiten-Yaki] "-" is not allowed in the volume name. + [Kaiten-Yaki] Check configuration in your config.sh - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC return 1 # with error status fi # "-" is found in the volume name. @@ -47,10 +47,10 @@ function confirmation(){ if echo "${LVEXT1SUFFIX}" | grep "-" -i > /dev/null ; then # "-" is found in the volume name. cat <<- HEREDOC ***** ERROR : LVEXT1SUFFIX is "${LVEXT1SUFFIX}" ***** - ..."-" is not allowed in the volume name. - ...Check configuration in your config.sh + [Kaiten-Yaki] "-" is not allowed in the volume name. + [Kaiten-Yaki] Check configuration in your config.sh - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC return 1 # with error status fi # "-" is found in the volume suffix. @@ -61,10 +61,10 @@ function confirmation(){ if echo "${LVEXT2SUFFIX}" | grep "-" -i > /dev/null ; then # "-" is found in the volume name. cat <<- HEREDOC ***** ERROR : LVEXT2SUFFIX is "${LVEXT2SUFFIX}" ***** - ..."-" is not allowed in the volume name. - ...Check configuration in your config.sh + [Kaiten-Yaki] "-" is not allowed in the volume name. + [Kaiten-Yaki] Check configuration in your config.sh - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC return 1 # with error status fi # "-" is found in the volume suffix. @@ -74,10 +74,10 @@ function confirmation(){ if echo "${LVSWAPNAME}" | grep "-" -i > /dev/null ; then # "-" is found in the volume name. cat <<- HEREDOC ***** ERROR : LVSWAPNAME is "${LVSWAPNAME}" ***** - ..."-" is not allowed in the volume name. - ...Check configuration in your config.sh + [Kaiten-Yaki] "-" is not allowed in the volume name. + [Kaiten-Yaki] Check configuration in your config.sh - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC return 1 # with error status fi # "-" is found in the volume name. @@ -113,22 +113,22 @@ function confirmation(){ HEREDOC if [ "${ERASEALL}" -ne 0 ] ; then - echo "Going to erase entire disk ${DEV}." + echo "[Kaiten-Yaki] Going to erase entire disk ${DEV}." elif [ "${OVERWRITEINSTALL}" -ne 0 ] ; then - echo "Going to overwrite the logical volume \"${VGNAME}-${LVROOTNAME}\"." + echo "[Kaiten-Yaki] Going to overwrite the logical volume \"${VGNAME}-${LVROOTNAME}\"." else - echo "Going to create a new logical volume \"${VGNAME}-${LVROOTNAME}\"." + echo "[Kaiten-Yaki] Going to create a new logical volume \"${VGNAME}-${LVROOTNAME}\"." fi # ----- Set Passphrase ----- # Input passphrase echo "" - echo "Type passphrase for the disk encryption." + echo "[Kaiten-Yaki] Type passphrase for the disk encryption." read -sr PASSPHRASE export PASSPHRASE - echo "Type passphrase again, to confirm." + echo "[Kaiten-Yaki] Type passphrase again, to confirm." read -sr PASSPHRASE_C # Validate whether both are indentical or not @@ -136,7 +136,7 @@ function confirmation(){ cat <<-HEREDOC ***** ERROR : Passphrase doesn't match ***** - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC return 1 # with error status else @@ -186,19 +186,19 @@ function pre_install() { # Assign specified space and rest of disk to the EFI and LUKS partition, respectively. if [ "${ISEFI}" -ne 0 ] ; then # EFI # Zap existing partition table and create new GPT - echo "...Initializing \"${DEV}\" with GPT." + echo "[Kaiten-Yaki] Initializing \"${DEV}\" with GPT." sgdisk --zap-all "${DEV}" if is_error ; then return 1 ; fi; # If error, terminate # Create EFI partition and format it - echo "...Creating an EFI partition on \"${DEV}\"." + echo "[Kaiten-Yaki] Creating an EFI partition on \"${DEV}\"." # shellcheck disable=SC2140 sgdisk --new="${EFIPARTITION}":0:+"${EFISIZE}" --change-name="${EFIPARTITION}":"EFI System" --typecode="${EFIPARTITION}":ef00 "${DEV}" if is_error ; then return 1 ; fi; # If error, terminate - echo "...Formatting the EFI parttion." + echo "[Kaiten-Yaki] Formatting the EFI parttion." mkfs.vfat -F 32 -n EFI-SP "${DEV}${EFIPARTITION}" if is_error ; then return 1 ; fi; # If error, terminate # Create Linux partition - echo "...Creating a Linux partition on ${DEV}." + echo "[Kaiten-Yaki] Creating a Linux partition on ${DEV}." # shellcheck disable=SC2140 sgdisk --new="${CRYPTPARTITION}":0:0 --change-name="${CRYPTPARTITION}":"Linux LUKS" --typecode="${CRYPTPARTITION}":8309 "${DEV}" if is_error ; then return 1 ; fi; # If error, terminate @@ -206,11 +206,11 @@ function pre_install() { sgdisk --print "${DEV}" else # BIOS # Zap existing partition table - echo "...Erasing partition table of \"${DEV}\"." + echo "[Kaiten-Yaki] Erasing partition table of \"${DEV}\"." dd if=/dev/zero of="${DEV}" bs=512 count=1 if is_error ; then return 1 ; fi; # If error, terminate # Create MBR and allocate max storage for Linux partition - echo "...Creating a Linux partition on ${DEV} with MBR." + echo "[Kaiten-Yaki] Creating a Linux partition on ${DEV} with MBR." sfdisk "${DEV}" <<- HEREDOC 2M,,L HEREDOC @@ -218,23 +218,23 @@ function pre_install() { fi # if EFI firmware # Encrypt the partition to install Linux - echo "...Initializing \"${DEV}${CRYPTPARTITION}\" as crypt partition" + echo "[Kaiten-Yaki] Initializing \"${DEV}${CRYPTPARTITION}\" as crypt partition" printf %s "${PASSPHRASE}" | cryptsetup luksFormat --iter-time "${ITERTIME}" --type=luks1 --key-file - --batch-mode "${DEV}${CRYPTPARTITION}" fi # if erase all # ----- Open the LUKS partition ----- # Open the crypt partition. - echo "...Opening a crypt partition \"${DEV}${CRYPTPARTITION}\" as \"${CRYPTPARTNAME}\"" + echo "[Kaiten-Yaki] Opening a crypt partition \"${DEV}${CRYPTPARTITION}\" as \"${CRYPTPARTNAME}\"" printf %s "${PASSPHRASE}" | cryptsetup open -d - "${DEV}${CRYPTPARTITION}" "${CRYPTPARTNAME}" # Check whether successful open. If mapped, it is successful. if [ ! -e /dev/mapper/"${CRYPTPARTNAME}" ] ; then cat <<- HEREDOC ***** ERROR : Cannot open LUKS volume "${CRYPTPARTNAME}" on "${DEV}${CRYPTPARTITION}". ***** - ...Check passphrase and your config.txt + [Kaiten-Yaki] Check passphrase and your config.txt - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC return 1 # with error status fi # if crypt volume is unable to open @@ -242,25 +242,25 @@ function pre_install() { # ----- Configure the LVM in LUKS volume ----- # Check volume group ${VGNAME} exist or not if vgdisplay -s "${VGNAME}" &> /dev/null ; then # if exist - echo "...Volume group \"${VGNAME}\" already exist. Skipped to create. No problem." - echo "...Activating all logical volumes in volume group \"${VGNAME}\"." + echo "[Kaiten-Yaki] Volume group \"${VGNAME}\" already exist. Skipped to create. No problem." + echo "[Kaiten-Yaki] Activating all logical volumes in volume group \"${VGNAME}\"." vgchange -ay - echo "...Scanning all logical volumes." + echo "[Kaiten-Yaki] Scanning all logical volumes." lvscan else - echo "...Initializing a physical volume on \"${CRYPTPARTNAME}\"" + echo "[Kaiten-Yaki] Initializing a physical volume on \"${CRYPTPARTNAME}\"" pvcreate /dev/mapper/"${CRYPTPARTNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; - echo "...And then creating Volume group \"${VGNAME}\"." + echo "[Kaiten-Yaki] And then creating Volume group \"${VGNAME}\"." vgcreate "${VGNAME}" /dev/mapper/"${CRYPTPARTNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; fi # if /dev/volume-groupt exist # Create a SWAP Logical Volume on VG, if it doesn't exist if [ -e /dev/mapper/"${VGNAME}"-"${LVSWAPNAME}" ] ; then - echo "...Swap volume already exist. Skipped to create. No problem." + echo "[Kaiten-Yaki] Swap volume already exist. Skipped to create. No problem." else - echo "...Creating logical volume \"${LVSWAPNAME}\" on \"${VGNAME}\"." + echo "[Kaiten-Yaki] Creating logical volume \"${LVSWAPNAME}\" on \"${VGNAME}\"." # Too use the bash IFS, first parameter is not quoted. lvcreate ${LVSWAPSIZE} -n "${LVSWAPNAME}" "${VGNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; @@ -269,7 +269,7 @@ function pre_install() { # Create a ROOT Logical Volume on VG. if [ -e /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" ] ; then # exist if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then # exist and overwrite install - echo "...Logical volume \"${VGNAME}-${LVROOTNAME}\" already exists. OK." + echo "[Kaiten-Yaki] Logical volume \"${VGNAME}-${LVROOTNAME}\" already exists. OK." # Create extended volumes if needed create_ext_lv @@ -278,7 +278,7 @@ function pre_install() { else # exist and not overwriteinstall cat <<- HEREDOC ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}" already exists. ***** - ...Check LVROOTNAME environment variable in your config.txt. + [Kaiten-Yaki] Check LVROOTNAME environment variable in your config.txt. HEREDOC # Deactivate all lg and close the LUKS volume deactivate_and_close @@ -288,13 +288,13 @@ function pre_install() { if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then # not exist and overwrite install cat <<- HEREDOC ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}" doesn't exist while overwrite install. ***** - ...Check consistency of your config.txt. + [Kaiten-Yaki] Check consistency of your config.txt. HEREDOC # Deactivate all lg and close the LUKS volume deactivate_and_close return 1 # with error status else # not exist and not overwrite install - echo "...Creating logical volume \"${LVROOTNAME}\" on \"${VGNAME}\"." + echo "[Kaiten-Yaki] Creating logical volume \"${LVROOTNAME}\" on \"${VGNAME}\"." # Too use the bash IFS, first parameter is not quoted. lvcreate ${LVROOTSIZE} -n "${LVROOTNAME}" "${VGNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; @@ -367,15 +367,15 @@ function post_install() { # ${BTRFSOPTION} is defined by the caller of this function for BTRFS formated volume. # ${BTRFSOPTION} have to be NOT quoted. Otherwise, mount will receive an empty # string as first option, when the veraible is empty. - echo "...Mounting /dev/mapper/${VGNAME}-${LVROOTNAME} on ${TARGETMOUNTPOINT}." + echo "[Kaiten-Yaki] Mounting /dev/mapper/${VGNAME}-${LVROOTNAME} on ${TARGETMOUNTPOINT}." mount ${BTRFSOPTION} /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" "${TARGETMOUNTPOINT}" # And mount other directories - echo "...Mounting all other dirs." + echo "[Kaiten-Yaki] Mounting all other dirs." for n in proc sys dev tmp etc/resolv.conf; do mount --rbind "/$n" "${TARGETMOUNTPOINT}/$n"; done # Copy all scripts to the target /tmp for using in chroot session. - echo "...Copying files in current dir to ${TARGETMOUNTPOINT}/tmp." + echo "[Kaiten-Yaki] Copying files in current dir to ${TARGETMOUNTPOINT}/tmp." mkdir "${TARGETMOUNTPOINT}/tmp/kaiten-yaki" cp -r ./* -t "${TARGETMOUNTPOINT}/tmp/kaiten-yaki" @@ -383,7 +383,7 @@ function post_install() { # The here-document is script executed under chroot. At here we call # the distribution dependent script "lib/chrooted_job_${DISTRIBUTIONSIGNATURE}.sh", # which was copied to /temp at previous code. - echo "...Chroot to ${TARGETMOUNTPOINT}. and execute chrooted_job_${DISTRIBUTIONSIGNATURE}.sh" + echo "[Kaiten-Yaki] Chroot to ${TARGETMOUNTPOINT}. and execute chrooted_job_${DISTRIBUTIONSIGNATURE}.sh" # shellcheck disable=SC2086 cat <<- HEREDOC | chroot "${TARGETMOUNTPOINT}" /bin/bash cd /tmp/kaiten-yaki @@ -392,23 +392,23 @@ function post_install() { HEREDOC # Unmount all. -l ( lazy ) option is added to supress the busy error. - echo "...Unmounting all." + echo "[Kaiten-Yaki] Unmounting all." umount -R -l "${TARGETMOUNTPOINT}" - echo "...Post install process finished." + echo "[Kaiten-Yaki] Post install process finished." # Free LUKS volume as swap volume. - echo "...Disabling swap to release the LUKS volume." + echo "[Kaiten-Yaki] Disabling swap to release the LUKS volume." swapoff -a # Close LUKS - echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"." + echo "[Kaiten-Yaki] Deactivating all logical volumes in volume group \"${VGNAME}\"." vgchange -a n "${VGNAME}" - echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." + echo "[Kaiten-Yaki] Closing LUKS volume \"${CRYPTPARTNAME}\"." cryptsetup close "${CRYPTPARTNAME}" # Deleting the passphrase information. - echo "...Deleting passphrase information." + echo "[Kaiten-Yaki] Deleting passphrase information." PASSPHRASE="" export PASSPHRASE @@ -416,7 +416,7 @@ function post_install() { cat <<- HEREDOC ****************** Install process finished ****************** - ...Ready to reboot. + [Kaiten-Yaki] Ready to reboot. HEREDOC return 0 @@ -433,32 +433,32 @@ function deactivate_and_close(){ if [ "${IS_ROOT_CREATED}" -ne 0 ] ; then # if extra volume 1 created # Remove newly created root volume - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." + echo "[Kaiten-Yaki] Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" fi if [ "${IS_LVEXT1_CREATED}" -ne 0 ] ; then # if extra volume 1 created # Remove newly created extra volume 1 - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." + echo "[Kaiten-Yaki] Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" fi if [ "${IS_LVEXT2_CREATED}" -ne 0 ] ; then # if extra volume 2 created # Remove newly created extra volume 2 - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\"." + echo "[Kaiten-Yaki] Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\"." lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT2SUFFIX}" fi - echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"." + echo "[Kaiten-Yaki] Deactivating all logical volumes in volume group \"${VGNAME}\"." vgchange -a n "${VGNAME}" - echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." + echo "[Kaiten-Yaki] Closing LUKS volume \"${CRYPTPARTNAME}\"." cryptsetup close "${CRYPTPARTNAME}" cat <<- HEREDOC - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC } @@ -469,11 +469,11 @@ function deactivate_and_close(){ function on_unexpected_installer_quit(){ echo "***** ERROR : The GUI/TUI installer terminated unexpectedly. *****" if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then # If overwrite install, keep the volume - echo "...Keep logical volume \"${VGNAME}-${LVROOTNAME}\" untouched." + echo "[Kaiten-Yaki] Keep logical volume \"${VGNAME}-${LVROOTNAME}\" untouched." fi # Deactivate all lg and close the LUKS volume deactivate_and_close - echo "...You can retry Kaiten-yaki again." + echo "[Kaiten-Yaki] You can retry Kaiten-yaki again." } @@ -493,7 +493,7 @@ function distribution_check(){ if [ "${YESNO}" != "Y" ] && [ "${YESNO}" != "y" ] ; then cat <<- HEREDOC - ...Installation process terminated.. + [Kaiten-Yaki] Installation process terminated.. HEREDOC return 1 # with error status fi # if YES @@ -512,9 +512,9 @@ function distribution_check(){ function create_ext_lv() { if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 if [ -e /dev/mapper/"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" ] ; then # if extra volume 1 exist - echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\" already exists. OK." + echo "[Kaiten-Yaki] Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\" already exists. OK." else - echo "...Creating logical volume \"${LVROOTNAME}${LVEXT1SUFFIX}\" on \"${VGNAME}\"." + echo "[Kaiten-Yaki] Creating logical volume \"${LVROOTNAME}${LVEXT1SUFFIX}\" on \"${VGNAME}\"." # Too use the bash IFS, first parameter is not quoted. lvcreate ${LVEXT1SIZE} -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail @@ -528,9 +528,9 @@ function create_ext_lv() { if [ "${USELVEXT2}" -ne 0 ] ; then # if using extra volume 2 if [ -e /dev/mapper/"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}" ] ; then # if extra volume 2 exist - echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\" already exists. OK." + echo "[Kaiten-Yaki] Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\" already exists. OK." else - echo "...Creating logical volume \"${LVROOTNAME}${LVEXT2SUFFIX}\" on \"${VGNAME}\"." + echo "[Kaiten-Yaki] Creating logical volume \"${LVROOTNAME}${LVEXT2SUFFIX}\" on \"${VGNAME}\"." # Too use the bash IFS, first parameter is not quoted. lvcreate ${LVEXT2SIZE} -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail diff --git a/script/ubuntu-kaiten-yaki.sh b/script/ubuntu-kaiten-yaki.sh index adfbbdd..0691f7b 100644 --- a/script/ubuntu-kaiten-yaki.sh +++ b/script/ubuntu-kaiten-yaki.sh @@ -81,13 +81,13 @@ function para_install_local() { # Distrobution dependent message cat <<- HEREDOC - ************************ CAUTION! CAUTION! CAUTION! **************************** - - Make sure to click "Continue Testing", at the end of the Ubiquity installer. - Just exit the installer without rebooting. Other wise, your system - is unable to boot. - - Type return key to start Ubiquity. + **************** CAUTION! CAUTION! CAUTION! ******************** + [Kaiten-Yaki] + [Kaiten-Yaki] Make sure to click "Continue Testing", at the end of + [Kaiten-Yaki] the Ubiquity installer. Just exit the installer without + [Kaiten-Yaki] rebooting. Otherwise, your system becomes unable to boot. + [Kaiten-Yaki] + [Kaiten-Yaki] Type return key to start Ubiquity. HEREDOC # waiting for a console input @@ -134,12 +134,12 @@ function grub_check_and_modify_local() { # 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 "[Kaiten-Yaki] Adding GRUB_ENABLE_CRYPTODISK entry to ${TARGETMOUNTPOINT}/etc/default/grub " echo "GRUB_ENABLE_CRYPTODISK=y" >> ${TARGETMOUNTPOINT}/etc/default/grub # And then, wait for the end of installer process - echo "...Waiting for the end of GUI/TUI installer." - echo "...Again, DO NOT reboot/restart here. Just exit the GUI/TUI installer." + echo "[Kaiten-Yaki] Waiting for the end of GUI/TUI installer." + echo "[Kaiten-Yaki] Again, DO NOT reboot/restart here. Just exit the GUI/TUI installer." wait $INSTALLER_PID # succesfull return diff --git a/script/void-kaiten-yaki.sh b/script/void-kaiten-yaki.sh index c63f906..4276811 100644 --- a/script/void-kaiten-yaki.sh +++ b/script/void-kaiten-yaki.sh @@ -45,17 +45,17 @@ function main() { export GRUB_ADDITIONAL_PARAMETERS="rd.auto=1 cryptdevice=${DEV}${CRYPTPARTITION}:${CRYPTPARTNAME} root=/dev/mapper/${VGNAME}-${LVROOTNAME}" if grep "$GRUB_ADDITIONAL_PARAMETERS" /etc/default/grub ; then # Is additonal parameter already added? # Yes - echo ".../etc/default/grub already modified. OK, skipping to modiy." + echo "[Kaiten-Yaki] /etc/default/grub already modified. OK, skipping to modiy." else # Not yet. Let's add. - echo "...Modify /etc/default/grub." + echo "[Kaiten-Yaki] Modify /etc/default/grub." sed -i -e "/GRUB_CMDLINE_LINUX_DEFAULT/{s#\"# ${GRUB_ADDITIONAL_PARAMETERS}\"#2}" /etc/default/grub fi # Common part of the pre-install stage if ! pre_install ; then # If error, restore the modification. - echo "...restoring /etc/default/grub, if needed" + echo "[Kaiten-Yaki] restoring /etc/default/grub, if needed" sed -i -e "s#${GRUB_ADDITIONAL_PARAMETERS}##" /etc/default/grub return 1 # with error status fi @@ -96,13 +96,13 @@ function para_install_local() { # Distrobution dependent message cat <<- HEREDOC - ************************ CAUTION! CAUTION! CAUTION! **************************** - - Make sure to click "NO", if the void-installer ask you to reboot. - Just exit the installer without rebooting. Other wise, your system - is unable to boot. - - Type return key to start void-installer. + ******************** CAUTION! CAUTION! CAUTION! ************************ + [Kaiten-Yaki] + [Kaiten-Yaki] Make sure to click "NO", if the void-installer ask you to + [Kaiten-Yaki] reboot.Just exit the installer without rebooting. Otherwise, + [Kaiten-Yaki] your system becomes unable to boot. + [Kaiten-Yaki] + [Kaiten-Yaki] Type return key to start void-installer. HEREDOC # waiting for a console input @@ -123,7 +123,7 @@ function para_install_local() { # If exist, the grub was not modifyed -> void-installer termianted unexpectedly # Delete the nwe volume if overwrite install, and close all on_unexpected_installer_quit - echo "...restoring modified /etc/default/grub." + echo "[Kaiten-Yaki] restoring modified /etc/default/grub." sed -i "s#loglevel=4 ${GRUB_ADDITIONAL_PARAMETERS}#loglevel=4#" /etc/default/grub return 1 # with error status fi @@ -149,7 +149,7 @@ function grub_check_and_modify_local() { # 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 "[Kaiten-Yaki] Adding GRUB_ENABLE_CRYPTODISK entry to ${TARGETMOUNTPOINT}/etc/default/grub " echo "GRUB_ENABLE_CRYPTODISK=y" >> ${TARGETMOUNTPOINT}/etc/default/grub # succesfull return