Make Swap subvol optional.

This commit is contained in:
Eric Renfro 2024-06-23 19:57:49 -04:00
parent 28d30d3700
commit bbbb75a004
Signed by: psi-jack
SSH key fingerprint: SHA256:1TKB8Z257L8EHK8GWNxKgMhD8a+FAR+f+j3nnlcuNVM

View file

@ -18,7 +18,6 @@ declare -rA SUBVOLS_DEFAULT=(
["@spool"]="var/spool" ["@spool"]="var/spool"
["@tmp"]="var/tmp" ["@tmp"]="var/tmp"
["@www"]="var/www" ["@www"]="var/www"
["@swap"]="swap"
["@snapshots"]=".snapshots" ["@snapshots"]=".snapshots"
) )
@ -92,6 +91,10 @@ function create_subvolumes() {
subvols+=("@boot") subvols+=("@boot")
fi fi
if [[ "$SWAP" ]]; then
subvols+=("@swap")
fi
subvols+=(${!SUBVOLS_DEFAULT[@]}) subvols+=(${!SUBVOLS_DEFAULT[@]})
if [[ "$ENCRYPTION" ]]; then if [[ "$ENCRYPTION" ]]; then
@ -105,7 +108,7 @@ function create_subvolumes() {
${cmd} btrfs subvolume create /mnt/"$subvol" ${cmd} btrfs subvolume create /mnt/"$subvol"
done done
${cmd} mount /mnt ${cmd} umount /mnt
} }
function get_hibernate_size() { function get_hibernate_size() {
@ -175,7 +178,7 @@ function expert_step() {
exit 254 exit 254
fi fi
${cmd} apt install arch-install-scripts ${cmd} apt install -y arch-install-scripts
if [[ "$DEBUG" ]]; then if [[ "$DEBUG" ]]; then
echo "genfstab -U /target >> /target/etc/genfstab" echo "genfstab -U /target >> /target/etc/genfstab"
@ -192,7 +195,8 @@ function expert_step() {
fi fi
fi fi
if [[ -f /target/swap/hibernate.swp ]]; then #if [[ -f /target/swap/hibernate.swp ]]; then
if [[ "$SWAP" ]]; then
if [[ "$DEBUG" ]]; then if [[ "$DEBUG" ]]; then
echo "echo \"/swap/hibernate.swp none swap defaults 0 0\" >> /target/etc/fstab" echo "echo \"/swap/hibernate.swp none swap defaults 0 0\" >> /target/etc/fstab"
else else