summaryrefslogtreecommitdiff
path: root/kanotix
diff options
context:
space:
mode:
authorHolger Paradies <retabell@gmx.de>2021-05-15 09:26:44 +0200
committerHolger Paradies <retabell@gmx.de>2021-05-15 09:26:44 +0200
commit7777edead02eb1a5d2fc5faa57a0424d09b15236 (patch)
tree580b0b16fd2d575955364aafefde54b6e1561ef9 /kanotix
parent0dedcb0d4d4bb2c7693af28201fbc3fc36305c82 (diff)
downloadacritoxinstaller-7777edead02eb1a5d2fc5faa57a0424d09b15236.zip
acritoxinstaller-7777edead02eb1a5d2fc5faa57a0424d09b15236.tar.gz
Persistence add new mountpoint
Diffstat (limited to 'kanotix')
-rw-r--r--kanotix/enable_persistent_live.bash26
1 files changed, 24 insertions, 2 deletions
diff --git a/kanotix/enable_persistent_live.bash b/kanotix/enable_persistent_live.bash
index 807730a..c1097c7 100644
--- a/kanotix/enable_persistent_live.bash
+++ b/kanotix/enable_persistent_live.bash
@@ -9,7 +9,7 @@ partition=3
filesystem=ext4
. /etc/default/distro
-isodev="$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"){print $1;}}' /proc/mounts)"
+isodev="$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"||$2=="/run/live/medium"){print $1;}}' /proc/mounts)"
case $isodev in
/dev/sd*) ;;
*) isodev= ;;
@@ -25,6 +25,15 @@ exit 1
;;
esac
+if [ -d "/run/live/persistence" ]; then
+if [ -x "$KDIALOG" ]; then
+ $KDIALOG --error "Persistent mode seems to be enabled already!" --title "Persistent Live-USB-Stick"
+elif [ -x "$ZENITY" ]; then
+ $ZENITY --error --text "Persistent mode seems to be enabled already!" --title "Persistent Live-USB-Stick"
+fi
+exit 1
+fi
+
if [ "$FLL_DISTRO_MODE" != "live" -o -z "$isodev" ]; then
if [ -x "$KDIALOG" ]; then
$KDIALOG --error "This script can only be used from a Live USB-Stick!" --title "Persistent Live-USB-Stick"
@@ -98,6 +107,18 @@ if [ ! -e "$isodisk"$partition ]; then
mkfs.$filesystem -L "persistence" "$isodisk"$partition
fi
+if [ -d /run/live/medium ]; then
+ mkdir -p /run/live/persistence
+ mount "$isodisk"$partition /run/live/persistence
+ set -- $(cat /proc/cmdline)
+ shift
+ echo "set persistence_cmdline='$@ persistence'" > /run/live/persistence/grub.cmdline
+ echo "/ union" > /run/live/persistence/persistence.conf
+ umount /run/live/persistence
+ rmdir /run/live/persistence
+
+else
+
if [ -d /lib/live/mount ]; then
mkdir -p /lib/live/mount/persistence
mount "$isodisk"$partition /lib/live/mount/persistence
@@ -117,7 +138,8 @@ elif [ -d /live ]; then
umount /live/persistence
rmdir /live/persistence
fi
-
+fi
#killall -9 kdialog
kill $(ps ax | grep kdialog | grep Live-USB | cut -c2-5)
+killall -9 kdialog_progress_helper
exit 0