]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
base/init.sh: ignore exclamation mark for kmod static-nodes
authorHarald Hoyer <harald@redhat.com>
Mon, 1 Dec 2014 10:50:00 +0000 (11:50 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 1 Dec 2014 10:50:00 +0000 (11:50 +0100)
newer versions add an exclamation mark for the type, to mark it to be
created on boot only.

modules.d/99base/init.sh

index 3afe6d509a36d7e3ede5e6847cc1e8809dff1dc4..5f66d1fc9584a7f5b43b99ab684b469a1dbca86e 100755 (executable)
@@ -73,15 +73,16 @@ 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
+            type=${type%\!}
+            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