From 7696013557e1036523012925d87aea0bcb6dc114 Mon Sep 17 00:00:00 2001 From: TomasM Date: Fri, 10 Nov 2017 15:19:06 -0500 Subject: [PATCH] update scripts to use new live path /run/initramfs --- .../rootcopy/lib/systemd/system/dhclient.service | 2 +- initramfs/cleanup | 10 +++++----- tools/savechanges | 4 ++-- tools/slax | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Slax/debian/rootcopy/lib/systemd/system/dhclient.service b/Slax/debian/rootcopy/lib/systemd/system/dhclient.service index bb43641..2c92a32 100644 --- a/Slax/debian/rootcopy/lib/systemd/system/dhclient.service +++ b/Slax/debian/rootcopy/lib/systemd/system/dhclient.service @@ -4,7 +4,7 @@ Documentation=man:dhclient(8) Wants=network.target After=network-pre.target systemd-sysctl.service systemd-modules-load.service Before=network.target shutdown.target network-online.target -ConditionPathExists=!/mnt/live/net.up.flag +ConditionPathExists=!/run/initramfs/net.up.flag [Service] Type=forking diff --git a/initramfs/cleanup b/initramfs/cleanup index 9a853cd..21a3203 100644 --- a/initramfs/cleanup +++ b/initramfs/cleanup @@ -6,12 +6,12 @@ # Simply add the following as the last command executed by init on your distro # instead of the actual poweroff or shutdown command: # -# exec /mnt/live/lib/cleanup --start poweroff +# exec /run/initramfs/lib/cleanup --start poweroff # or -# exec /mnt/live/lib/cleanup --start shutdown +# exec /run/initramfs/lib/cleanup --start shutdown # # on Slackware, add this to rc.0: -# exec /mnt/live/lib/cleanup --start /sbin/$command +# exec /run/initramfs/lib/cleanup --start /sbin/$command # # It may be needed to call this script also with --killall5 from your shutdown scripts # instead of calling regular killall5, to prevent fuse filesystems from being killed @@ -23,7 +23,7 @@ if [ "$1" = "--killall5" ]; then # kill all unneeded processes, which have smaller ID then the ID of # current shell's parent process. We can't use killall5, as it would kill some # processes which may be currently needed, for example fuse filesystems (ntfs-3g). - for pid in $(/mnt/live/bin/ps | grep -v "PID" | grep -E -v "\[.*\]" | grep -E -v "mount|posixovl|fuse" | sed -r "s/^ +//" | cut -d " " -f 1); do + for pid in $(/run/initramfs/bin/ps | grep -v "PID" | grep -E -v "\[.*\]" | grep -E -v "mount|posixovl|fuse" | sed -r "s/^ +//" | cut -d " " -f 1); do if [ $pid -lt $PPID ]; then LIST="$LIST $pid" fi @@ -41,7 +41,7 @@ if [ "$1" = "--start" ]; then # So we're going to force init to stop and start this script instead as PID 1 # If your init works differently, you may need to slightly modify few lines below # - without this, init would be blocking union and it couldn't be unmounted later. - cd /mnt/live + cd /run/initramfs cp "$0" sbin/init pivot_root . memory/union echo "$2 -f" > /lib/command diff --git a/tools/savechanges b/tools/savechanges index 1c3e423..bc96355 100755 --- a/tools/savechanges +++ b/tools/savechanges @@ -2,7 +2,7 @@ TMP=/tmp/changes$$ EXCLUDE="^\$|/\$|[.]wh[.][.]wh[.]orph/|^[.]wh[.][.]wh[.]plnk/|^[.]wh[.][.]wh[.]aufs|^var/cache/|^var/backups/|^var/tmp/|^var/log/|^var/lib/apt/|^var/lib/dhcp/|^var/lib/systemd/|^sbin/fsck[.]aufs|^etc/resolv[.]conf|^root/[.]Xauthority|^root/[.]xsession-errors|^root/[.]fehbg|^root/[.]fluxbox/lastwallpaper|^etc/mtab|^etc/fstab|^boot/|^dev/|^mnt/|^proc/|^run/|^sys/|^tmp/" -CHANGES=/mnt/live/memory/changes +CHANGES=/run/initramfs/memory/changes if [ "$1" = "" ]; then echo "" @@ -13,7 +13,7 @@ if [ "$1" = "" ]; then echo "Usage:" echo " $0 [ target_file.sb ] [ changes_directory ]" echo "" - echo "If changes_directory is not specified, /mnt/live/memory/changes is used." + echo "If changes_directory is not specified, /run/initramfs/memory/changes is used." echo "" exit 1 fi diff --git a/tools/slax b/tools/slax index 0468081..b5109b2 100755 --- a/tools/slax +++ b/tools/slax @@ -7,7 +7,7 @@ # list -LIVE=/mnt/live/memory +LIVE=/run/initramfs/memory # Print error message and exit # $1 = error message