Merge "Add dracut-network element."

This commit is contained in:
Jenkins 2013-06-10 22:07:09 +00:00 committed by Gerrit Code Review
commit 8c847b75c9
6 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1 @@
Extends dracut and build an initramfs with network support.

View File

@ -0,0 +1,20 @@
--- usr/lib/dracut/hooks/pre-pivot/85-write-ifcfg.sh 2013-05-30 14:01:37.492519066 +0000
+++ /85-write-ifcfg.sh 2013-05-30 14:03:09.832519065 +0000
@@ -4,6 +4,9 @@
# NFS root might have reached here before /tmp/net.ifaces was written
udevadm settle --timeout=30
+
+command -v ip_to_var >/dev/null || . /lib/net-lib.sh
+
# Don't write anything if we don't know our bootdev
[ -f /tmp/net.ifaces ] || return 1
@@ -98,6 +101,7 @@
fi
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
{
+ ip_to_var $ip
echo "# Generated by dracut initrd"
echo "DEVICE=$netif"
echo "ONBOOT=yes"

View File

@ -0,0 +1,6 @@
#!/bin/bash
LAST_VERSION=$(basename `ls -1 /boot/vmlinuz* | tail -1 | sed 's/vmlinuz-//g'`)
INITRAMFS=`ls /boot/initramfs-$LAST_VERSION.img`
dracut --force --add "network" $INITRAMFS $LAST_VERSION

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -e
install-packages dracut-network

View File

@ -0,0 +1,6 @@
#!/bin/sh
# If the patch doesn't apply just do nothing. This patch fix a small
# issue in the script that writes the network configuration files from
# the cmdline to the disk on FC18.
patch /usr/lib/dracut/modules.d/45ifcfg/write-ifcfg.sh < $(dirname $0)/../dracut-write-ifcfg.patch || true

View File

@ -1 +1,2 @@
dib-run-parts
dracut-network