From 3f5b3b732c2fc4c3826cfa87f5fb5963f9e0ceef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Silva=20Sousa?= <222006258@aluno.unb.br> Date: Sat, 23 May 2026 20:09:06 +0000 Subject: [PATCH] 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 --- mkosi.extra/live/usr/lib/live-setup | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mkosi.extra/live/usr/lib/live-setup b/mkosi.extra/live/usr/lib/live-setup index dabdaf5..dea1f09 100755 --- a/mkosi.extra/live/usr/lib/live-setup +++ b/mkosi.extra/live/usr/lib/live-setup @@ -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