SVN: geninitrd/trunk: Makefile mod-udev.sh udev-rules udev-rules/01-ignore.rules udev-rules/11-dm.ru...
wiget
wiget at pld-linux.org
Sat Dec 3 20:52:50 CET 2011
Author: wiget
Date: Sat Dec 3 20:52:49 2011
New Revision: 12431
Added:
geninitrd/trunk/udev-rules/
geninitrd/trunk/udev-rules/01-ignore.rules
geninitrd/trunk/udev-rules/11-dm.rules
geninitrd/trunk/udev-rules/59-persistent-storage.rules
geninitrd/trunk/udev-rules/61-persistent-storage.rules
Modified:
geninitrd/trunk/Makefile
geninitrd/trunk/mod-udev.sh
Log:
Install special udev rules
Rules copied from dracut
Modified: geninitrd/trunk/Makefile
==============================================================================
--- geninitrd/trunk/Makefile (original)
+++ geninitrd/trunk/Makefile Sat Dec 3 20:52:49 2011
@@ -3,23 +3,28 @@
MODS := ide luks multipath dmraid lvm md blkid udev tuxonice suspend fbsplash condecor bootsplash uvesafb nfs sata scsi usbkbd
FILES_MODS := $(MODS:%=mod-%.sh)
FILES_ADDON := extract-ikconfig
+FILES_UDEV := 01-ignore.rules 59-persistent-storage.rules 61-persistent-storage.rules 11-dm.rules
FILES := Makefile geninitrd.sysconfig geninitrd functions $(FILES_MODS) $(FILES_ADDON) geninitrd.8 geninitrd.8.xml ChangeLog
prefix := /usr
mandir := $(prefix)/share/man
sbindir := /sbin
libdir := /lib/geninitrd
+udevdir := $(libdir)/udev-rules
sysconfigdir := /etc/sysconfig
all: geninitrd.8
install: geninitrd.8
- install -d $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 $(DESTDIR)$(libdir) $(DESTDIR)$(sysconfigdir)
+ install -d $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 $(DESTDIR)$(libdir) $(DESTDIR)$(sysconfigdir) $(DESTDIR)$(udevdir)
install -p geninitrd $(DESTDIR)$(sbindir)/geninitrd
install -p -m644 geninitrd.8 $(DESTDIR)$(mandir)/man8/geninitrd.8
install -p -m644 functions $(DESTDIR)$(libdir)/functions
install -p -m644 $(FILES_MODS) $(DESTDIR)$(libdir)
install -p -m755 $(FILES_ADDON) $(DESTDIR)$(libdir)
install -p -m644 geninitrd.sysconfig $(DESTDIR)$(sysconfigdir)/geninitrd
+ for file in ${FILES_UDEV}; do \
+ install -p -m644 udev-rules/$${file} $(DESTDIR)$(udevdir); \
+ done
rerentry2man := /usr/bin/refentry2man
geninitrd.8: geninitrd.8.xml $(refentry2man)
Modified: geninitrd/trunk/mod-udev.sh
==============================================================================
--- geninitrd/trunk/mod-udev.sh (original)
+++ geninitrd/trunk/mod-udev.sh Sat Dec 3 20:52:49 2011
@@ -14,7 +14,7 @@
inst_d "/lib/udev/rules.d"
for _rule in "$@"; do
- for d in /lib/udev/rules.d /etc/udev/rules.d /lib/geninitrd/udev/rules.d; do
+ for d in /lib/udev/rules.d /etc/udev/rules.d /lib/geninitrd/udev-rules; do
if [ -f $d/$_rule ]; then
inst $d/$_rule /lib/udev/rules.d/$_rule
fi
@@ -50,6 +50,8 @@
# standard udev rules
inst_rules 50-udev-default.rules 60-persistent-storage.rules 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
60-pcmcia.rules 50-firmware.rules 10-dm.rules 11-dm-lvm.rules 13-dm-disk.rules
+ # initrd dedicated rules
+ inst_rules 01-ignore.rules 59-persistent-storage.rules 61-persistent-storage.rules 11-dm.rules
for e in ata_id cdrom_id collect firmware scsi_id v4l_id; do
inst_exec $initrd_dir/udev/$e /lib/udev/$e
Added: geninitrd/trunk/udev-rules/01-ignore.rules
==============================================================================
--- (empty file)
+++ geninitrd/trunk/udev-rules/01-ignore.rules Sat Dec 3 20:52:49 2011
@@ -0,0 +1 @@
+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule"
Added: geninitrd/trunk/udev-rules/11-dm.rules
==============================================================================
--- (empty file)
+++ geninitrd/trunk/udev-rules/11-dm.rules Sat Dec 3 20:52:49 2011
@@ -0,0 +1,5 @@
+SUBSYSTEM!="block", GOTO="dm_end"
+KERNEL!="dm-[0-9]*", GOTO="dm_end"
+ACTION!="add|change", GOTO="dm_end"
+OPTIONS+="db_persist"
+LABEL="dm_end"
Added: geninitrd/trunk/udev-rules/59-persistent-storage.rules
==============================================================================
--- (empty file)
+++ geninitrd/trunk/udev-rules/59-persistent-storage.rules Sat Dec 3 20:52:49 2011
@@ -0,0 +1,38 @@
+SUBSYSTEM!="block", GOTO="ps_end"
+ACTION!="add|change", GOTO="ps_end"
+
+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+
+
+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end"
+
+# partitions have no md/{array_state,metadata_version}
+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state"
+
+# container devices have a metadata version of e.g. 'external:ddf' and
+# never leave state 'inactive'
+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state"
+TEST!="md/array_state", GOTO="md_end"
+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end"
+
+LABEL="md_ignore_state"
+
+IMPORT{program}="/sbin/mdadm --detail --export $tempnode"
+IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+OPTIONS+="link_priority=100"
+OPTIONS+="watch"
+LABEL="md_end"
+
+
+KERNEL!="dm-[0-9]*", GOTO="ps_end"
+ACTION=="add", GOTO="ps_end"
+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m"
+ENV{DM_NAME}!="?*", GOTO="ps_end"
+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end"
+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end"
+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end"
+IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+
+
+LABEL="ps_end"
Added: geninitrd/trunk/udev-rules/61-persistent-storage.rules
==============================================================================
--- (empty file)
+++ geninitrd/trunk/udev-rules/61-persistent-storage.rules Sat Dec 3 20:52:49 2011
@@ -0,0 +1,20 @@
+SUBSYSTEM!="block", GOTO="pss_end"
+ACTION!="add|change", GOTO="pss_end"
+
+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss"
+KERNEL=="cciss[0-9]*", GOTO="do_pss"
+KERNEL=="nbd[0-9]*", GOTO="do_pss"
+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss"
+
+GOTO="pss_end"
+
+LABEL="do_pss"
+# by-path (parent device path)
+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p"
+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
+
+# by-label/by-uuid links (filesystem metadata)
+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="pss_end"
More information about the pld-cvs-commit
mailing list