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:
Harald Sitter
2024-09-22 01:13:06 +02:00
parent 21530f6a22
commit 3bdbeebe8a
2 changed files with 41 additions and 15 deletions

View 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"

View File

@@ -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