summaryrefslogtreecommitdiff
path: root/modules.d
diff options
context:
space:
mode:
authorPhilippe Seewer <philippe.seewer@bfh.ch>2009-09-17 17:16:48 +0200
committerHarald Hoyer <harald@redhat.com>2009-10-06 15:23:52 +0200
commit7a6e646c8312cd8b3b62d3d0e3d6b36707e39a77 (patch)
tree0e4e1c4c04f1925d67de7ec60f21cb93bd61afd4 /modules.d
parenta71f1b4917a0f00ffccebf8b45d54293adb8107f (diff)
downloaddracut-7a6e646c8312cd8b3b62d3d0e3d6b36707e39a77.tar.gz
dracut-7a6e646c8312cd8b3b62d3d0e3d6b36707e39a77.tar.bz2
dracut-7a6e646c8312cd8b3b62d3d0e3d6b36707e39a77.zip
Move write-ifcfg to its own module
ifcfg config style is redhat specific, this should be in its own module.
Diffstat (limited to 'modules.d')
-rwxr-xr-xmodules.d/40network/install4
-rw-r--r--modules.d/45ifcfg/check6
-rw-r--r--modules.d/45ifcfg/install2
-rw-r--r--[-rwxr-xr-x]modules.d/45ifcfg/write-ifcfg.sh (renamed from modules.d/40network/write-ifcfg.sh)8
-rwxr-xr-xmodules.d/99base/init10
5 files changed, 16 insertions, 14 deletions
diff --git a/modules.d/40network/install b/modules.d/40network/install
index ee7c8711..8421af93 100755
--- a/modules.d/40network/install
+++ b/modules.d/40network/install
@@ -11,7 +11,3 @@ inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
inst_hook cmdline 98 "$moddir/parse-bridge.sh"
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
-
-# TODO ifcfg config style is redhat specific, this should probably
-# go into its own module at one time
-inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
diff --git a/modules.d/45ifcfg/check b/modules.d/45ifcfg/check
new file mode 100644
index 00000000..0f6e457a
--- /dev/null
+++ b/modules.d/45ifcfg/check
@@ -0,0 +1,6 @@
+#!/bin/sh
+[ -f /etc/redhat-release ] || exit 1
+
+[[ $1 = -d ]] && echo network
+
+exit 255
diff --git a/modules.d/45ifcfg/install b/modules.d/45ifcfg/install
new file mode 100644
index 00000000..2d0edd0c
--- /dev/null
+++ b/modules.d/45ifcfg/install
@@ -0,0 +1,2 @@
+#!/bin/bash
+inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
diff --git a/modules.d/40network/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index 3d9b3b18..fc8965c2 100755..100644
--- a/modules.d/40network/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -50,3 +50,11 @@ for netif in $IFACES ; do
echo "NAME=$ethname" >> /tmp/ifcfg/ifcfg-$ethname
fi
done
+
+# Pass network opts
+mkdir /dev/.initramfs/
+cp /tmp/net.* /dev/.initramfs/ >/dev/null 2>&1
+mkdir -p /dev/.initramfs/state/etc/sysconfig/network-scripts/
+cp /tmp/resolv.conf /dev/.initramfs/state/etc/ >/dev/null 2>&1
+echo "files /etc/sysconfig/network-scripts" > /dev/.initramfs/rwtab
+cp -a /tmp/ifcfg/* /dev/.initramfs/state/etc/sysconfig/network-scripts/ >/dev/null 2>&1
diff --git a/modules.d/99base/init b/modules.d/99base/init
index 0f42967e..54d35ccb 100755
--- a/modules.d/99base/init
+++ b/modules.d/99base/init
@@ -236,16 +236,6 @@ if getarg init= >/dev/null ; then
unset CLINE
fi
-# Prepare network opts for passing
-if [ -e /tmp/net.ifaces ]; then
- mkdir /dev/.initramfs/
- cp /tmp/net.* /dev/.initramfs/ >/dev/null 2>&1
- mkdir -p /dev/.initramfs/state/etc/sysconfig/network-scripts/
- cp /tmp/resolv.conf /dev/.initramfs/state/etc/ >/dev/null 2>&1
- echo "files /etc/sysconfig/network-scripts" > /dev/.initramfs/rwtab
- cp -a /tmp/ifcfg/* /dev/.initramfs/state/etc/sysconfig/network-scripts/ >/dev/null 2>&1
-fi
-
# Debug: Copy state
if getarg rdcopystate; then
mkdir /dev/.initramfs/