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] 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