mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-26 07:55:28 +03:00
dracut-init.sh: Add a helper for detect device kernel modules
Use udevadm to detect the required kernel modules to load a given device. udevadm will follow the device chain, help detect all required parent device drivers as well. Signed-off-by: Kairui Song <kasong@redhat.com>
This commit is contained in:
parent
ab17cb8515
commit
cbafcd0fc7
@ -889,3 +889,8 @@ block_is_fcoe() {
|
||||
block_is_netdevice() {
|
||||
block_is_nbd "$1" || block_is_iscsi "$1" || block_is_fcoe "$1"
|
||||
}
|
||||
|
||||
# get the corresponding kernel modules of a /sys/class/*/* or/dev/* device
|
||||
get_dev_module() {
|
||||
udevadm info -a "$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user