port live to new erofs as root

major change is that live data is now in /live (/live continues to not
appear on the final system because we selectively mount /usr only)
This commit is contained in:
Harald Sitter
2025-05-15 14:04:42 +02:00
parent 48a6689f63
commit 64af49d499
3 changed files with 10 additions and 28 deletions

View File

@@ -10,13 +10,14 @@ if ! grep "kde-linux.live=1" /proc/cmdline; then
exit 1
fi
if [ "$(readlink --canonicalize /dev/disk/by-label/KDELinuxLive)" != "$(readlink --canonicalize /dev/gpt-auto-root)" ]; then
if [ "$(readlink --canonicalize /dev/disk/by-partlabel/KDELinuxLive)" != "$(readlink --canonicalize /dev/gpt-auto-root)" ]; then
echo "gpt-auto-root is not KDELinuxLive"
exit 1
fi
mkdir --mode 0755 /run/extensions/
ln -s /system/@live /run/extensions/live
# Mind that /live is only available if the erofs is mounted as rootfs. On the final system we selectively only mount usr from the erofs!
ln -s /live /run/extensions/live
systemd-sysext refresh
useradd --create-home --comment "Live User" live
@@ -29,7 +30,7 @@ ln -s ../usr/share/zoneinfo/UTC /etc/localtime
timedatectl set-timezone UTC
localectl set-locale C.UTF-8
mkdir /etc/sddm.conf.d/
mkdir --parents /etc/sddm.conf.d/
cat << EOF > /etc/sddm.conf.d/live.conf
[Autologin]
User=live
@@ -60,7 +61,7 @@ Enabled=false
EOF
# Allow sudo in the live environment for troubleshooting
mkdir -p /etc/sudoers.d
mkdir --parents /etc/sudoers.d
cat << EOF > /etc/sudoers.d/04_live
%wheel ALL=(ALL:ALL) NOPASSWD: ALL
EOF

View File

@@ -17,29 +17,11 @@ if ! grep "kde-linux.live=1" /proc/cmdline; then
exit 0
fi
if [ "$(readlink --canonicalize /dev/disk/by-label/KDELinuxLive)" != "$(readlink --canonicalize /dev/gpt-auto-root)" ]; then
if [ "$(readlink --canonicalize /dev/disk/by-partlabel/KDELinuxLive)" != "$(readlink --canonicalize /dev/gpt-auto-root)" ]; then
echo "gpt-auto-root is not KDELinuxLive"
exit 0
fi
cat <<- EOF > "$normal_dir/system.mount"
# Generated by $(basename "$0")
[Unit]
Description=Mount unit for /system
[Mount]
What=/dev/disk/by-label/KDELinuxLive
Where=/system
Type=btrfs
Options=rw,subvol=/
[Install]
WantedBy=multi-user.target
EOF
mkdir "$normal_dir/multi-user.target.wants/" || true
ln -sf ../system.mount "$normal_dir/multi-user.target.wants/system.mount"
cat <<- EOF > "$normal_dir/var-lib-flatpak.mount"
# Generated by $(basename "$0")
[Unit]
@@ -47,10 +29,9 @@ Description=Mount unit for /var/lib/flatpak
Before=kde-linux-volatile-var-lib-flatpak.service
[Mount]
What=/dev/disk/by-label/KDELinuxLive
What=/usr/share/factory/var/lib/flatpak
Where=/var/lib/flatpak
Type=btrfs
Options=rw,subvol=@flatpak
Options=bind
[Install]
WantedBy=multi-user.target

View File

@@ -6,11 +6,11 @@ Description=KDE Linux Live Session Setup
Requires=systemd-logind.service
Before=display-manager.service
After=systemd-logind.service systemd-homed.service
ConditionPathExists=/system/@live/usr/bin/_kde-linux-live-setup
ConditionPathExists=/live/usr/bin/_kde-linux-live-setup
ConditionKernelCommandLine=kde-linux.live=1
[Service]
ExecStart=/system/@live/usr/bin/_kde-linux-live-setup
ExecStart=/live/usr/bin/_kde-linux-live-setup
ExecStartPost=/usr/bin/systemctl disable %n
[Install]