summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Romero <blake@developercraft.com>2026-04-01 02:27:47 +0100
committerBlake Romero <blake@developercraft.com>2026-04-01 02:27:47 +0100
commit3745ff7f90dc6fc37cb3bbabbd7eb6fc1f62303b (patch)
tree9aabc87361993c34dac27737ff82ab325ceb1d50
parentf9f95fb3f73d00dfdf776101510fb83063b51b0f (diff)
Fix encrypt setup & removed booster
-rwxr-xr-x[-rw-r--r--]install.sh47
1 files changed, 12 insertions, 35 deletions
diff --git a/install.sh b/install.sh
index 164f622..3d661e1 100644..100755
--- a/install.sh
+++ b/install.sh
@@ -4,7 +4,6 @@
# See the README for details
# ======================================================
-# FIXME: encryption setup is broken
# FIXME: DHCP client from iwd does not work
# TODO: add BIOS support
# TODO: add pacman repository options (https://wiki.artixlinux.org/Main/Repositories)
@@ -13,7 +12,7 @@ source config
# Ensure nothing mounted
swapoff -a &> /dev/null
-cryptsetup close Artix &> /dev/null
+cryptsetup close cryptroot &> /dev/null
umount -R /mnt &> /dev/null
# Init shell environment
@@ -129,10 +128,10 @@ if [[ $encrypt == true ]]; then
luksFormat "${root}"
# Open encrypted drive
- echo "${password}" | cryptsetup luksOpen ${root} Artix
+ echo "${password}" | cryptsetup luksOpen ${root} cryptroot
# Change root to mapper
- root="/dev/mapper/Artix"
+ root="/dev/mapper/cryptroot"
fi
# Make BOOT filesystem
@@ -167,28 +166,12 @@ mount -o "${options},subvol=@snapshots" "${root}" /mnt/.snapshots \
mount -o "nodatacow,subvol=@swap" "${root}" /mnt/.swap
# Create swap file
-# btrfs filesystem mkswapfile \
-# --size "$swap_size" \
-# --uuid clear \
-# /mnt/.swap/swapfile
-# btrfs property set /mnt/.swap compression none
-# swapon /mnt/.swap/swapfile
-
-# SWAP FILE
-swapfile=/mnt/.swap/swapfile
-# create an empty file
-truncate -s 0 $swapfile
-# set to copy-on-write
-chattr +Cm $swapfile
-# preallocate file size to swap size
-fallocate -l "$swap_size" $swapfile
-# restrict access to swap file
-chmod 0600 $swapfile
-# initialise the swap file (note: LABEL is required for bootloader)
-mkswap -L SWAP $swapfile
-# ensure compression is disabled
+btrfs filesystem mkswapfile \
+ --size "$swap_size" \
+ --uuid clear \
+ /mnt/.swap/swapfile
btrfs property set /mnt/.swap compression none
-swapon $swapfile
+swapon /mnt/.swap/swapfile
# Mount boot partition.
mount "${boot}" /mnt/boot
@@ -199,7 +182,7 @@ pacman -Syy
# Base packages
basestrap /mnt \
base base-devel \
- booster dinit
+ dinit
if [[ "${elogind}" == true ]]; then
basestrap /mnt elogind-dinit
@@ -397,15 +380,10 @@ fi
# Rebuild ram-disk environment for Linux kernel
artix-chroot /mnt bash -c "mkinitcpio -p linux"
-# Configure booster
-echo "compress: zstd -9 -T0
-modules: btrfs" > /mnt/etc/booster.yaml
-artix-chroot /mnt bash -c "/usr/lib/booster/regenerate_images"
-
# SETUP BOOT LOADER
# --------------------------------------------------------------------
# Add swap device
-devices="resume=LABEL=SWAP"
+devices="resume=LABEL=ROOT"
# BTRFS swap files requires an offset for hibernation to work
# https://man.archlinux.org/man/btrfs.5#HIBERNATION
@@ -414,8 +392,7 @@ devices+=" resume_offset=$offset"
# Add crypt device if enabled
if [[ "${encrypt}" == true ]]; then
- crypt_uuid=$(lsblk -f | grep "$(basename $root)" | awk '{print $4}')
- devices+=" rd.luks.name=${crypt_uuid}=Artix"
+ devices+=" cryptdevice=LABEL=LUKS:$(basename $root)"
fi
# Set command options
@@ -492,7 +469,7 @@ fi
# FINISH
swapoff -a
umount -R /mnt
-[[ "${encrypt}" == true ]] && cryptsetup close Artix
+[[ "${encrypt}" == true ]] && cryptsetup close cryptroot
set +x
echo "