]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network: don't use "ifup -m"
authorHarald Hoyer <harald@redhat.com>
Thu, 2 Jul 2015 09:32:08 +0000 (11:32 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 2 Jul 2015 17:47:46 +0000 (19:47 +0200)
"ifup -m" was thought to be used by humans in the emergency shell.
Using it programatically shows some other flaw in the execution logic.

Also, "ifup -m" was configuring the interface multiple times on "add"
and "change" uevent, because the "$netif.did-setup" test was not
executed.

(cherry picked from commit 7cca5efdcea4f1431331cf7663fc6fb48a365cdf)

modules.d/40network/ifup.sh
modules.d/40network/net-genrules.sh

index bd7db02c5f39e05c97a4a91bb1a00d6cdd2e7123..3cff725c4ae812a44fac81b27d5c74a4e006beae 100755 (executable)
@@ -82,9 +82,10 @@ fi
 # disable manual ifup while netroot is set for simplifying our logic
 # in netroot case we prefer netroot to bringup $netif automaticlly
 [ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
-[ -z "$netroot" ] && [ -z "$manualup" ] && exit 0
+
 if [ -n "$manualup" ]; then
     >/tmp/net.$netif.manualup
+    rm -f /tmp/net.${netif}.did-setup
 else
     [ -e /tmp/net.${netif}.did-setup ] && exit 0
     [ -e /sys/class/net/$netif/address ] && \
index 3664984fac9fa320f9a76b6fe7a1d73d59574211..750a4d7fdf26416541640a17e82d1f6225b9e265 100755 (executable)
@@ -55,7 +55,6 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
     fi
 
     ifup='/sbin/ifup $env{INTERFACE}'
-    [ -z "$netroot" ] && ifup="$ifup -m"
 
     runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""