From 4699f87cc7f04d005667b47ee186df52d66e9d82 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Wed, 2 Mar 2022 07:24:56 +0900 Subject: [PATCH 01/29] Add test script for development --- script/config.sh | 30 +++++++++- script/lib/common.sh | 123 +++++++++++++++++++++++++++++++++++++++- script/test/config01.sh | 112 ++++++++++++++++++++++++++++++++++++ script/test/test01.sh | 45 +++++++++++++++ script/test/testutil.sh | 38 +++++++++++++ 5 files changed, 346 insertions(+), 2 deletions(-) create mode 100755 script/test/config01.sh create mode 100755 script/test/test01.sh create mode 100644 script/test/testutil.sh diff --git a/script/config.sh b/script/config.sh index bb378c0..22f448f 100644 --- a/script/config.sh +++ b/script/config.sh @@ -14,11 +14,39 @@ export ERASEALL=0 # Keep it unique from other distribution. export LVROOTNAME="anko" +# Suffix of the optional logical volumes. +# If you want to have optional OVs, set USELVEXT# to 1. +# Then, the suffix will be added to the LVROOTNAME. +# For example, Assume you have setting below : +# LVROOTNAME="anko" +# USELVEXT1=1 +# LVEXT1SUFFIX="_home" +# USELVEXT2=0 +# LVEXT2SUFFIX="_var" +# You will have +# anko +# anko_home +# You will not have anko_var because the USELVEXT2=0. +export USELVEXT1=0 +export LVEXT1SUFFIX="_home" +export USELVEXT2=0 +export LVEXT2SUFFIX="_var" + # Logical volume size of the Linux installation. # 30% mean, new logical volume will use 30% of the free space # in the LVM volume group. For example, assume the free space is 100GB, # and LVROOTSIZE is 30%FREE. Script will create 30GB logical volume. -export LVROOTSIZE="50%FREE" +# Note that the order of the volume creation is : +# 1. EFI if needed +# 2. SWAP +# 3. LVROOT +# 4. LVEXT1 if needed +# 5. LVEXT2 if needed +export LVROOTSIZE="10%FREE" + +# Logical volume size of the optional volumes. +export LVEXT1SIZE="90%FREE" +export LVEXT2SIZE="100%FREE" # Set the size of EFI partition and swap partition. # The unit is Byte. You can use M,G... notation. diff --git a/script/lib/common.sh b/script/lib/common.sh index cd0365c..43803d4 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -42,6 +42,34 @@ function confirmation(){ return 1 # with error status fi # "-" is found in the volume name. + # Sanity check for lvext1 volume suffix + if [ "${USELVEXT1}" -ne 0 ] ; then + 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 + + ...Installation process terminated.. + HEREDOC + return 1 # with error status + fi # "-" is found in the volume suffix. + fi # USELVEXT1 + + # Sanity check for lvext2 volume suffix + if [ "${USELVEXT2}" -ne 0 ] ; then + 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 + + ...Installation process terminated.. + HEREDOC + return 1 # with error status + fi # "-" is found in the volume suffix. + fi # USELVEXT2 + # Sanity check for swap volume name if echo "${LVSWAPNAME}" | grep "-" -i > /dev/null ; then # "-" is found in the volume name. cat <<- HEREDOC @@ -62,6 +90,23 @@ function confirmation(){ Volume group name : "${VGNAME}" Root volume name : "${VGNAME}-${LVROOTNAME}" Root volume size : "${LVROOTSIZE}" + HEREDOC + + if [ "${USELVEXT1}" -ne 0 ] ; then + cat <<- HEREDOC + Extra volume name 1 : "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" + Extra volume size 1 : "${LVEXT1SIZE}" + HEREDOC + fi # USELVEXT1 + + if [ "${USELVEXT2}" -ne 0 ] ; then + cat <<- HEREDOC + Extra volume name 2 : "${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}" + Extra volume size 2 : "${LVEXT2SIZE}" + HEREDOC + fi # USELVEXT2 + + cat <<- HEREDOC Swap volume name : "${VGNAME}-${LVSWAPNAME}" Swap volume size : "${LVSWAPSIZE}" --iter-time parameter : ${ITERTIME} @@ -207,7 +252,7 @@ function pre_install() { return 1 # with error status fi else # not exsit - if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then + 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. @@ -219,6 +264,69 @@ function pre_install() { echo "...Creating logical volume \"${LVROOTNAME}\" on \"${VGNAME}\"." lvcreate -l "${LVROOTSIZE}" -n "${LVROOTNAME}" "${VGNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; + + if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 + if [ -e /dev/mapper/"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" ] ; then # if extra volume 1 exist + cat <<- HEREDOC + ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" exists while non-overwrite install. ***** + ...Check consistency of your config.txt. + HEREDOC + # Remove newly created root volume + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" + # Deactivate all lg and close the LUKS volume + deactivate_and_close + return 1 # with error status + else + echo "...Creating logical volume \"${LVROOTNAME}${LVEXT1SUFFIX}\" on \"${VGNAME}\"." + lvcreate -l "${LVEXT1SIZE}" -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" + if [ $? -ne 0 ] ; then # if fail + # Remove newly created root volume + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" + # Deactivate all lg and close the LUKS volume + deactivate_and_close; + return 1 ; + fi; + fi + fi + + if [ "${USELVEXT2}" -ne 0 ] ; then # if using extra volume 2 + if [ -e /dev/mapper/"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}" ] ; then # if extra volume 2 exist + cat <<- HEREDOC + ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}" exists while non-overwrite install. ***** + ...Check consistency of your config.txt. + HEREDOC + # Remove newly created root volume + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" + if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 + # Remove newly created extra volume 1 + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" + fi + # Deactivate all lg and close the LUKS volume + deactivate_and_close + return 1 # with error status + else + echo "...Creating logical volume \"${LVROOTNAME}${LVEXT2SUFFIX}\" on \"${VGNAME}\"." + lvcreate -l "${LVEXT2SIZE}" -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" + if [ $? -ne 0 ] ; then # if fail + # Remove newly created root volume + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" + if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 + # Remove newly created extra volume 1 + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" + fi + # Deactivate all lg and close the LUKS volume + deactivate_and_close; + return 1 ; + fi; + fi + fi + fi fi @@ -338,6 +446,19 @@ function on_unexpected_installer_quit(){ else # if not overwrite istall, delete the new volume echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" + + if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 + # Remove newly created extra volume 1 + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" + fi + + if [ "${USELVEXT2}" -ne 0 ] ; then # if using extra volume 2 + # Remove newly created extra volume 2 + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT2SUFFIX}" + fi + fi # Deactivate all lg and close the LUKS volume deactivate_and_close diff --git a/script/test/config01.sh b/script/test/config01.sh new file mode 100755 index 0000000..cfa8614 --- /dev/null +++ b/script/test/config01.sh @@ -0,0 +1,112 @@ +#!/bin/bash + +# ##################################### + +# Test setup. +# /dev/sdb/ +# ERASEALL +# LVROOT 10% +# LVEXT1 90% +# LVEXT2 10% + +# ##################################### + +# Configuration parameters for Kaiten-Yaki + +# Storage device to install the linux. +export DEV="/dev/sdb" + +# Whether you want to erase all contents of the storage device or not. +# 1 : Yes, I want to erase all. +# 0 : No, I don't. I want to add to the existing LUKS volume. +export ERASEALL=1 + +# Logical Volume name for your Linux installation. +# Keep it unique from other distribution. +export LVROOTNAME="anko" + +# Suffix of the optional logical volumes. +# If you want to have optional OVs, set USELVEXT# to 1. +# Then, the suffix will be added to the LVROOTNAME. +# For example, Assume you have setting below : +# LVROOTNAME="anko" +# USELVEXT1=1 +# LVEXT1SUFFIX="_home" +# USELVEXT2=0 +# LVEXT2SUFFIX="_var" +# You will have +# anko +# anko_home +# You will not have anko_var because the USELVEXT2=0. +export USELVEXT1=1 +export LVEXT1SUFFIX="_home" +export USELVEXT2=1 +export LVEXT2SUFFIX="_var" + +# Logical volume size of the Linux installation. +# 30% mean, new logical volume will use 30% of the free space +# in the LVM volume group. For example, assume the free space is 100GB, +# and LVROOTSIZE is 30%FREE. Script will create 30GB logical volume. +# Note that the order of the volume creation is : +# 1. EFI if needed +# 2. SWAP +# 3. LVROOT +# 4. LVEXT1 if needed +# 5. LVEXT2 if needed +export LVROOTSIZE="10%FREE" + +# Logical volume size of the optional volumes. +export LVEXT1SIZE="90%FREE" +export LVEXT2SIZE="100%FREE" + +# Set the size of EFI partition and swap partition. +# The unit is Byte. You can use M,G... notation. +export EFISIZE="200M" +export LVSWAPSIZE="8G" + +# Usually, these names can be left untouched. +# If you change, keep them consistent through all installation in your system. +export CRYPTPARTNAME="luks_test" +export VGNAME="vg_test" +export LVSWAPNAME="swap" + +# Do not touch this parameter, unless you understand what you are doing. +# 1 : Overwrite the existing logical volume as root volume. +# 0 : Create new logical volume as root volume. +export OVERWRITEINSTALL=0 + +# Do not touch this parameter, unless you understand what you are doing. +# This is a paameter value of the --iter-time option for cyrptsetup command. +# If you specify 1000, that means 1000mSec. 0 means compile default. +export ITERTIME=0 + +# Void Linux only. Ignored in Ubuntu. +# The font size of the void-installer +export XTERMFONTSIZE=11 + +# !!!!!!!!!!!!!! DO NOT EDIT FOLLOWING LINES. !!!!!!!!!!!!!! + +# Detect firmware type. 1 : EFI, 0 : BIOS +if [ -d /sys/firmware/efi ]; then +export ISEFI=1 # Yes, EFI +else +export ISEFI=0 # No, BIOS +fi # is EFI firmaare? + +# Set partition number based on the firmware type +if [ ${ISEFI} -ne 0 ] ; then +# EFI firmware +export EFIPARTITION=1 +export CRYPTPARTITION=2 +else +# BIOS firmware +export CRYPTPARTITION=1 +fi # EFI firmware + +# Detect the GUI environment +# This code is not efered. Just left because it is interestintg code. +if env | grep -w -e XDG_SESSION_TYPE -e DISPLAY -e WAYLAND_DISPLAY > /dev/null ; then + export GUIENV=1 # set 1 if GUI env. +else + export GUIENV=0 # set 0 if not GUI env. +fi \ No newline at end of file diff --git a/script/test/test01.sh b/script/test/test01.sh new file mode 100755 index 0000000..a5a2de5 --- /dev/null +++ b/script/test/test01.sh @@ -0,0 +1,45 @@ +#!/bin/bash -u + + # shellcheck disable=SC1091 + # Load configuration parameter + source ./config01.sh + + # Load common functions + source ../lib/common.sh + +function main() { + + # This is the mount point of the install target. + export TARGETMOUNTPOINT="/target" + + # ******************************************************************************* + # Confirmation before installation + # ******************************************************************************* + + # parameters for distribution check + export DISTRIBUTIONSIGNATURE="ubuntu" + export DISTRIBUTIONNAME="Ubuntu" + + # Check whetehr given signature exist or not + if ! distribution_check ; then + return 1 # with error status + fi + + # Common part of the parameter confirmation + if ! confirmation ; then + return 1 # with error status + fi + + # ******************************************************************************* + # Pre-install stage + # ******************************************************************************* + + # Common part of the pre-install stage + if ! pre_install ; then + return 1 # with error status + fi +} + +# main routine +main + diff --git a/script/test/testutil.sh b/script/test/testutil.sh new file mode 100644 index 0000000..a4889d2 --- /dev/null +++ b/script/test/testutil.sh @@ -0,0 +1,38 @@ + + +# ******************************************************************************* +# Deactivate all LV in the VG and close LUKS volume +# ******************************************************************************* + +function util_deactivate_and_close(){ + echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"." + vgchange -a n "${VGNAME}" + echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." + cryptsetup close "${CRYPTPARTNAME}" + cat <<- HEREDOC + + ...Installation process terminated.. + HEREDOC + +} + +# ******************************************************************************* +# Delete the nwe volume if overwrite install, and close all +# ******************************************************************************* +function util_cleanup(){ + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" + + if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 + # Remove newly created extra volume 1 + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" + fi + + if [ "${USELVEXT2}" -ne 0 ] ; then # if using extra volume 2 + # Remove newly created extra volume 2 + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT2SUFFIX}" + fi + +} From ed48590821722d21b5fd890b06885ed6c41a5146 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Thu, 5 May 2022 23:20:30 +0900 Subject: [PATCH 02/29] Test update. --- script/test/trial.sh | 11 ++++++++++ script/test/{testutil.sh => util_cleanup.sh} | 22 +++++-------------- script/test/util_deactivate_and_close.sh | 23 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 16 deletions(-) create mode 100755 script/test/trial.sh rename script/test/{testutil.sh => util_cleanup.sh} (65%) mode change 100644 => 100755 create mode 100755 script/test/util_deactivate_and_close.sh diff --git a/script/test/trial.sh b/script/test/trial.sh new file mode 100755 index 0000000..5106da8 --- /dev/null +++ b/script/test/trial.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +DISK=/dev/sdb + +DISKSIZE=$(blockdev --report ${DISK} | awk /${DISK}/'{print $6}') +VOLSIZE=$(lvdisplay --units B /dev/vg_test/anko | awk '/Size/{print $3}') + +echo $DISKSIZE +echo $VOLSIZE + +echo "scale=3; $VOLSIZE/$DISKSIZE" | bc \ No newline at end of file diff --git a/script/test/testutil.sh b/script/test/util_cleanup.sh old mode 100644 new mode 100755 similarity index 65% rename from script/test/testutil.sh rename to script/test/util_cleanup.sh index a4889d2..0701bb9 --- a/script/test/testutil.sh +++ b/script/test/util_cleanup.sh @@ -1,20 +1,8 @@ +#!/bin/bash -u - -# ******************************************************************************* -# Deactivate all LV in the VG and close LUKS volume -# ******************************************************************************* - -function util_deactivate_and_close(){ - echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"." - vgchange -a n "${VGNAME}" - echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." - cryptsetup close "${CRYPTPARTNAME}" - cat <<- HEREDOC - - ...Installation process terminated.. - HEREDOC - -} + # shellcheck disable=SC1091 + # Load configuration parameter + source ./config01.sh # ******************************************************************************* # Delete the nwe volume if overwrite install, and close all @@ -36,3 +24,5 @@ function util_cleanup(){ fi } + +util_cleanup diff --git a/script/test/util_deactivate_and_close.sh b/script/test/util_deactivate_and_close.sh new file mode 100755 index 0000000..2da7bb4 --- /dev/null +++ b/script/test/util_deactivate_and_close.sh @@ -0,0 +1,23 @@ +#!/bin/bash -u + + # shellcheck disable=SC1091 + # Load configuration parameter + source ./config01.sh + +# ******************************************************************************* +# Deactivate all LV in the VG and close LUKS volume +# ******************************************************************************* + +function util_deactivate_and_close(){ + echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"." + vgchange -a n "${VGNAME}" + echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." + cryptsetup close "${CRYPTPARTNAME}" + cat <<- HEREDOC + + ...Installation process terminated.. + HEREDOC + +} + +util_deactivate_and_close From 9ef15cc1f122c100c29e7d298cac70de747fb376 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Thu, 5 May 2022 23:32:48 +0900 Subject: [PATCH 03/29] Add display of the additional volumes. The user --- script/lib/common.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index 43803d4..355e869 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -359,7 +359,17 @@ function para_install_msg() { fi # Root volume mapping - echo "/ : /dev/mapper/${VGNAME}-${LVROOTNAME}" + echo "/ : /dev/mapper/${VGNAME}-${LVROOTNAME}" + + # If USELVEXT1 exist. + if [ "${USELVEXT1}" -ne 0 ] ; then + echo "LVEXT1 : /dev/mapper/${VGNAME}${LVEXT1SUFFIX}" + fi + + # If USELVEXT2 exist. + if [ "${USELVEXT2}" -ne 0 ] ; then + echo "LVEXT2 : /dev/mapper/${VGNAME}${LVEXT2SUFFIX}" + fi # In case of erased storage, add this mapping if [ "${ERASEALL}" -ne 0 ] ; then From a21470f594af43afd4e4efdce2a45b98dbe95925 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Thu, 5 May 2022 23:47:17 +0900 Subject: [PATCH 04/29] Correct the display of the LVEXT1,2 --- script/lib/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index 355e869..b3b4bb4 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -363,12 +363,12 @@ function para_install_msg() { # If USELVEXT1 exist. if [ "${USELVEXT1}" -ne 0 ] ; then - echo "LVEXT1 : /dev/mapper/${VGNAME}${LVEXT1SUFFIX}" + echo "LVEXT1 : /dev/mapper/${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" fi # If USELVEXT2 exist. if [ "${USELVEXT2}" -ne 0 ] ; then - echo "LVEXT2 : /dev/mapper/${VGNAME}${LVEXT2SUFFIX}" + echo "LVEXT2 : /dev/mapper/${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}" fi # In case of erased storage, add this mapping From 8cd947c91232f07fc435cf633562cc7299a4095c Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Fri, 6 May 2022 08:44:16 +0900 Subject: [PATCH 05/29] fixed behavior of lvext When overwrite installing, the lvext# were not created. The detection of the error processing was refactored to use the global variable to see the newly created or not. --- script/lib/common.sh | 129 +++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 61 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index b3b4bb4..8524a69 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -152,6 +152,11 @@ function confirmation(){ function pre_install() { + # Internal variables. + # These variables displays whether the volumes are created in this installation. + IS_ROOT_CREATED=0 + IS_LVEXT1_CREATED=0 + IS_LVEXT2_CREATED=0 # ----- Erase entire disk, create partitions, format them and encrypt the LUKS partition ----- if [ "${ERASEALL}" -ne 0 ] ; then @@ -242,6 +247,11 @@ function pre_install() { 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." + + # Create extended volumes if needed + create_ext_lv + if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; + else # exist and not overwriteinstall cat <<- HEREDOC ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}" already exists. ***** @@ -262,70 +272,13 @@ function pre_install() { return 1 # with error status else # not exist and not overwrite install echo "...Creating logical volume \"${LVROOTNAME}\" on \"${VGNAME}\"." + IS_ROOT_CREATED=1 lvcreate -l "${LVROOTSIZE}" -n "${LVROOTNAME}" "${VGNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; - if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 - if [ -e /dev/mapper/"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" ] ; then # if extra volume 1 exist - cat <<- HEREDOC - ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" exists while non-overwrite install. ***** - ...Check consistency of your config.txt. - HEREDOC - # Remove newly created root volume - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" - # Deactivate all lg and close the LUKS volume - deactivate_and_close - return 1 # with error status - else - echo "...Creating logical volume \"${LVROOTNAME}${LVEXT1SUFFIX}\" on \"${VGNAME}\"." - lvcreate -l "${LVEXT1SIZE}" -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" - if [ $? -ne 0 ] ; then # if fail - # Remove newly created root volume - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" - # Deactivate all lg and close the LUKS volume - deactivate_and_close; - return 1 ; - fi; - fi - fi - - if [ "${USELVEXT2}" -ne 0 ] ; then # if using extra volume 2 - if [ -e /dev/mapper/"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}" ] ; then # if extra volume 2 exist - cat <<- HEREDOC - ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}" exists while non-overwrite install. ***** - ...Check consistency of your config.txt. - HEREDOC - # Remove newly created root volume - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" - if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 - # Remove newly created extra volume 1 - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" - fi - # Deactivate all lg and close the LUKS volume - deactivate_and_close - return 1 # with error status - else - echo "...Creating logical volume \"${LVROOTNAME}${LVEXT2SUFFIX}\" on \"${VGNAME}\"." - lvcreate -l "${LVEXT2SIZE}" -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" - if [ $? -ne 0 ] ; then # if fail - # Remove newly created root volume - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" - if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 - # Remove newly created extra volume 1 - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" - fi - # Deactivate all lg and close the LUKS volume - deactivate_and_close; - return 1 ; - fi; - fi - fi + # Create extended volumes if needed + create_ext_lv + if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; fi fi @@ -503,6 +456,60 @@ function distribution_check(){ return 0 } +# ******************************************************************************* +# Create extended volume, if needed. +# ******************************************************************************* + + +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." + else + echo "...Creating logical volume \"${LVROOTNAME}${LVEXT1SUFFIX}\" on \"${VGNAME}\"." + IS_LVEXT1_CREATED=1 + lvcreate -l "${LVEXT1SIZE}" -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" + if [ $? -ne 0 ] ; then # if fail + echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" + # Remove newly created root volume + if [ "${IS_ROOT_CREATED}" -ne 0 ] ; then # Is root created in this installation? + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" + fi + return 1 ; + fi; + fi + fi + + 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." + else + echo "...Creating logical volume \"${LVROOTNAME}${LVEXT2SUFFIX}\" on \"${VGNAME}\"." + IS_LVEXT2_CREATED=1 + lvcreate -l "${LVEXT2SIZE}" -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" + if [ $? -ne 0 ] ; then # if fail + echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" + # Remove newly created root volume + if [ "${IS_ROOT_CREATED}" -ne 0 ] ; then # newly created root must be deleted + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" + fi + if [ "${IS_LVEXT1_CREATED}" -ne 0 ] ; then # Is LV EXT1 created in this volue? + # Remove newly created extra volume 1 + echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" + fi + return 1 ; + fi; + fi + fi + + # no error + return 0 + + +} # ******************************************************************************* # Error report and return revsers status. From f6d43382fecf3948dc66b37c0d42a76b3efdc2e5 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 08:41:18 +0900 Subject: [PATCH 06/29] Move lvremove. To simplify, removing new voluves are gathered to deactivate_and remove. --- script/lib/common.sh | 62 ++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index 8524a69..c2a26e0 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -272,9 +272,9 @@ function pre_install() { return 1 # with error status else # not exist and not overwrite install echo "...Creating logical volume \"${LVROOTNAME}\" on \"${VGNAME}\"." - IS_ROOT_CREATED=1 lvcreate -l "${LVROOTSIZE}" -n "${LVROOTNAME}" "${VGNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; + IS_ROOT_CREATED=1 # Create extended volumes if needed create_ext_lv @@ -388,6 +388,29 @@ function post_install() { # ******************************************************************************* 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}\"." + 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}\"." + 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}\"." + lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT2SUFFIX}" + fi + + + echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"." vgchange -a n "${VGNAME}" echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." @@ -406,22 +429,6 @@ 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." - else # if not overwrite istall, delete the new volume - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" - - if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 - # Remove newly created extra volume 1 - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" - fi - - if [ "${USELVEXT2}" -ne 0 ] ; then # if using extra volume 2 - # Remove newly created extra volume 2 - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT2SUFFIX}" - fi - fi # Deactivate all lg and close the LUKS volume deactivate_and_close @@ -467,16 +474,12 @@ function create_ext_lv() { echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\" already exists. OK." else echo "...Creating logical volume \"${LVROOTNAME}${LVEXT1SUFFIX}\" on \"${VGNAME}\"." - IS_LVEXT1_CREATED=1 lvcreate -l "${LVEXT1SIZE}" -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" - # Remove newly created root volume - if [ "${IS_ROOT_CREATED}" -ne 0 ] ; then # Is root created in this installation? - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" - fi return 1 ; + else # if success + IS_LVEXT1_CREATED=1 # Mark this volume is created fi; fi fi @@ -486,21 +489,12 @@ function create_ext_lv() { echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\" already exists. OK." else echo "...Creating logical volume \"${LVROOTNAME}${LVEXT2SUFFIX}\" on \"${VGNAME}\"." - IS_LVEXT2_CREATED=1 lvcreate -l "${LVEXT2SIZE}" -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" - # Remove newly created root volume - if [ "${IS_ROOT_CREATED}" -ne 0 ] ; then # newly created root must be deleted - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" - fi - if [ "${IS_LVEXT1_CREATED}" -ne 0 ] ; then # Is LV EXT1 created in this volue? - # Remove newly created extra volume 1 - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" - fi return 1 ; + else # if success + IS_LVEXT2_CREATED=1 # Mark this volume is created fi; fi fi From 121f1950b8829bbb80f8a56e10cfcdf66972cfd3 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 14:30:52 +0900 Subject: [PATCH 07/29] Update CHANGELOG to describe issue #31. Issue 31 : Add extra partition functionality. https://github.com/suikan4github/kaiten-yaki/issues/31 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c6a855..a783c3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ Record of the modification in project development. ## [Unreleased] - yyyy-mm-dd ### Added +- [Issue 31 : Add extra partition functionality.](https://github.com/suikan4github/kaiten-yaki/issues/31) + ### Changed ### Deprecated ### Removed From eb6f0eef0fe36543e5409600530a2550d20952ee Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 14:34:47 +0900 Subject: [PATCH 08/29] test subdirectory is removed. --- script/test/config01.sh | 112 ----------------------- script/test/test01.sh | 45 --------- script/test/trial.sh | 11 --- script/test/util_cleanup.sh | 28 ------ script/test/util_deactivate_and_close.sh | 23 ----- 5 files changed, 219 deletions(-) delete mode 100755 script/test/config01.sh delete mode 100755 script/test/test01.sh delete mode 100755 script/test/trial.sh delete mode 100755 script/test/util_cleanup.sh delete mode 100755 script/test/util_deactivate_and_close.sh diff --git a/script/test/config01.sh b/script/test/config01.sh deleted file mode 100755 index cfa8614..0000000 --- a/script/test/config01.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/bash - -# ##################################### - -# Test setup. -# /dev/sdb/ -# ERASEALL -# LVROOT 10% -# LVEXT1 90% -# LVEXT2 10% - -# ##################################### - -# Configuration parameters for Kaiten-Yaki - -# Storage device to install the linux. -export DEV="/dev/sdb" - -# Whether you want to erase all contents of the storage device or not. -# 1 : Yes, I want to erase all. -# 0 : No, I don't. I want to add to the existing LUKS volume. -export ERASEALL=1 - -# Logical Volume name for your Linux installation. -# Keep it unique from other distribution. -export LVROOTNAME="anko" - -# Suffix of the optional logical volumes. -# If you want to have optional OVs, set USELVEXT# to 1. -# Then, the suffix will be added to the LVROOTNAME. -# For example, Assume you have setting below : -# LVROOTNAME="anko" -# USELVEXT1=1 -# LVEXT1SUFFIX="_home" -# USELVEXT2=0 -# LVEXT2SUFFIX="_var" -# You will have -# anko -# anko_home -# You will not have anko_var because the USELVEXT2=0. -export USELVEXT1=1 -export LVEXT1SUFFIX="_home" -export USELVEXT2=1 -export LVEXT2SUFFIX="_var" - -# Logical volume size of the Linux installation. -# 30% mean, new logical volume will use 30% of the free space -# in the LVM volume group. For example, assume the free space is 100GB, -# and LVROOTSIZE is 30%FREE. Script will create 30GB logical volume. -# Note that the order of the volume creation is : -# 1. EFI if needed -# 2. SWAP -# 3. LVROOT -# 4. LVEXT1 if needed -# 5. LVEXT2 if needed -export LVROOTSIZE="10%FREE" - -# Logical volume size of the optional volumes. -export LVEXT1SIZE="90%FREE" -export LVEXT2SIZE="100%FREE" - -# Set the size of EFI partition and swap partition. -# The unit is Byte. You can use M,G... notation. -export EFISIZE="200M" -export LVSWAPSIZE="8G" - -# Usually, these names can be left untouched. -# If you change, keep them consistent through all installation in your system. -export CRYPTPARTNAME="luks_test" -export VGNAME="vg_test" -export LVSWAPNAME="swap" - -# Do not touch this parameter, unless you understand what you are doing. -# 1 : Overwrite the existing logical volume as root volume. -# 0 : Create new logical volume as root volume. -export OVERWRITEINSTALL=0 - -# Do not touch this parameter, unless you understand what you are doing. -# This is a paameter value of the --iter-time option for cyrptsetup command. -# If you specify 1000, that means 1000mSec. 0 means compile default. -export ITERTIME=0 - -# Void Linux only. Ignored in Ubuntu. -# The font size of the void-installer -export XTERMFONTSIZE=11 - -# !!!!!!!!!!!!!! DO NOT EDIT FOLLOWING LINES. !!!!!!!!!!!!!! - -# Detect firmware type. 1 : EFI, 0 : BIOS -if [ -d /sys/firmware/efi ]; then -export ISEFI=1 # Yes, EFI -else -export ISEFI=0 # No, BIOS -fi # is EFI firmaare? - -# Set partition number based on the firmware type -if [ ${ISEFI} -ne 0 ] ; then -# EFI firmware -export EFIPARTITION=1 -export CRYPTPARTITION=2 -else -# BIOS firmware -export CRYPTPARTITION=1 -fi # EFI firmware - -# Detect the GUI environment -# This code is not efered. Just left because it is interestintg code. -if env | grep -w -e XDG_SESSION_TYPE -e DISPLAY -e WAYLAND_DISPLAY > /dev/null ; then - export GUIENV=1 # set 1 if GUI env. -else - export GUIENV=0 # set 0 if not GUI env. -fi \ No newline at end of file diff --git a/script/test/test01.sh b/script/test/test01.sh deleted file mode 100755 index a5a2de5..0000000 --- a/script/test/test01.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -u - - # shellcheck disable=SC1091 - # Load configuration parameter - source ./config01.sh - - # Load common functions - source ../lib/common.sh - -function main() { - - # This is the mount point of the install target. - export TARGETMOUNTPOINT="/target" - - # ******************************************************************************* - # Confirmation before installation - # ******************************************************************************* - - # parameters for distribution check - export DISTRIBUTIONSIGNATURE="ubuntu" - export DISTRIBUTIONNAME="Ubuntu" - - # Check whetehr given signature exist or not - if ! distribution_check ; then - return 1 # with error status - fi - - # Common part of the parameter confirmation - if ! confirmation ; then - return 1 # with error status - fi - - # ******************************************************************************* - # Pre-install stage - # ******************************************************************************* - - # Common part of the pre-install stage - if ! pre_install ; then - return 1 # with error status - fi -} - -# main routine -main - diff --git a/script/test/trial.sh b/script/test/trial.sh deleted file mode 100755 index 5106da8..0000000 --- a/script/test/trial.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -DISK=/dev/sdb - -DISKSIZE=$(blockdev --report ${DISK} | awk /${DISK}/'{print $6}') -VOLSIZE=$(lvdisplay --units B /dev/vg_test/anko | awk '/Size/{print $3}') - -echo $DISKSIZE -echo $VOLSIZE - -echo "scale=3; $VOLSIZE/$DISKSIZE" | bc \ No newline at end of file diff --git a/script/test/util_cleanup.sh b/script/test/util_cleanup.sh deleted file mode 100755 index 0701bb9..0000000 --- a/script/test/util_cleanup.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -u - - # shellcheck disable=SC1091 - # Load configuration parameter - source ./config01.sh - -# ******************************************************************************* -# Delete the nwe volume if overwrite install, and close all -# ******************************************************************************* -function util_cleanup(){ - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" - - if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1 - # Remove newly created extra volume 1 - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}" - fi - - if [ "${USELVEXT2}" -ne 0 ] ; then # if using extra volume 2 - # Remove newly created extra volume 2 - echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\"." - lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT2SUFFIX}" - fi - -} - -util_cleanup diff --git a/script/test/util_deactivate_and_close.sh b/script/test/util_deactivate_and_close.sh deleted file mode 100755 index 2da7bb4..0000000 --- a/script/test/util_deactivate_and_close.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -u - - # shellcheck disable=SC1091 - # Load configuration parameter - source ./config01.sh - -# ******************************************************************************* -# Deactivate all LV in the VG and close LUKS volume -# ******************************************************************************* - -function util_deactivate_and_close(){ - echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"." - vgchange -a n "${VGNAME}" - echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." - cryptsetup close "${CRYPTPARTNAME}" - cat <<- HEREDOC - - ...Installation process terminated.. - HEREDOC - -} - -util_deactivate_and_close From 7d3abc56b03c23e682ccf40ccd07e32cc7dfae8f Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 14:38:38 +0900 Subject: [PATCH 09/29] Add swapoff -a --- script/ubuntu-kaiten-yaki.sh | 3 +++ script/void-kaiten-yaki.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/script/ubuntu-kaiten-yaki.sh b/script/ubuntu-kaiten-yaki.sh index adfbbdd..7b932e3 100644 --- a/script/ubuntu-kaiten-yaki.sh +++ b/script/ubuntu-kaiten-yaki.sh @@ -66,6 +66,9 @@ function main() { # The script is parameterized by env-variable to fit to the distribution post_install + # Free LUKS volume as swap volume. + swapoff -a + # Normal end return 0 diff --git a/script/void-kaiten-yaki.sh b/script/void-kaiten-yaki.sh index c63f906..d31adcc 100644 --- a/script/void-kaiten-yaki.sh +++ b/script/void-kaiten-yaki.sh @@ -81,6 +81,9 @@ function main() { # The script is parameterized by env-variable to fit to the distribution post_install + # Free LUKS volume as swap volume. + swapoff -a + # Normal end return 0 From 91cc1c3857c81628b02e05196b44b85a8ee88436 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 14:39:41 +0900 Subject: [PATCH 10/29] Add swap off to the script. At the end of the main() function of the scripts, added swapoff -a. Issue 32 : Ubuntu 22.04 fails to deactivate the swap https://github.com/suikan4github/kaiten-yaki/issues/32 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a783c3d..734ce7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ Record of the modification in project development. ### Deprecated ### Removed ### Fixed +- [Issue 32 : Ubuntu 22.04 fails to deactivate the swap](https://github.com/suikan4github/kaiten-yaki/issues/32) + ### Known Issue ## [1.2.0] - 2021-10-16 From 64e2edd173004ff1415512df0fe6fec6528eb143 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 14:44:45 +0900 Subject: [PATCH 11/29] Removed XTERMFONTSIZE variable. This variable is not used anymore. --- INSTALL.md | 3 --- script/config.sh | 3 --- 2 files changed, 6 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index a4ef2d6..9e3fdcb 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -92,9 +92,6 @@ export OVERWRITEINSTALL=0 # If you specify 1000, that means 1000mSec. 0 means compile default. export ITERTIME=0 -# Void Linux only. Ignored in Ubuntu. -# The font size of the void-installer -export XTERMFONTSIZE=11 ``` There are several restrictions : diff --git a/script/config.sh b/script/config.sh index 22f448f..c3203cd 100644 --- a/script/config.sh +++ b/script/config.sh @@ -69,9 +69,6 @@ export OVERWRITEINSTALL=0 # If you specify 1000, that means 1000mSec. 0 means compile default. export ITERTIME=0 -# Void Linux only. Ignored in Ubuntu. -# The font size of the void-installer -export XTERMFONTSIZE=11 # !!!!!!!!!!!!!! DO NOT EDIT FOLLOWING LINES. !!!!!!!!!!!!!! From ac709e15130fef8d471da0be04693345abec459d Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 14:48:01 +0900 Subject: [PATCH 12/29] Removed GUIENV variable. It is not used anymore. --- script/config.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/script/config.sh b/script/config.sh index c3203cd..096c64b 100644 --- a/script/config.sh +++ b/script/config.sh @@ -88,11 +88,3 @@ else # BIOS firmware export CRYPTPARTITION=1 fi # EFI firmware - -# Detect the GUI environment -# This code is not efered. Just left because it is interestintg code. -if env | grep -w -e XDG_SESSION_TYPE -e DISPLAY -e WAYLAND_DISPLAY > /dev/null ; then - export GUIENV=1 # set 1 if GUI env. -else - export GUIENV=0 # set 0 if not GUI env. -fi \ No newline at end of file From 03a294b407640d362caf6d773b3100dbc9ddac05 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 14:53:31 +0900 Subject: [PATCH 13/29] Unsed variables are removed Issue #35 Remove XTERMFONTSIZE variable. https://github.com/suikan4github/kaiten-yaki/issues/35 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 734ce7e..9e9dd79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Record of the modification in project development. ### Changed ### Deprecated ### Removed +- [Issue 35 : Remove XTERMFONTSIZE variable.](https://github.com/suikan4github/kaiten-yaki/issues/35) + ### Fixed - [Issue 32 : Ubuntu 22.04 fails to deactivate the swap](https://github.com/suikan4github/kaiten-yaki/issues/32) From f0f081ad34eef12edfa858bc1042d4bf3cad4f19 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 21:05:47 +0900 Subject: [PATCH 14/29] Modify to accespt the absolute volume size. --- script/config.sh | 26 +++++++++++++++++--------- script/lib/common.sh | 26 ++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/script/config.sh b/script/config.sh index 096c64b..a4b0e8e 100644 --- a/script/config.sh +++ b/script/config.sh @@ -32,27 +32,35 @@ export LVEXT1SUFFIX="_home" export USELVEXT2=0 export LVEXT2SUFFIX="_var" -# Logical volume size of the Linux installation. -# 30% mean, new logical volume will use 30% of the free space -# in the LVM volume group. For example, assume the free space is 100GB, -# and LVROOTSIZE is 30%FREE. Script will create 30GB logical volume. + +# Volume size parameters. # Note that the order of the volume creation is : # 1. EFI if needed # 2. SWAP # 3. LVROOT # 4. LVEXT1 if needed # 5. LVEXT2 if needed -export LVROOTSIZE="10%FREE" - -# Logical volume size of the optional volumes. -export LVEXT1SIZE="90%FREE" -export LVEXT2SIZE="100%FREE" # Set the size of EFI partition and swap partition. # The unit is Byte. You can use M,G... notation. +# You CANNOT use the % notation. export EFISIZE="200M" + +# Logical volume size of the swap volumes. export LVSWAPSIZE="8G" +# Logical volume size of the Linux installation. +# There are four posibble way to specify the volume. +# nnnM, nnnG, nnnT : Absolute size speicification. nnnMbyte, nnnGByte, nnnT byte. +# mm%VG : Use mm% of the entire volume group. +# mm%FREE : Use mm% of the avairable storage are in the volume group. +export LVROOTSIZE="10G" + +# Logical volume size of the optional volumes. +export LVEXT1SIZE="30G" +export LVEXT2SIZE="10G" + + # Usually, these names can be left untouched. # If you change, keep them consistent through all installation in your system. export CRYPTPARTNAME="luks_volume" diff --git a/script/lib/common.sh b/script/lib/common.sh index c2a26e0..91a8d3f 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -141,6 +141,24 @@ function confirmation(){ return 1 # with error status fi # passphrase validation + + # Add -l or -L parameter to the size. The lvcreate command have two size parameter. + # -L ###[M|G|T|m|g|t] : Size by absolute value. + # -l ###%[FREE|VG|PVS|ORIGIN] : Size by relative value. + # If Unit is not specified, installation will fail. + + LVSWAPSIZE=$(echo "${LVSWAPSIZE}" | awk '/M|G|T|m|g|t/{print "-L", $0} /%/ {print "-l", $0}') + export LVSWAPSIZE + + LVROOTSIZE=$(echo "${LVROOTSIZE}" | awk '/M|G|T|m|g|t/{print "-L", $0} /%/ {print "-l", $0}') + export LVROOTSIZE + + LVEXT1SIZE=$(echo "${LVEXT1SIZE}" | awk '/M|G|T|m|g|t/{print "-L", $0} /%/ {print "-l", $0}') + export LVEXT1SIZE + + LVEXT2SIZE=$(echo "${LVEXT2SIZE}" | awk '/M|G|T|m|g|t/{print "-L", $0} /%/ {print "-l", $0}') + export LVEXT2SIZE + # succesfull return return 0 } @@ -239,7 +257,7 @@ function pre_install() { echo "...Swap volume already exist. Skipped to create. No problem." else echo "...Creating logical volume \"${LVSWAPNAME}\" on \"${VGNAME}\"." - lvcreate -L "${LVSWAPSIZE}" -n "${LVSWAPNAME}" "${VGNAME}" + lvcreate "${LVSWAPSIZE}" -n "${LVSWAPNAME}" "${VGNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; fi # if /dev/mapper/swap volume already exit. @@ -272,7 +290,7 @@ function pre_install() { return 1 # with error status else # not exist and not overwrite install echo "...Creating logical volume \"${LVROOTNAME}\" on \"${VGNAME}\"." - lvcreate -l "${LVROOTSIZE}" -n "${LVROOTNAME}" "${VGNAME}" + lvcreate "${LVROOTSIZE}" -n "${LVROOTNAME}" "${VGNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; IS_ROOT_CREATED=1 @@ -474,7 +492,7 @@ function create_ext_lv() { echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\" already exists. OK." else echo "...Creating logical volume \"${LVROOTNAME}${LVEXT1SUFFIX}\" on \"${VGNAME}\"." - lvcreate -l "${LVEXT1SIZE}" -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" + lvcreate "${LVEXT1SIZE}" -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" return 1 ; @@ -489,7 +507,7 @@ function create_ext_lv() { echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\" already exists. OK." else echo "...Creating logical volume \"${LVROOTNAME}${LVEXT2SUFFIX}\" on \"${VGNAME}\"." - lvcreate -l "${LVEXT2SIZE}" -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" + lvcreate "${LVEXT2SIZE}" -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" return 1 ; From d322e8d5c54e09d2c3a498f01171e2a1fde8f145 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 21:35:29 +0900 Subject: [PATCH 15/29] Unquoted first parameter of lvcreate. This is to use the IFS ( Internal Field Separator ). Without IFS the string "-L 8G" will be wrapped by single quote like '-L 8G', while we need -L 8G. --- script/lib/common.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index 91a8d3f..a1bd2f5 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -257,7 +257,8 @@ function pre_install() { echo "...Swap volume already exist. Skipped to create. No problem." else echo "...Creating logical volume \"${LVSWAPNAME}\" on \"${VGNAME}\"." - lvcreate "${LVSWAPSIZE}" -n "${LVSWAPNAME}" "${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; fi # if /dev/mapper/swap volume already exit. @@ -290,7 +291,8 @@ function pre_install() { return 1 # with error status else # not exist and not overwrite install echo "...Creating logical volume \"${LVROOTNAME}\" on \"${VGNAME}\"." - lvcreate "${LVROOTSIZE}" -n "${LVROOTNAME}" "${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; IS_ROOT_CREATED=1 @@ -492,7 +494,8 @@ function create_ext_lv() { echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\" already exists. OK." else echo "...Creating logical volume \"${LVROOTNAME}${LVEXT1SUFFIX}\" on \"${VGNAME}\"." - lvcreate "${LVEXT1SIZE}" -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" + # Too use the bash IFS, first parameter is not quoted. + lvcreate ${LVEXT1SIZE} -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" return 1 ; @@ -507,7 +510,8 @@ function create_ext_lv() { echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\" already exists. OK." else echo "...Creating logical volume \"${LVROOTNAME}${LVEXT2SUFFIX}\" on \"${VGNAME}\"." - lvcreate "${LVEXT2SIZE}" -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" + # Too use the bash IFS, first parameter is not quoted. + lvcreate ${LVEXT2SIZE} -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" return 1 ; From 425181aff1f0139bc23609aece48280c38b07542 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 22:02:42 +0900 Subject: [PATCH 16/29] Fix the duplicate awk match. Now, it exits the process when the first pattern is procesed. --- script/lib/common.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index a1bd2f5..c37b0f9 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -143,20 +143,21 @@ function confirmation(){ # Add -l or -L parameter to the size. The lvcreate command have two size parameter. - # -L ###[M|G|T|m|g|t] : Size by absolute value. # -l ###%[FREE|VG|PVS|ORIGIN] : Size by relative value. + # -L ###[M|G|T|m|g|t] : Size by absolute value. + # Too preven the duplicated match, awk exists the process after it match the /%/ pattern. # If Unit is not specified, installation will fail. - LVSWAPSIZE=$(echo "${LVSWAPSIZE}" | awk '/M|G|T|m|g|t/{print "-L", $0} /%/ {print "-l", $0}') + LVSWAPSIZE=$(echo "${LVSWAPSIZE}" | awk '/%/{print "-l", $0; exit} /M|G|T|m|g|t/{print "-L", $0}') export LVSWAPSIZE - LVROOTSIZE=$(echo "${LVROOTSIZE}" | awk '/M|G|T|m|g|t/{print "-L", $0} /%/ {print "-l", $0}') + LVROOTSIZE=$(echo "${LVROOTSIZE}" | awk '/%/{print "-l", $0; exit} /M|G|T|m|g|t/{print "-L", $0}') export LVROOTSIZE - LVEXT1SIZE=$(echo "${LVEXT1SIZE}" | awk '/M|G|T|m|g|t/{print "-L", $0} /%/ {print "-l", $0}') + LVEXT1SIZE=$(echo "${LVEXT1SIZE}" | awk '/%/{print "-l", $0; exit} /M|G|T|m|g|t/{print "-L", $0}') export LVEXT1SIZE - LVEXT2SIZE=$(echo "${LVEXT2SIZE}" | awk '/M|G|T|m|g|t/{print "-L", $0} /%/ {print "-l", $0}') + LVEXT2SIZE=$(echo "${LVEXT2SIZE}" | awk '/%/{print "-l", $0; exit} /M|G|T|m|g|t/{print "-L", $0}') export LVEXT2SIZE # succesfull return From d7b319a89f89b47ba848d1ee8d4777bd693128b7 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 8 May 2022 05:53:44 +0900 Subject: [PATCH 17/29] Update CHANGELOG for feature/33 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e9dd79..c5a4e66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Record of the modification in project development. ## [Unreleased] - yyyy-mm-dd ### Added - [Issue 31 : Add extra partition functionality.](https://github.com/suikan4github/kaiten-yaki/issues/31) +- [Issue 35 : Support "M/G/T" as size prefix.](https://github.com/suikan4github/kaiten-yaki/issues/35) ### Changed ### Deprecated From d45481b194d01d5a7fef89b7612031bc1de32609 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 8 May 2022 07:44:13 +0900 Subject: [PATCH 18/29] Update installatin and readme. --- INSTALL.md | 86 +++++++++++++++++++++++++++++++++++++++++++++++------- README.md | 4 +-- 2 files changed, 78 insertions(+), 12 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 9e3fdcb..8fe6591 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -48,7 +48,8 @@ Followings are the set of the default settings of the parameters : - In the case of EFI firmware, 200MB is allocated to the EFI partition (EFISIZE). - Create a logical volume group named "vg1" in the encrypted volume (VGNAME) - Create a swap logical volume named "swap" in the "vg1". The size is 8GB (LVSWAPNAME,LVSWAPSIZE) -- Create a logical volume named **"anko"** as root volume, in the "vg1". The size of the new volume is the **50%** of the free space (LVROOTNAME, LVROOTSIZE). +- Create a logical volume named **"anko"** as root volume, in the "vg1". The size of the new volume is the **10GB** (LVROOTNAME, LVROOTSIZE). +- No Extra volumes will be created (USELVEXT1, LVEXT1SUFFIX, LVEXT1SIZE, USELVEXT2, LVEXT2SUFFIX, LVEXT2SIZE). ```sh # Configuration parameters for Kaiten-Yaki @@ -65,17 +66,53 @@ export ERASEALL=0 # Keep it unique from other distribution. export LVROOTNAME="anko" -# Logical volume size of the Linux installation. -# 30% mean, new logical volume will use 30% of the free space -# in the LVM volume group. For example, assume the free space is 100GB, -# and LVROOTSIZE is 30%FREE. Script will create 30GB logical volume. -export LVROOTSIZE="50%FREE" +# Suffix of the optional logical volumes. +# If you want to have optional OVs, set USELVEXT# to 1. +# Then, the suffix will be added to the LVROOTNAME. +# For example, Assume you have setting below : +# LVROOTNAME="anko" +# USELVEXT1=1 +# LVEXT1SUFFIX="_home" +# USELVEXT2=0 +# LVEXT2SUFFIX="_var" +# You will have +# anko +# anko_home +# You will not have anko_var because the USELVEXT2=0. +export USELVEXT1=0 +export LVEXT1SUFFIX="_home" +export USELVEXT2=0 +export LVEXT2SUFFIX="_var" + + +# Volume size parameters. +# Note that the order of the volume creation is : +# 1. EFI if needed +# 2. SWAP +# 3. LVROOT +# 4. LVEXT1 if needed +# 5. LVEXT2 if needed # Set the size of EFI partition and swap partition. # The unit is Byte. You can use M,G... notation. +# You CANNOT use the % notation. export EFISIZE="200M" + +# Logical volume size of the swap volumes. export LVSWAPSIZE="8G" +# Logical volume size of the Linux installation. +# There are four posibble way to specify the volume. +# nnnM, nnnG, nnnT : Absolute size speicification. nnnMbyte, nnnGByte, nnnT byte. +# mm%VG : Use mm% of the entire volume group. +# mm%FREE : Use mm% of the avairable storage are in the volume group. +export LVROOTSIZE="10G" + +# Logical volume size of the optional volumes. +export LVEXT1SIZE="30G" +export LVEXT2SIZE="10G" + + # Usually, these names can be left untouched. # If you change, keep them consistent through all installation in your system. export CRYPTPARTNAME="luks_volume" @@ -92,15 +129,22 @@ export OVERWRITEINSTALL=0 # If you specify 1000, that means 1000mSec. 0 means compile default. export ITERTIME=0 + ``` There are several restrictions : - For the first distribution installation, you must set ERASEALL to 1, to erase the entire storage device and create a LUKS partition. Kaiten-yaki script creates a maximum LUKS partition as possible. -- The LVROOTNAME must be unique among all installations in a computer. Otherwise, Kaiten-yaki terminates in a middle. -- The LVSWAPNAME must be identical among all installations in a computer. Otherwise, Kaiten-yaki creates an unnecessary logical volume. This is a waste of storage resources. +- The CRYPTPARTNAME and VGNAME must be unique among all installations in a physical disk. Otherwise, Kaiten-yaki terminates in a middle. +- The LVSWAPNAME must be identical among all installations in a physical disk. Otherwise, Kaiten-yaki creates an unnecessary logical volume. This is a waste of storage resources. - The EFISIZE and the LVSWAPSIZE are refereed during the first distribution installation only. -- The LVROOTSIZE is the size of a logical volume to create. This is a relative value to the existing free space in the volume group. If you want to install 3 distributions in a computer, you may want to set 33%FREE, 50%FREE, and 100%FREE for the first, second, and third distribution installation, respectively. -- The name with "-" is not allowed for the VGNAME, LVROOTNAME, and LVSWAPNAME. I saw some installer doesn't work if "-" in in the name. +- The LVROOTSIZE, LVEXT1SIZE, LVEXT2SIZE are the size of a logical volumes to create. There are several way to specify the size ( where n is number) : + - nnnM : New logical volume size is nnn**MByte**. + - nnnG : New logical volume size is nnn**GByte**. + - nnnT : New logical volume size is nnn**TByte**. + - nn%VG : New logical volume size is nn% of the **entire volume group**. + - nn%FREE : New logical volume size is nn% of the **free space** in the volume group. +- The name with "-" is not allowed for the VGNAME, LVROOTNAME, and LVSWAPNAME. I saw some distribution installer doesn't work if "-" in in the name. + ### About the overwrite-install The OVERWRITEINSTALL parameter allows you to use an existing logical volume as the root volume of the new installation. This is very dangerous because of several aspects like destroying the wrong volume and the risk of security. But sometimes it is @@ -128,6 +172,28 @@ The unit of value is milliseconds. The target linux kernel may take this duratio The smaller value gives the weaker security. +### About the extra logical volume +From ver 1.3.0, Kaiten-yaki support two extra volume in addition to LVROOT and LVSWAP. +- LVEXT1 +- LVEXT2 + +The usage of the extra logical volume is up to the user. Typically, user may want to use it for example separated /home partition. + +The name of the extra volume is the concatenation of the LVROOTNAME and LVEXTnSUFFIX ( where n is 1 or 2 ). For example, let's assume following configuration : +- LVROOTNAME="FOO" +- LVEXT1SUFFIX="_BAR" + +Thus, the name of the LVEXT1 is "FOO_BAR". + +### Partition and logical volume creation order. +Kaiten-yaki creates the partition/volume in the following order : +1. EFI partition +1. LUKS partition +1. LVSWAP +1. LVROOT +1. LVEXT1 +1. LVEXT2 + ## First stage: Setting up the volumes After you set the configuration parameters correctly, execute the following command from the shell. Again, you have to be promoted as the root user, and you have to use Bash. diff --git a/README.md b/README.md index aff6af9..2376bfb 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Kaiten-yaki: Full disk encryption install script for Linux -Kaiten-yaki is a script set to install Linux to your AMD64 desktop system. With these scripts, you can install Ubuntu/Void Linux to an encrypted partition easily. +Kaiten-yaki v1.3.0 is a script set to install Linux to your AMD64 desktop system. With these scripts, you can install Ubuntu/Void Linux to an encrypted partition easily. The followings are the list of functionalities: - Ubuntu and Void Linux. - Help to install from LiveCD/USB. - Invoke GUI/TUI installer automatically at the middle of script execution, for the ease of installation. -- Automatic detection of BIOS/EFI firmware and create MBR/GPT, respectively. +- Automatic detection of EFI firmware and create GPT( The BIOS detection and MBR creation function exist. But it is not maintained from v1.3.0 ). - Create an EFI partition, if needed. - Support multiple boot in a LUKS partition. - Support btrfs in addition to the major file systems. From 27a64ba0668278fdde34fe20c14d005b64738b1f Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 8 May 2022 08:51:20 +0900 Subject: [PATCH 19/29] Issue 34 : BIOS support should be obsoleted This is still documented only. Functionality exists. Just not tested anymore. https://github.com/suikan4github/kaiten-yaki/issues/34 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5a4e66..554e54f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Record of the modification in project development. ### Changed ### Deprecated +- [Issue 34 : BIOS support should be obsoleted ](https://github.com/suikan4github/kaiten-yaki/issues/34) + ### Removed - [Issue 35 : Remove XTERMFONTSIZE variable.](https://github.com/suikan4github/kaiten-yaki/issues/35) From 6722b160cb8ea3d0591adb15fa3795ae7c9bbed7 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 8 May 2022 12:25:24 +0900 Subject: [PATCH 20/29] Clear passphrase information before exit. --- script/lib/common.sh | 3 +++ script/ubuntu-kaiten-yaki.sh | 6 ++++++ script/void-kaiten-yaki.sh | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/script/lib/common.sh b/script/lib/common.sh index c37b0f9..2a34de0 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -139,6 +139,9 @@ function confirmation(){ ...Installation process terminated.. HEREDOC return 1 # with error status + else + # Clear the PASSPHRASE for checking because we don't use it anymore. + PASSPHRASE_C="" fi # passphrase validation diff --git a/script/ubuntu-kaiten-yaki.sh b/script/ubuntu-kaiten-yaki.sh index 7b932e3..e3b4b5d 100644 --- a/script/ubuntu-kaiten-yaki.sh +++ b/script/ubuntu-kaiten-yaki.sh @@ -67,8 +67,14 @@ function main() { post_install # Free LUKS volume as swap volume. + echo "...Disabling swap to release the LUKS volume." swapoff -a + # Deleting the passphrase information. + echo "...Deleting passphrase information." + PASSPHRASE="" + export PASSPHRASE + # Normal end return 0 diff --git a/script/void-kaiten-yaki.sh b/script/void-kaiten-yaki.sh index d31adcc..a49a378 100644 --- a/script/void-kaiten-yaki.sh +++ b/script/void-kaiten-yaki.sh @@ -82,8 +82,14 @@ function main() { post_install # Free LUKS volume as swap volume. + echo "...Disabling swap to release the LUKS volume." swapoff -a + # Deleting the passphrase information. + echo "...Deleting passphrase information." + PASSPHRASE="" + export PASSPHRASE + # Normal end return 0 From b81ec5667ca52f52bc0b0932a8afe3a182086685 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 8 May 2022 12:26:57 +0900 Subject: [PATCH 21/29] Record #36 to CHANGELOG. Issue 36 : Clear the PASSPHRASE variable at the end of installation https://github.com/suikan4github/kaiten-yaki/issues/36 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 554e54f..011e46a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Record of the modification in project development. ### Fixed - [Issue 32 : Ubuntu 22.04 fails to deactivate the swap](https://github.com/suikan4github/kaiten-yaki/issues/32) +- [Issue 36 : Clear the PASSPHRASE variable at the end of installation](https://github.com/suikan4github/kaiten-yaki/issues/36) ### Known Issue From 4a69ef1db6b80121501e1e7d62dcd315a3c31fd4 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 8 May 2022 12:28:41 +0900 Subject: [PATCH 22/29] Correct the informaiton in CHANGELOG. Issue 33 was written as 35. It was mistake. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 011e46a..0337c3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Record of the modification in project development. ## [Unreleased] - yyyy-mm-dd ### Added - [Issue 31 : Add extra partition functionality.](https://github.com/suikan4github/kaiten-yaki/issues/31) -- [Issue 35 : Support "M/G/T" as size prefix.](https://github.com/suikan4github/kaiten-yaki/issues/35) +- [Issue 33 : Support "M/G/T" as size prefix.](https://github.com/suikan4github/kaiten-yaki/issues/33) ### Changed ### Deprecated From f725af8f443bb9d9162fdc4e53e18f1b7bf7cb27 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Tue, 10 May 2022 21:25:51 +0900 Subject: [PATCH 23/29] Issue 38 : "Ready to reboot" message should be changed https://github.com/suikan4github/kaiten-yaki/issues/38 --- CHANGELOG.md | 1 + script/lib/common.sh | 10 +++++----- script/ubuntu-kaiten-yaki.sh | 7 +++++++ script/void-kaiten-yaki.sh | 7 +++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0337c3e..a40efae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Record of the modification in project development. ### Fixed - [Issue 32 : Ubuntu 22.04 fails to deactivate the swap](https://github.com/suikan4github/kaiten-yaki/issues/32) - [Issue 36 : Clear the PASSPHRASE variable at the end of installation](https://github.com/suikan4github/kaiten-yaki/issues/36) +- [Issue 38 : "Ready to reboot" message should be changed](https://github.com/suikan4github/kaiten-yaki/issues/38) ### Known Issue diff --git a/script/lib/common.sh b/script/lib/common.sh index 2a34de0..829cbb4 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -395,12 +395,12 @@ function post_install() { echo "...Unmounting all." umount -R -l "${TARGETMOUNTPOINT}" - # Finishing message - cat <<- HEREDOC - ****************** Post-install process finished ****************** + echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"." + vgchange -a n "${VGNAME}" + echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." + cryptsetup close "${CRYPTPARTNAME}" - ...Ready to reboot. - HEREDOC + echo "...Post install process finished." return 0 diff --git a/script/ubuntu-kaiten-yaki.sh b/script/ubuntu-kaiten-yaki.sh index e3b4b5d..93952a6 100644 --- a/script/ubuntu-kaiten-yaki.sh +++ b/script/ubuntu-kaiten-yaki.sh @@ -75,6 +75,13 @@ function main() { PASSPHRASE="" export PASSPHRASE + # Finishing message + cat <<- HEREDOC + ****************** Install process finished ****************** + + ...Ready to reboot. + HEREDOC + # Normal end return 0 diff --git a/script/void-kaiten-yaki.sh b/script/void-kaiten-yaki.sh index a49a378..4a9c899 100644 --- a/script/void-kaiten-yaki.sh +++ b/script/void-kaiten-yaki.sh @@ -90,6 +90,13 @@ function main() { PASSPHRASE="" export PASSPHRASE + # Finishing message + cat <<- HEREDOC + ****************** Install process finished ****************** + + ...Ready to reboot. + HEREDOC + # Normal end return 0 From 555bf5a38e064e66bef370ffd3012a7c4c2f80a2 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Tue, 10 May 2022 22:22:30 +0900 Subject: [PATCH 24/29] Refactor the closing sequence. All closing sequence is gathered to the post-install(). --- script/lib/common.sh | 19 ++++++++++++++++++- script/ubuntu-kaiten-yaki.sh | 16 ---------------- script/void-kaiten-yaki.sh | 16 ---------------- 3 files changed, 18 insertions(+), 33 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index 829cbb4..e9d5ec9 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -395,12 +395,29 @@ function post_install() { echo "...Unmounting all." umount -R -l "${TARGETMOUNTPOINT}" + echo "...Post install process finished." + + # Free LUKS volume as swap volume. + echo "...Disabling swap to release the LUKS volume." + swapoff -a + + # Close LUKS echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"." vgchange -a n "${VGNAME}" echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"." cryptsetup close "${CRYPTPARTNAME}" - echo "...Post install process finished." + # Deleting the passphrase information. + echo "...Deleting passphrase information." + PASSPHRASE="" + export PASSPHRASE + + # Finishing message + cat <<- HEREDOC + ****************** Install process finished ****************** + + ...Ready to reboot. + HEREDOC return 0 diff --git a/script/ubuntu-kaiten-yaki.sh b/script/ubuntu-kaiten-yaki.sh index 93952a6..adfbbdd 100644 --- a/script/ubuntu-kaiten-yaki.sh +++ b/script/ubuntu-kaiten-yaki.sh @@ -66,22 +66,6 @@ function main() { # The script is parameterized by env-variable to fit to the distribution post_install - # Free LUKS volume as swap volume. - echo "...Disabling swap to release the LUKS volume." - swapoff -a - - # Deleting the passphrase information. - echo "...Deleting passphrase information." - PASSPHRASE="" - export PASSPHRASE - - # Finishing message - cat <<- HEREDOC - ****************** Install process finished ****************** - - ...Ready to reboot. - HEREDOC - # Normal end return 0 diff --git a/script/void-kaiten-yaki.sh b/script/void-kaiten-yaki.sh index 4a9c899..c63f906 100644 --- a/script/void-kaiten-yaki.sh +++ b/script/void-kaiten-yaki.sh @@ -81,22 +81,6 @@ function main() { # The script is parameterized by env-variable to fit to the distribution post_install - # Free LUKS volume as swap volume. - echo "...Disabling swap to release the LUKS volume." - swapoff -a - - # Deleting the passphrase information. - echo "...Deleting passphrase information." - PASSPHRASE="" - export PASSPHRASE - - # Finishing message - cat <<- HEREDOC - ****************** Install process finished ****************** - - ...Ready to reboot. - HEREDOC - # Normal end return 0 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 25/29] 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 From 70fa79a8d526f63b0878deb6d5bfa1d7f787d170 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Wed, 11 May 2022 07:30:19 +0900 Subject: [PATCH 26/29] Issue #39 : Change message style https://github.com/suikan4github/kaiten-yaki/issues/39 --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a40efae..7cf30cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ Record of the modification in project development. - [Issue 33 : Support "M/G/T" as size prefix.](https://github.com/suikan4github/kaiten-yaki/issues/33) ### Changed +- [Issue 38 : "Ready to reboot" message should be changed](https://github.com/suikan4github/kaiten-yaki/issues/38) +- [Issue 39 : Change message style](https://github.com/suikan4github/kaiten-yaki/issues/39) + ### Deprecated - [Issue 34 : BIOS support should be obsoleted ](https://github.com/suikan4github/kaiten-yaki/issues/34) @@ -16,7 +19,6 @@ Record of the modification in project development. ### Fixed - [Issue 32 : Ubuntu 22.04 fails to deactivate the swap](https://github.com/suikan4github/kaiten-yaki/issues/32) - [Issue 36 : Clear the PASSPHRASE variable at the end of installation](https://github.com/suikan4github/kaiten-yaki/issues/36) -- [Issue 38 : "Ready to reboot" message should be changed](https://github.com/suikan4github/kaiten-yaki/issues/38) ### Known Issue From ecbafb4a6dc9e47647cb8f02dcf2603107892112 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Thu, 12 May 2022 07:54:33 +0900 Subject: [PATCH 27/29] Update README.md for v1.3.0 --- README.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 2376bfb..7c2b120 100644 --- a/README.md +++ b/README.md @@ -25,15 +25,20 @@ As depicted above, the LVM volume group has only one physical volume. # Tested environment These scripts are tested with the following environment. -- VMWare Workstation 15.5.7 ( EFI/BIOS ) -- ThinkPad X220 (BIOS) -- Ubuntu 20.04.3 amd64 desktop -- Ubuntu 21.04 amd64 desktop -- Ubuntu 21.10 amd64 desktop -- Ubuntu Mate 20.04.3 amd64 desktop -- void-live-x86_64-20210218-mate.iso -- void-live-x86_64-musl-20210218-mate.iso -- void-live-x86_64-20210218.iso +- VMVare Workstation 15.5.7 ( EFI ) +- Ubuntu 22.04 amd64 desktop +- void-live-x86_64-20210930-xfce.iso +- void-live-x86_64-20210930.iso +- Followings are the tested environment of the Kaiten-Yaki v1.2.0 + - VMWare Workstation 15.5.7 ( EFI/BIOS ) + - ThinkPad X220 (BIOS) + - Ubuntu 20.04.3 amd64 desktop + - Ubuntu 21.04 amd64 desktop + - Ubuntu 21.10 amd64 desktop + - Ubuntu Mate 20.04.3 amd64 desktop + - void-live-x86_64-20210218-mate.iso + - void-live-x86_64-musl-20210218-mate.iso + - void-live-x86_64-20210218.iso # Installation Rough procedure of the installation is as followings : @@ -43,11 +48,8 @@ Rough procedure of the installation is as followings : The detail procedure is explained in the [INSTALL.md](INSTALL.md). -# Known issues -If you install two or more Void Linux into the EFI system, only the last one can boot without trouble. This is not the problem of Kaiten-yaki. - # Variants considerations -Ubuntu has several variants ( flavors ). While while only the MATE flavor is tested, other flavors may work correctly as far as it uses Ubiquity installer. +Ubuntu has several variants ( flavors ). While while only the Ubuntu desktop is tested, other flavors may work correctly as far as it uses Ubiquity installer. # Other resources See [Wiki](https://github.com/suikan4github/kaiten-yaki/wiki) for the application notes and the useful links. From 353a9dd8b49435ae1703f6609860d91071691577 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 14 May 2022 08:33:21 +0900 Subject: [PATCH 28/29] Preparing release of the v1.3.0 --- CHANGELOG.md | 11 ++++++++++- README.md | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cf30cd..1d52570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ Record of the modification in project development. ## [Unreleased] - yyyy-mm-dd ### Added +### Changed +### Deprecated +### Removed +### Fixed +### Known Issue + +## [1.3.0] - 2022-05-15 +### Added - [Issue 31 : Add extra partition functionality.](https://github.com/suikan4github/kaiten-yaki/issues/31) - [Issue 33 : Support "M/G/T" as size prefix.](https://github.com/suikan4github/kaiten-yaki/issues/33) @@ -87,7 +95,8 @@ See [Testing before release v1.1.0](https://github.com/suikan4github/kaiten-yaki ### Known Issue -[Unreleased]: https://github.com/suikan4github/kaiten-yaki/compare/v1.2.0...develop +[Unreleased]: https://github.com/suikan4github/kaiten-yaki/compare/v1.3.0...develop +[1.3.0]: https://github.com/suikan4github/kaiten-yaki/compare/v1.2.0...v1.3.0 [1.2.0]: https://github.com/suikan4github/kaiten-yaki/compare/v1.1.0...v1.2.0 [1.1.0]: https://github.com/suikan4github/kaiten-yaki/compare/v1.0.0...v1.1.0 [1.0.0]: https://github.com/suikan4github/kaiten-yaki/compare/v0.0.0...v1.0.0 diff --git a/README.md b/README.md index 7c2b120..ef66460 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ Kaiten-yaki v1.3.0 is a script set to install Linux to your AMD64 desktop system. With these scripts, you can install Ubuntu/Void Linux to an encrypted partition easily. The followings are the list of functionalities: -- Ubuntu and Void Linux. +- Ubuntu and Void Linux support. - Help to install from LiveCD/USB. - Invoke GUI/TUI installer automatically at the middle of script execution, for the ease of installation. -- Automatic detection of EFI firmware and create GPT( The BIOS detection and MBR creation function exist. But it is not maintained from v1.3.0 ). +- Automatic detection of EFI firmware and create GPT (The BIOS detection and MBR creation function exist. But they are not maintained from v1.3.0). - Create an EFI partition, if needed. - Support multiple boot in a LUKS partition. - Support btrfs in addition to the major file systems. -- The "/boot" is located in the same logical volume as the "/". -- The swap logical volume is located inside the encrypted volume. +- The "/boot" is located in the same encrypted logical volume with the "/". +- The swap is located in the same encrypted logical volume with the "/". - You need to type a passphrase only once in the boot sequence. With the configuration parameters, you can customize each installation. For example, you can configure the system to have 2, 3, or 4,... distributions in an HDD/SSD, as you want. From 09ae43b7c141c2eb51847bb72e81aaf67ce81aae Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sun, 15 May 2022 10:15:51 +0900 Subject: [PATCH 29/29] Changed README.md "maintained" -> "tested" --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ef66460..bb95640 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ The followings are the list of functionalities: - Ubuntu and Void Linux support. - Help to install from LiveCD/USB. - Invoke GUI/TUI installer automatically at the middle of script execution, for the ease of installation. -- Automatic detection of EFI firmware and create GPT (The BIOS detection and MBR creation function exist. But they are not maintained from v1.3.0). +- Automatic detection of EFI firmware and create GPT (The BIOS detection and MBR creation function exist. But they are not test from v1.3.0). - Create an EFI partition, if needed. - Support multiple boot in a LUKS partition. - Support btrfs in addition to the major file systems. - The "/boot" is located in the same encrypted logical volume with the "/". - The swap is located in the same encrypted logical volume with the "/". -- You need to type a passphrase only once in the boot sequence. +- You need to type a passphrase only once in the boot sequence of the installed system. With the configuration parameters, you can customize each installation. For example, you can configure the system to have 2, 3, or 4,... distributions in an HDD/SSD, as you want.