Crrect live image detection using partlabel

The script now extracts and verifies the label of the specifically booted device using `/dev/gpt-auto-root` and `lsblk`.

Fixes #82
This commit is contained in:
João Pedro Silva Sousa
2026-05-23 20:09:06 +00:00
committed by Nate Graham
parent ad947d37a4
commit 3f5b3b732c

View File

@@ -10,7 +10,14 @@ if ! grep "kde-linux.live=1" /proc/cmdline; then
exit 1
fi
if [ "$(readlink --canonicalize /dev/disk/by-partlabel/KDELinuxLive)" != "$(readlink --canonicalize /dev/gpt-auto-root)" ]; then
# Resolve the canonical path of the device that actually booted
BOOTED_ROOT=$(readlink --canonicalize /dev/gpt-auto-root)
# Extract the partition label specifically from that booted device
BOOTED_LABEL=$(lsblk -no PARTLABEL "$BOOTED_ROOT")
# Verify if the booted device is indeed the KDE Linux Live medium
if [ "$BOOTED_LABEL" != "KDELinuxLive" ]; then
echo "gpt-auto-root is not KDELinuxLive"
exit 1
fi