Remove debug lock and code cleanup

This commit is contained in:
Eric Renfro 2024-06-23 20:00:38 -04:00
parent bbbb75a004
commit ce6717fc00
Signed by: psi-jack
SSH key fingerprint: SHA256:1TKB8Z257L8EHK8GWNxKgMhD8a+FAR+f+j3nnlcuNVM

View file

@ -1,8 +1,5 @@
#!/bin/bash
#SUBVOLS_DEFAULT=("@home" "@root" "@srv" "@opt" "@local" "@cache" "@containers" "@libvirt" \
# "@machines" "@portables" "@log" "@spool" "@tmp" "@www" "@swap" "@snapshots")
declare -rA SUBVOLS_DEFAULT=(
["@home"]="home"
["@root"]="root"
@ -42,8 +39,6 @@ function create_luks() {
local cmd="echo"
else
local cmd=""
echo "WARNING: Not in Debug mode, exiting now"
exit 254
fi
${cmd} cryptsetup --cipher aes-xts-plain64 --hash sha512 --use-random --verify-passphrase luksFormat "$RootPart"
@ -55,8 +50,6 @@ function prepare_format() {
local cmd="echo"
else
local cmd=""
echo "WARNING: Not in Debug mode, exiting now"
exit 254
fi
echo "Formatting EFI: $EFIPart"
@ -83,8 +76,6 @@ function create_subvolumes() {
local cmd="echo"
else
local cmd=""
echo "WARNING: Not in Debug mode, exiting now"
exit 254
fi
if [[ "$BootPart" == "@boot" ]]; then
@ -123,8 +114,6 @@ function prepare_target() {
local cmd="echo"
else
local cmd=""
echo "WARNING: Not in Debug mode, exiting now"
exit 254
fi
${cmd} mkdir /target
@ -141,9 +130,6 @@ function prepare_target() {
do
${cmd} mkdir -p /target/"${SUBVOLS_DEFAULT[$subvol]}"
done
#${cmd} mkdir -p /target/{boot,home,root,srv,opt,.snapshots,usr/local}
#${cmd} mkdir -p /target/{var/lib/containers,var/lib/libvirt/images,var/lib/machines,var/lib/portables}
#${cmd} mkdir -p /target/{var/cache,var/log,var/spool,var/tmp,var/www}
if [[ "$BootPart" == "@boot" ]]; then
${cmd} mount -o noatime,space_cache=v2,ssd,subvol=@boot "$rootmount" /target/boot
@ -174,8 +160,6 @@ function expert_step() {
local cmd="echo"
else
local cmd=""
echo "WARNING: Not in Debug mode, exiting now"
exit 254
fi
${cmd} apt install -y arch-install-scripts
@ -195,7 +179,6 @@ function expert_step() {
fi
fi
#if [[ -f /target/swap/hibernate.swp ]]; then
if [[ "$SWAP" ]]; then
if [[ "$DEBUG" ]]; then
echo "echo \"/swap/hibernate.swp none swap defaults 0 0\" >> /target/etc/fstab"