mirror of
https://github.com/KDE/kde-linux.git
synced 2026-06-02 20:58:43 -04:00
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:
committed by
Nate Graham
parent
ad947d37a4
commit
3f5b3b732c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user