diff --git a/mkosi.extra/live/usr/bin/_kde-linux-live-setup b/mkosi.extra/live/usr/bin/_kde-linux-live-setup index d8ed6a5..168a03f 100755 --- a/mkosi.extra/live/usr/bin/_kde-linux-live-setup +++ b/mkosi.extra/live/usr/bin/_kde-linux-live-setup @@ -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 diff --git a/mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator b/mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator index db610aa..3295990 100755 --- a/mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator +++ b/mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator @@ -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 diff --git a/mkosi.extra/usr/lib/systemd/system/kde-linux-live-setup.service b/mkosi.extra/usr/lib/systemd/system/kde-linux-live-setup.service index af63bdf..afda3d8 100644 --- a/mkosi.extra/usr/lib/systemd/system/kde-linux-live-setup.service +++ b/mkosi.extra/usr/lib/systemd/system/kde-linux-live-setup.service @@ -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]