summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dracut.spec1
-rwxr-xr-xmodules.d/01fips/check19
2 files changed, 20 insertions, 0 deletions
diff --git a/dracut.spec b/dracut.spec
index 7bf52a6..898f8fd 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -136,6 +136,7 @@ make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
sysconfdir=/etc mandir=%{_mandir} WITH_SWITCH_ROOT=0%{?with_switch_root}
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
+rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips/check
mkdir -p $RPM_BUILD_ROOT/boot/dracut
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
diff --git a/modules.d/01fips/check b/modules.d/01fips/check
new file mode 100755
index 0000000..e5cd87e
--- /dev/null
+++ b/modules.d/01fips/check
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+. $dracutfunctions
+
+for program in ip arping; do
+ which $program >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ dwarning "Could not find program \"$program\" required by network."
+ exit 1
+ fi
+done
+for program in dhclient brctl; do
+ which $program >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ dwarning "Could not find program \"$program\" it might be required by network."
+ fi
+done
+exit 255
+