diff options
Diffstat (limited to 'kanotix')
-rwxr-xr-x | kanotix/9000-enable-persistent | 17 | ||||
-rw-r--r--[-rwxr-xr-x] | kanotix/enable_persistent_live.bash (renamed from kanotix/enable_persistent_live) | 51 | ||||
-rw-r--r-- | kanotix/html/welcome.html | 8 | ||||
-rw-r--r-- | kanotix/html/willkommen.html | 8 |
4 files changed, 69 insertions, 15 deletions
diff --git a/kanotix/9000-enable-persistent b/kanotix/9000-enable-persistent index 734af95..c8f0b31 100755 --- a/kanotix/9000-enable-persistent +++ b/kanotix/9000-enable-persistent @@ -14,16 +14,23 @@ Configure_Persistent Configure_Persistent () { -if ! [ -x /usr/bin/enable_persistent_live ] +if ! [ -x /usr/local/bin/enable_persistent_live.bash ] then touch /var/lib/live/config/enable-persistent return fi -case "$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/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*) - 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 ;; *) @@ -31,7 +38,7 @@ case "$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"){print $1;}}' / [Desktop Entry] Comment[de]=Diesen Live-USB-Stick persistent machen, d.h. alle Änderungen werden auf dem Stick gespeichert. Comment=Make this Live-USB-Stick persistent, i.e. all changes will be saved to the stick. -Exec=/usr/bin/enable_persistent_live +Exec=/usr/local/bin/enable_persistent_live.bash Icon=acritoxinstaller MimeType= Name[de]=»persistent« aktivieren diff --git a/kanotix/enable_persistent_live b/kanotix/enable_persistent_live.bash index a28bdc0..395f3de 100755..100644 --- a/kanotix/enable_persistent_live +++ b/kanotix/enable_persistent_live.bash @@ -4,12 +4,13 @@ # Written by Andreas Loibl <andreas@andreas-loibl.de> KDIALOG="$(which kdialog)" || KDIALOG="/usr/bin/kdialog" ZENITY="$(which zenity)" || ZENITY="/usr/bin/zenity" +YAD="$(which yad)" || YAD="/usr/bin/yad" 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= ;; @@ -20,16 +21,31 @@ 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" +elif [ -x "$YAD" ]; then + $YAD --center --error --text "Persistent mode seems to be enabled already!" --title "Persistent Live-USB-Stick" fi 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" +elif [ -x "$YAD" ]; then + $YAD --center --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" elif [ -x "$ZENITY" ]; then $ZENITY --error --text "This script can only be used from a Live USB-Stick!" --title "Persistent Live-USB-Stick" +elif [ -x "$YAD" ]; then + $YAD --center --error --text "This script can only be used from a Live USB-Stick!" --title "Persistent Live-USB-Stick" fi exit 1 fi @@ -64,6 +80,22 @@ CURRENT CHANGES ARE NOT STORED, YOU HAVE TO REBOOT TO ENABLE PERSISTENCE! Press \"Continue\" when you are ready to start. " --title "Persistent Live-USB-Stick" || exit 0 +elif [ -x "$YAD" ]; then + +$YAD --center --question --text "This script automatically configures your Live-USB-Stick to be persistent: + +* it adds a new partition into the unused space of your stick +* formats the partition with $filesystem filesystem +* writes config files to the new partition + +=============================================================== +CURRENT CHANGES ARE NOT STORED, YOU HAVE TO REBOOT TO ENABLE PERSISTENCE! +=============================================================== + +Press \"Continue\" when you are ready to start. + +" --title "Persistent Live-USB-Stick" || exit 0 + fi cp "$0" "/tmp/$(basename "$0")" chmod +x "/tmp/$(basename "$0")" @@ -72,6 +104,8 @@ $KDIALOG --progressbar "Please wait..." --title "Persistent Live-USB-Stick" 0 sudo "/tmp/$(basename "$0")" "$@" elif [ -x "$ZENITY" ]; then sudo "/tmp/$(basename "$0")" "$@" | $ZENITY --progress --pulsate --text "Please wait..." --title "Persistent Live-USB-Stick" 0 +elif [ -x "$YAD" ]; then +sudo "/tmp/$(basename "$0")" "$@" | $YAD --center --progress --pulsate --text "Please wait..." --title "Persistent Live-USB-Stick" 0 fi exit $? @@ -98,6 +132,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 +163,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 diff --git a/kanotix/html/welcome.html b/kanotix/html/welcome.html index a1534c3..926345a 100644 --- a/kanotix/html/welcome.html +++ b/kanotix/html/welcome.html @@ -15,13 +15,13 @@ <p>Welcome and thank you for choosing Kanotix. The installer will now guide you through the configuration and installation.</p> <p>If you need any help check out the Kanotix website or visit the Kanotix chat room.</p> <ul> -<li><a href="http://kanotix.com">http://kanotix.com</a></li> -<li><a href="http://kanotix.acritox.com">http://kanotix.acritox.com</a></li> -<li><a href="irc://irc.freenode.net/kanotix">irc: irc.freenode.net #kanotix</a></li> +<li><a href="https://kanotix.com">https://kanotix.com</a></li> +<li><a href="https://kanotix.acritox.com">https://kanotix.acritox.com</a></li> +<li><a href="irc://irc.oftc.net/kanotix">irc: irc.oftc.net #kanotix</a></li> </ul> <p style="color:red;">Pay attention with UEFI Installation...</p> <ul> -<li><a href="http://kanotix.com/index.php?module=pnWikka&tag=UEFIornotUEFIEN">Help with UEFI</a></li> +<li><a href="https://kanotix.com/index.php?module=pnWikka&tag=UEFIornotUEFIEN">Help with UEFI</a></li> </ul> <p>Click Next to continue, or Cancel to exit the installer.</p> </td> diff --git a/kanotix/html/willkommen.html b/kanotix/html/willkommen.html index 2b94374..cfad8ca 100644 --- a/kanotix/html/willkommen.html +++ b/kanotix/html/willkommen.html @@ -15,13 +15,13 @@ <p>Herzlich Willkommen und vielen Dank, dass Sie Kanotix gewählt haben. Der Installer wird Sie nun durch die Konfiguration und Installation führen.</p> <p>Falls Sie Hilfe benötigen werfen Sie einen Blick auf die Kanotix-Webseite oder besuchen Sie den Kanotix Chatroom.</p> <ul> -<li><a href="http://kanotix.com">http://kanotix.com</a></li> -<li><a href="http://kanotix.acritox.com">http://kanotix.acritox.com</a></li> -<li><a href="irc://irc.freenode.net/kanotix">irc: irc.freenode.net #kanotix</a></li> +<li><a href="https://kanotix.com">https://kanotix.com</a></li> +<li><a href="https://kanotix.acritox.com">https://kanotix.acritox.com</a></li> +<li><a href="irc://irc.oftc.net/kanotix">irc: irc.oftc.net #kanotix</a></li> </ul> <p style="color:red;">Besonderheiten bei UEFI Installation beachten...</p> <ul> -<li><a href="http://kanotix.com/index.php?module=pnWikka&tag=UEFIornotUEFIEN">Hilfe UEFI</a></li> +<li><a href="https://kanotix.com/index.php?module=pnWikka&tag=UEFIornotUEFIEN">Hilfe UEFI</a></li> </ul> <p>Drücken Sie Weiter um fortzufahren oder Abbrechen um den Installer zu beenden.</p> </td> |