update scripts to use new live path /run/initramfs

pull/40/head
TomasM 2017-11-10 15:19:06 -05:00
parent 087eb008e0
commit 7696013557
4 changed files with 9 additions and 9 deletions

View File

@ -4,7 +4,7 @@ Documentation=man:dhclient(8)
Wants=network.target Wants=network.target
After=network-pre.target systemd-sysctl.service systemd-modules-load.service After=network-pre.target systemd-sysctl.service systemd-modules-load.service
Before=network.target shutdown.target network-online.target Before=network.target shutdown.target network-online.target
ConditionPathExists=!/mnt/live/net.up.flag ConditionPathExists=!/run/initramfs/net.up.flag
[Service] [Service]
Type=forking Type=forking

View File

@ -6,12 +6,12 @@
# Simply add the following as the last command executed by init on your distro # Simply add the following as the last command executed by init on your distro
# instead of the actual poweroff or shutdown command: # instead of the actual poweroff or shutdown command:
# #
# exec /mnt/live/lib/cleanup --start poweroff # exec /run/initramfs/lib/cleanup --start poweroff
# or # or
# exec /mnt/live/lib/cleanup --start shutdown # exec /run/initramfs/lib/cleanup --start shutdown
# #
# on Slackware, add this to rc.0: # 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 # 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 # 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 # 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 # 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). # 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 if [ $pid -lt $PPID ]; then
LIST="$LIST $pid" LIST="$LIST $pid"
fi 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 # 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 # 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. # - without this, init would be blocking union and it couldn't be unmounted later.
cd /mnt/live cd /run/initramfs
cp "$0" sbin/init cp "$0" sbin/init
pivot_root . memory/union pivot_root . memory/union
echo "$2 -f" > /lib/command echo "$2 -f" > /lib/command

View File

@ -2,7 +2,7 @@
TMP=/tmp/changes$$ 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/" 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 if [ "$1" = "" ]; then
echo "" echo ""
@ -13,7 +13,7 @@ if [ "$1" = "" ]; then
echo "Usage:" echo "Usage:"
echo " $0 [ target_file.sb ] [ changes_directory ]" echo " $0 [ target_file.sb ] [ changes_directory ]"
echo "" 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 "" echo ""
exit 1 exit 1
fi fi

View File

@ -7,7 +7,7 @@
# list # list
LIVE=/mnt/live/memory LIVE=/run/initramfs/memory
# Print error message and exit # Print error message and exit
# $1 = error message # $1 = error message