]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fips: precreate /dev/random /dev/urandom
authorHarald Hoyer <harald@redhat.com>
Wed, 18 Jan 2017 09:34:00 +0000 (10:34 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 18 Jan 2017 09:34:00 +0000 (10:34 +0100)
otherwise libgcrypt might be unhappy, if used before devtmpfs is mounted

https://bugzilla.redhat.com/show_bug.cgi?id=1401444

modules.d/01fips/module-setup.sh

index 65177a96a82c3a1a962fd5e13ccd1739711db65c..263f981bc9e443ae39056dc5e56398b680fa3a5b 100755 (executable)
@@ -46,5 +46,16 @@ install() {
 
     inst_multiple -o prelink
     inst_simple /etc/system-fips
+    [ -c ${initdir}/dev/random ] || mknod ${initdir}/dev/random c 1 8 \
+        || {
+            dfatal "Cannot create /dev/random"
+            dfatal "To create an initramfs with fips support, dracut has to run as root"
+            return 1
+        }
+    [ -c ${initdir}/dev/urandom ] || mknod ${initdir}/dev/urandom c 1 9 \
+        || {
+            dfatal "Cannot create /dev/random"
+            dfatal "To create an initramfs with fips support, dracut has to run as root"
+            return 1
+        }
 }
-