summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Paradies <retabell@gmx.de>2023-06-18 09:17:02 +0200
committerHolger Paradies <retabell@gmx.de>2024-02-27 17:17:21 +0100
commit37b6722aca6ed15b99ff114279967c34bb3178ed (patch)
tree48710dd9c3aceea83138d29a945a0e691305df1f
parentbaf36170d55f4752484fb447329eb6028f47206c (diff)
downloadkanotix-37b6722aca6ed15b99ff114279967c34bb3178ed.zip
kanotix-37b6722aca6ed15b99ff114279967c34bb3178ed.tar.gz
Use /proc/cmdline to detect persistence boot
-rwxr-xr-xconfig/chroot_local-includes/lib/live/config/9000-enable-persistent16
1 files changed, 10 insertions, 6 deletions
diff --git a/config/chroot_local-includes/lib/live/config/9000-enable-persistent b/config/chroot_local-includes/lib/live/config/9000-enable-persistent
index 562df9d..053fe0a 100755
--- a/config/chroot_local-includes/lib/live/config/9000-enable-persistent
+++ b/config/chroot_local-includes/lib/live/config/9000-enable-persistent
@@ -20,13 +20,17 @@ then
return
fi
-case "$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"||$2=="/run/live/medium"){print $1;}}' /proc/mounts)" in
+HAVE_PERS_CMDLINE="$(grep -F persistence /proc/cmdline)"
+if [ -n "$HAVE_PERS_CMDLINE" ]; then
+ HAVE_PERS_CMDLINE="persistence"
+fi
+
+ISO_DEVICE="$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"||$2=="/run/live/medium"){print $1;}}' /proc/mounts)"
+
+case "$ISO_DEVICE" in
/dev/sd*)
- if [ -d "/run/live/persistence" ]; then
- rm -f /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop
- fi
- case "$( ls /grub.cmdline 2>/dev/null)" in
- /grub.cmdline)
+ case "$HAVE_PERS_CMDLINE" in
+ persistence)
rm -f /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop
;;
*)