mirror of
https://github.com/KDE/kde-linux.git
synced 2026-06-16 19:39:24 -04:00
live: mount /system
previously we'd only mount it during calamares run, which is a bit late since we want to seed flatpaks
This commit is contained in:
41
mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator
Executable file
41
mkosi.extra/usr/lib/systemd/system-generators/kde-linux-live-generator
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
# SPDX-FileCopyrightText: 2024 Harald Sitter <sitter@kde.org>
|
||||
|
||||
set -eux
|
||||
|
||||
. /usr/lib/os-release
|
||||
|
||||
normal_dir=$1
|
||||
# shellcheck disable=SC2034
|
||||
early_dir=$2
|
||||
# shellcheck disable=SC2034
|
||||
late_dir=$3
|
||||
|
||||
if ! grep "kdeos.live=1" /proc/cmdline; then
|
||||
echo "kdeos.live=1 not in cmdline"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(readlink --canonicalize /dev/disk/by-label/KDEOSLive)" != "$(readlink --canonicalize /dev/gpt-auto-root)" ]; then
|
||||
echo "gpt-auto-root is not KDEOSLive"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<- EOF > "$normal_dir/system.mount"
|
||||
# Generated by $(basename "$0")
|
||||
[Unit]
|
||||
Description=Mount unit for /system
|
||||
|
||||
[Mount]
|
||||
What=/dev/disk/by-label/KDEOSLive
|
||||
Where=/system
|
||||
Type=btrfs
|
||||
Options=rw,subvol=/
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
mkdir "$normal_dir/multi-user.target.wants/"
|
||||
ln -s ../system.mount "$normal_dir/multi-user.target.wants/system.mount"
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
# SPDX-FileCopyrightText: 2024 Harald Sitter <sitter@kde.org>
|
||||
|
||||
if ! /proc/cmdline | grep 'KDEOSLive'; then
|
||||
echo "Not running kdeos-live-generator" > /dev/kmsg
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ls -lahR /dev/disk > /dev/kmsg
|
||||
|
||||
if [ -f /dev/disk/by-label/KDEOSLive ]; then
|
||||
echo "Found by label" > /dev/kmsg
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user