From e98c4babea202d692a5dac8c05efc64a44e8aedc Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 19 Apr 2016 14:39:53 -0400 Subject: cause the grok-block hooks to run --- initramfs-tools/scripts/samizdat | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'initramfs-tools/scripts/samizdat') 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() mount -o move /btrfs /root mkdir /root/cdrom mount -o move /cdrom /root/cdrom + sed -i -e 's/^root:x:/root::/' /root/etc/passwd + + samizdat_install_udev_rules + + openvt -c 13 sh + sleep 100 set +x } + +samizdat_install_udev_rules() +{ + mkdir -p /etc/udev/rules.d + echo 'ACTION=="add", SUBSYSTEM=="block", RUN+="/bin/grok-block $env{DEVNAME}"' \ + > /etc/udev/rules.d/z00_blockdev_mountroot.rules + + # 'udevadm trigger --action=add' does not work here; need to restard udevd + # first. not sure why + samizdat_restart_udev + + udevadm trigger -s block --action add +} + +samizdat_restart_udev() +{ + mkdir -p /var/log + ps aux|grep systemd-udevd + killall systemd-udevd + /lib/systemd/systemd-udevd --resolve-names=never --debug >/var/log/udevd-systemd.log 2>&1 & + udevadm hwdb --update # rule is not executed by 'udevadm trigger' otherwise. not sure why +} \ No newline at end of file -- cgit v1.2.3