File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/ash
2+
3+ # /oldroot depends on things inside /oldroot/run/archiso...
4+ mkdir /oldrun
5+ mount -n --move /oldroot/run /oldrun
6+
7+ # Unmount all mounts now.
8+ umount " $( mount | awk ' $3 ~/^\/oldroot/ {print $3}' | sort -r) "
9+
10+ # Remove all dm-snapshot devices.
11+ dmsetup remove_all
12+
13+ # Remove all loopback devices.
14+ for _lup in $( grep ^/dev/loop /oldrun/archiso/used_block_devices | tac) ; do
15+ if ! losetup -d -- " ${_lup} " 2> /dev/null; then
16+ umount -d -- " ${_lup} "
17+ fi
18+ done
19+
20+ # Unmount the space used to store *.cow.
21+ umount /oldrun/archiso/cowspace
22+
23+ # Unmount boot device if needed (no copytoram=y used)
24+ if [ ! -d /oldrun/archiso/copytoram ]; then
25+ if [ -d /oldrun/archiso/img_dev ]; then
26+ umount /oldrun/archiso/img_dev
27+ else
28+ umount /oldrun/archiso/bootmnt
29+ fi
30+ fi
31+
32+ # reboot / poweroff / halt, depending on the argument passed by init
33+ # if something invalid is passed, we halt
34+ case " $1 " in
35+ reboot|poweroff|halt) " $1 " -f ;;
36+ * ) halt -f;;
37+ esac
38+
39+ # vim: set ft=sh:
Original file line number Diff line number Diff line change @@ -67,13 +67,11 @@ run_latehook () {
6767 # shellcheck disable=SC2154
6868 # defined via initcpio's parse_cmdline()
6969 if [ " ${copytoram} " = " y" ]; then
70- for curif in /sys/class/net/* ; do
71- netdev=${curif#/ sys/ class/ net/ }
72- ip addr flush dev " ${netdev} "
73- ip link set " ${netdev} " down
74- done
70+ if [ -n " ${bootif_dev} " ]; then
71+ ip addr flush dev " ${bootif_dev} "
72+ ip link set " ${bootif_dev} " down
73+ fi
7574 elif [ " ${copy_resolvconf} " != " n" ] && [ -f /etc/resolv.conf ]; then
76- rm -f /new_root/etc/resolv.conf
7775 cp /etc/resolv.conf /new_root/etc/resolv.conf
7876 fi
7977 fi
You can’t perform that action at this time.
0 commit comments