#!/bin/bash
inst cryptsetup
instmods dm_crypt cbc aes sha256 xts
-inst_rules "$moddir/63-luks.rules"
+inst_rules "$moddir/70-luks.rules"
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
--- /dev/null
+# hacky rules to try to activate lvm when we get new block devs...
+#
+# Copyright 2008, Red Hat, Inc.
+# Jeremy Katz <katzj@redhat.com>
+
+
+SUBSYSTEM!="block", GOTO="lvm_end"
+ACTION!="add|change", GOTO="lvm_end"
+KERNEL!="dm-*", GOTO="lvm_end"
+
+IMPORT{program}="vol_id --export $tempnode"
+
+ENV{ID_FS_TYPE}=="LVM2_member", RUN+="/bin/sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -ay'"
+
+OPTIONS="link_priority=-100"
+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
+
+
+LABEL="lvm_end"
SUBSYSTEM!="block", GOTO="lvm_end"
ACTION!="add|change", GOTO="lvm_end"
+KERNEL!="dm-*", GOTO="lvm_end"
+
+IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
-KERNEL=="dm-[0-9]*", IMPORT{program}="vol_id --export $tempnode"
ENV{ID_FS_TYPE}=="LVM2_member", RUN+="/bin/sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -ay'"
+OPTIONS="link_priority=-100"
+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
+
+
LABEL="lvm_end"
#!/bin/bash
inst lvm
-inst_rules "$moddir/64-lvm.rules" 64-device-mapper.rules
\ No newline at end of file
+if [ -x /lib/udev/vol_id ]; then
+ inst_rules "$moddir/64-lvm-vol_id.rules" 64-device-mapper.rules
+else
+ inst_rules "$moddir/64-lvm.rules" 64-device-mapper.rules
+fi
--- /dev/null
+# This file causes block devices with Linux RAID (mdadm) signatures to
+# automatically cause mdadm to be run.
+# See udev(8) for syntax
+
+SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
+ IMPORT{program}="/sbin/mdadm --examine --export $tempnode", \
+ RUN+="/bin/bash -c '[ ! -f /dev/.in_sysinit ] && /sbin/mdadm -I $env{DEVNAME}'"
+
inst /etc/passwd
inst /etc/group
instmods =drivers/md
-inst_rules "$moddir/61-mdadm.rules"
+
+if [ -x /lib/udev/vol_id ]; then
+ inst_rules "$moddir/61-mdadm.rules"
+else
+ inst_rules "$moddir/65-md-incremental.rules"
+ inst_rules 64-md-raid.rules
+fi
+
[ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf
[ -f /etc/mdadm.conf ] && inst /etc/mdadm.conf
if [ -x /sbin/mdmon ] ; then
--- /dev/null
+SUBSYSTEM!="block", GOTO="nbd_end"
+ACTION!="change", GOTO="nbd_end"
+
+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode"
+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+
+LABEL="nbd_end"
SUBSYSTEM!="block", GOTO="nbd_end"
-ACTION!="add|change", GOTO="nbd_end"
+ACTION!="change", GOTO="nbd_end"
-KERNEL=="nbd*", IMPORT{program}="vol_id --export $tempnode"
+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
LABEL="nbd_end"
inst nbd-client
inst_hook cmdline 90 "$moddir/parse-nbdroot.sh"
-inst_rules "$moddir/61-nbd.rules"
+
+if [ -x /lib/udev/vol_id ]; then
+ inst_rules "$moddir/61-nbd-vol_id.rules"
+else
+ inst_rules "$moddir/61-nbd.rules"
+fi
+
inst "$moddir/nbdroot" "/sbin/nbdroot"
instmods nbd
61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules
#Some debian udev rules are named differently
inst_rules 50-udev.rules 95-late.rules
-
+
+if [ ! -x /lib/udev/vol_id ]; then
+ dracut_install blkid
+fi
+
if ldd $(find_binary udevd) |grep -q /lib64/libc; then
dracut_install /lib64/libnss_files*
else