From 904a76376fb91839199c3332be8deb4d5a422952 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 30 Jul 2013 16:19:03 +0200 Subject: [PATCH] base/init.sh: create static device nodes with kmod --- modules.d/99base/init.sh | 14 ++++++++++++++ modules.d/99base/module-setup.sh | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh index 34be478..0e4cac5 100755 --- a/modules.d/99base/init.sh +++ b/modules.d/99base/init.sh @@ -81,6 +81,20 @@ if ! ismounted /run; then rm -fr -- /newrun fi +if command -v kmod >/dev/null 2>/dev/null; then + kmod static-nodes --format=tmpfiles 2>/dev/null | \ + while read type file mode a a a majmin; do + case $type in + d) + mkdir -m $mode -p $file + ;; + c) + mknod -m $mode $file $type ${majmin%:*} ${majmin#*:} + ;; + esac + done +fi + trap "action_on_fail Signal caught!" 0 [ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh index 0b7c1fe..e7466df 100755 --- a/modules.d/99base/module-setup.sh +++ b/modules.d/99base/module-setup.sh @@ -14,11 +14,12 @@ depends() { install() { local _d + dracut_install mount mknod mkdir sleep chroot \ sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid inst $(command -v modprobe) /sbin/modprobe - dracut_install -o findmnt less + dracut_install -o findmnt less kmod if [ ! -e "${initdir}/bin/sh" ]; then dracut_install bash -- 2.7.4