mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-28 18:55:32 +03:00
prepare udev rules for udev >= 143
This commit is contained in:
parent
33655fc539
commit
afd826bd6c
@ -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
|
||||
|
20
modules.d/90lvm/64-lvm-vol_id.rules
Normal file
20
modules.d/90lvm/64-lvm-vol_id.rules
Normal 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"
|
@ -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"
|
||||
|
@ -1,3 +1,7 @@
|
||||
#!/bin/bash
|
||||
inst lvm
|
||||
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
|
||||
|
8
modules.d/90mdraid/65-md-incremental.rules
Normal file
8
modules.d/90mdraid/65-md-incremental.rules
Normal 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}'"
|
||||
|
@ -3,7 +3,14 @@ dracut_install mdadm
|
||||
inst /etc/passwd
|
||||
inst /etc/group
|
||||
instmods =drivers/md
|
||||
|
||||
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
|
||||
|
7
modules.d/95nbd/61-nbd-vol_id.rules
Normal file
7
modules.d/95nbd/61-nbd-vol_id.rules
Normal 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"
|
@ -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"
|
||||
|
@ -2,6 +2,12 @@
|
||||
|
||||
inst nbd-client
|
||||
inst_hook cmdline 90 "$moddir/parse-nbdroot.sh"
|
||||
|
||||
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
|
||||
|
@ -9,6 +9,10 @@ inst_rules 50-udev-default.rules 60-persistent-storage.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
|
||||
|
Loading…
Reference in New Issue
Block a user