summaryrefslogtreecommitdiff
path: root/modules.d
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2012-08-23 14:59:35 -0400
committerHarald Hoyer <harald@redhat.com>2013-06-13 14:07:17 +0200
commitd8a698713e8d9b5763cbf8417860f0b7d8558aaa (patch)
tree0973ee0fda418be7a297f9ce36446237bd3fedcf /modules.d
parent57f257928116a8e614bb1933a9f8fbf9d9c39c52 (diff)
downloaddracut-d8a698713e8d9b5763cbf8417860f0b7d8558aaa.tar.gz
dracut-d8a698713e8d9b5763cbf8417860f0b7d8558aaa.tar.bz2
dracut-d8a698713e8d9b5763cbf8417860f0b7d8558aaa.zip
Don't explode when mixing BOOTIF and ip=
Now that we can use a MAC as a device identifier, we can just bring up the device specified by BOOTIF as a normal interface. So instead of ignoring everything but BOOTIF, we'll put BOOTIF in the IFACES list and bring it up as normal, defaulting to DHCP if nothing else is specified. We can also handle anaconda-style 'ksdevice=bootif' this way.
Diffstat (limited to 'modules.d')
-rw-r--r--modules.d/40network/net-lib.sh12
-rwxr-xr-xmodules.d/40network/parse-ip-opts.sh12
2 files changed, 14 insertions, 10 deletions
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index 056fbc92..41610216 100644
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -294,7 +294,10 @@ ip_to_var() {
fi
;;
esac
- # anaconda-style argument cluster
+
+ # ip=<ipv4-address> means anaconda-style static config argument cluster:
+ # ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu>
+ # ksdevice={link|bootif|ibft|<MAC>|<ifname>}
if strstr "$autoconf" "*.*.*.*"; then
ip="$autoconf"
gw=$(getarg gateway=)
@@ -303,9 +306,12 @@ ip_to_var() {
dev=$(getarg ksdevice=)
autoconf="none"
mtu=$(getarg mtu=)
+
+ # handle special values for ksdevice
case "$dev" in
- # ignore fancy values for ksdevice=XXX
- link|bootif|BOOTIF|ibft|*:*:*:*:*:*) dev="" ;;
+ bootif|BOOTIF) dev=$(fix_bootif $(getarg BOOTIF=)) ;;
+ link) dev="" ;; # FIXME: do something useful with this
+ ibft) dev="" ;; # ignore - ibft is handled elsewhere
esac
fi
}
diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh
index f64c9367..bdd71db7 100755
--- a/modules.d/40network/parse-ip-opts.sh
+++ b/modules.d/40network/parse-ip-opts.sh
@@ -17,13 +17,6 @@
command -v getarg >/dev/null || . /lib/dracut-lib.sh
command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh
-# Don't mix BOOTIF=macaddr from pxelinux and ip= lines
-getarg ip= >/dev/null && getarg BOOTIF= >/dev/null && \
- die "Mixing BOOTIF and ip= lines is dangerous"
-
-# No more parsing stuff, BOOTIF says everything
-[ -n "$(getarg BOOTIF)" ] && return
-
if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] ; then
# No ip= argument(s) for netroot provided, defaulting to DHCP
return;
@@ -118,6 +111,11 @@ for p in $(getargs ip=); do
done
+# put BOOTIF in IFACES to make sure it comes up
+if BOOTIF="$(getarg BOOTIF=)"; then
+ IFACES="$IFACES $(fix_bootif $BOOTIF)"
+fi
+
# This ensures that BOOTDEV is always first in IFACES
if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ] ; then
IFACES="${IFACES%$BOOTDEV*} ${IFACES#*$BOOTDEV}"