prepare udev rules for udev >= 143

This commit is contained in:
Harald Hoyer 2009-06-19 08:58:15 +02:00
parent 33655fc539
commit afd826bd6c
11 changed files with 71 additions and 8 deletions

View File

@ -1,5 +1,5 @@
#!/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

View File

@ -0,0 +1,20 @@
# 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"

View File

@ -6,8 +6,15 @@
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"

View File

@ -1,3 +1,7 @@
#!/bin/bash
inst lvm
inst_rules "$moddir/64-lvm.rules" 64-device-mapper.rules
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

View File

@ -0,0 +1,8 @@
# 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}'"

View File

@ -3,7 +3,14 @@ dracut_install mdadm
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

View File

@ -0,0 +1,7 @@
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"

View File

@ -1,6 +1,6 @@
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"

View File

@ -2,6 +2,12 @@
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

View File

@ -8,7 +8,11 @@ inst_rules 50-udev-default.rules 60-persistent-storage.rules \
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