summaryrefslogtreecommitdiff
path: root/initramfs-tools/scripts/samizdat
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-04-19 14:39:53 -0400
committerAndrew Cady <d@jerkface.net>2016-04-19 14:39:53 -0400
commite98c4babea202d692a5dac8c05efc64a44e8aedc (patch)
tree033df22923a6b09b3395006ed4e2056afc281ff9 /initramfs-tools/scripts/samizdat
parent3884276c13d142483b1a018b31f5723e3961965f (diff)
cause the grok-block hooks to run
Diffstat (limited to 'initramfs-tools/scripts/samizdat')
-rw-r--r--initramfs-tools/scripts/samizdat28
1 files changed, 28 insertions, 0 deletions
diff --git a/initramfs-tools/scripts/samizdat b/initramfs-tools/scripts/samizdat
index 81a38d5..3f2ee43 100644
--- a/initramfs-tools/scripts/samizdat
+++ b/initramfs-tools/scripts/samizdat
@@ -10,6 +10,34 @@ mountroot()
10 mount -o move /btrfs /root 10 mount -o move /btrfs /root
11 mkdir /root/cdrom 11 mkdir /root/cdrom
12 mount -o move /cdrom /root/cdrom 12 mount -o move /cdrom /root/cdrom
13
13 sed -i -e 's/^root:x:/root::/' /root/etc/passwd 14 sed -i -e 's/^root:x:/root::/' /root/etc/passwd
15
16 samizdat_install_udev_rules
17
18 openvt -c 13 sh
19 sleep 100
14 set +x 20 set +x
15} 21}
22
23samizdat_install_udev_rules()
24{
25 mkdir -p /etc/udev/rules.d
26 echo 'ACTION=="add", SUBSYSTEM=="block", RUN+="/bin/grok-block $env{DEVNAME}"' \
27 > /etc/udev/rules.d/z00_blockdev_mountroot.rules
28
29 # 'udevadm trigger --action=add' does not work here; need to restard udevd
30 # first. not sure why
31 samizdat_restart_udev
32
33 udevadm trigger -s block --action add
34}
35
36samizdat_restart_udev()
37{
38 mkdir -p /var/log
39 ps aux|grep systemd-udevd
40 killall systemd-udevd
41 /lib/systemd/systemd-udevd --resolve-names=never --debug >/var/log/udevd-systemd.log 2>&1 &
42 udevadm hwdb --update # rule is not executed by 'udevadm trigger' otherwise. not sure why
43} \ No newline at end of file