btrfs: compress and simple quota please

should help prevent disk space problems

Fixes #10
This commit is contained in:
Harald Sitter
2024-09-21 01:54:00 +02:00
parent 17b5f438f5
commit 0c93a5aaa0
4 changed files with 20 additions and 3 deletions

View File

@@ -23,9 +23,11 @@ umount -R ./*
rm -rfv ./*
mount -o ro /dev/gpt-auto-root /system
mount -o rw "$device" "$tmpdir"
mount -o rw,compress=zstd:1 "$device" "$tmpdir"
cd "$tmpdir"
rm -rfv ./*
btrfs quota enable --simple .
btrfs send "/system/@kdeos_$IMAGE_VERSION" | btrfs receive .
btrfs subvolume create @home
btrfs subvolume create @root

View File

@@ -20,7 +20,8 @@ FILES=()
HOOKS=(base systemd autodetect modconf kms keyboard block sd-encrypt filesystems fsck systemd-extension plymouth microcode)
EOF
echo "rw rootflags=subvol=@kdeos_$IMAGE_VERSION systemd.volatile=overlay systemd.firstboot=false systemd.hostname=kdeos kdeos.live=1 plasma.live.user=live \
echo "rw rootflags=subvol=@kdeos_$IMAGE_VERSION,compress=zstd:1 \
systemd.volatile=overlay systemd.firstboot=false systemd.hostname=kdeos kdeos.live=1 plasma.live.user=live \
lsm=landlock,lockdown,yama,integrity,apparmor,bpf \
quiet splash" > cmdline
mkinitcpio --config mkinitcpio.conf --generate initrd --kernel "$kernel_version"
@@ -31,7 +32,7 @@ ukify build \
--output live.efi
# lsm= defaulting to apparmor from https://wiki.archlinux.org/title/AppArmor
echo "rw rootflags=subvol=@kdeos_$IMAGE_VERSION \
echo "rw rootflags=subvol=@kdeos_$IMAGE_VERSION,compress=zstd:1 \
lsm=landlock,lockdown,yama,integrity,apparmor,bpf \
quiet splash" > cmdline
mkinitcpio --config mkinitcpio.conf --generate initrd --kernel "$kernel_version"

View File

@@ -10,6 +10,7 @@ enable apparmor.service
enable systemd-oomd.service
enable bluetooth.service
enable kde-linux-btrfs.service
enable kde-linux-live-setup.service
enable plasma-setup-live-system.service
enable kdeos-overlay.service

View File

@@ -0,0 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2023 Harald Sitter <sitter@kde.org>
[Unit]
Description=Configuring Root Filesystem
# live has an overlayed /, don't try to fiddle with it
ConditionKernelCommandLine=!kdeos.live=1
[Service]
ExecStartPre=/usr/bin/btrfs quota enable --simple /system
[Install]
WantedBy=multi-user.target