Skip to content

Commit 4f9c383

Browse files
Save changes at: 1780130071
1 parent 5727703 commit 4f9c383

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

base.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ function partitioning() {
150150
UEFI=$(lsblk --ascii --noheadings --output=PATH --filter "PARTLABEL=='efi' && PKNAME=='${DISK}'")
151151
SWAP=$(lsblk --ascii --noheadings --output=PATH --filter "PARTLABEL=='swap' && PKNAME=='${DISK}'")
152152
ROOT=$(lsblk --ascii --noheadings --output=PATH --filter "PARTLABEL=='root' && PKNAME=='${DISK}'")
153+
OPTS="noatime,compress=zstd,ssd,space_cache=v2"
153154

154155
if [[ -z "${UEFI}" || -z "${SWAP}" || -z "${ROOT}" ]]; then
155156
echo "ERROR: Partition detection failed"
@@ -166,25 +167,28 @@ function partitioning() {
166167
printf "%s" "${PASSWORD_VOLUMEN}" | cryptsetup open --key-file - "${ROOT}" cryptroot
167168
udevadm settle
168169
mkfs.btrfs -L ROOT "/dev/mapper/cryptroot" &> /dev/null
170+
mount "/dev/mapper/cryptroot" /mnt
169171

170-
# Mount: swap, root and boot:
172+
# Mount the swap:
171173
swapon "${SWAP}"
172-
mount "/dev/mapper/cryptroot" /mnt
173-
btrfs subvolume create /mnt/@ &> /dev/null
174-
btrfs subvolume create /mnt/@home &> /dev/null
175-
btrfs subvolume create /mnt/@log &> /dev/null
176-
btrfs subvolume create /mnt/@pkg &> /dev/null
174+
175+
# Create subvolumes:
176+
btrfs subvolume create /mnt/@ &> /dev/null
177+
btrfs subvolume create /mnt/@home &> /dev/null
178+
btrfs subvolume create /mnt/@log &> /dev/null
179+
btrfs subvolume create /mnt/@pkg &> /dev/null
177180
btrfs subvolume create /mnt/@snapshots &> /dev/null
181+
182+
# Unmount the root mount point:
178183
umount /mnt
179184

180-
OPTS="noatime,compress=zstd,ssd,space_cache=v2"
185+
# Mount all subvolumes in their correct locations:
181186
mount -o ${OPTS},subvol=@ "/dev/mapper/cryptroot" /mnt
182187
mkdir -p /mnt/{home,var/log,var/cache/pacman/pkg,.snapshots,boot}
183188
mount -o ${OPTS},subvol=@home "/dev/mapper/cryptroot" /mnt/home
184189
mount -o ${OPTS},subvol=@log "/dev/mapper/cryptroot" /mnt/var/log
185190
mount -o ${OPTS},subvol=@pkg "/dev/mapper/cryptroot" /mnt/var/cache/pacman/pkg
186191
mount -o ${OPTS},subvol=@snapshots "/dev/mapper/cryptroot" /mnt/.snapshots
187-
188192
mount "${UEFI}" /mnt/boot/
189193

190194
# Remove default directories lost+found:

0 commit comments

Comments
 (0)