From bbbb75a0042d6690d6b7f292207ed1018e38437d Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Sun, 23 Jun 2024 19:57:49 -0400 Subject: [PATCH] Make Swap subvol optional. --- lmde-expert.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lmde-expert.sh b/lmde-expert.sh index c58c763..2f24489 100755 --- a/lmde-expert.sh +++ b/lmde-expert.sh @@ -18,7 +18,6 @@ declare -rA SUBVOLS_DEFAULT=( ["@spool"]="var/spool" ["@tmp"]="var/tmp" ["@www"]="var/www" - ["@swap"]="swap" ["@snapshots"]=".snapshots" ) @@ -92,6 +91,10 @@ function create_subvolumes() { subvols+=("@boot") fi + if [[ "$SWAP" ]]; then + subvols+=("@swap") + fi + subvols+=(${!SUBVOLS_DEFAULT[@]}) if [[ "$ENCRYPTION" ]]; then @@ -105,7 +108,7 @@ function create_subvolumes() { ${cmd} btrfs subvolume create /mnt/"$subvol" done - ${cmd} mount /mnt + ${cmd} umount /mnt } function get_hibernate_size() { @@ -175,7 +178,7 @@ function expert_step() { exit 254 fi - ${cmd} apt install arch-install-scripts + ${cmd} apt install -y arch-install-scripts if [[ "$DEBUG" ]]; then echo "genfstab -U /target >> /target/etc/genfstab" @@ -192,7 +195,8 @@ function expert_step() { fi fi - if [[ -f /target/swap/hibernate.swp ]]; then + #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" else