From 3080f777f5a3dbb6e931640550d0a6a3a413fdb81fea9a85c29e937a1cfa559c Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Tue, 26 Jan 2016 16:28:00 +0000 Subject: [PATCH] Accepting request 355392 from home:favogt:branches:Base:System - Refresh and merge: 0133-Allow-multiple-configurations-per-network-interface-.patch 0145-40network-handle-ip-ifname-static-correctly.patch 0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch - Delete 0134-Remove-bootdev-warning-bnc-881112.patch: - ip=ibft got deprecated, so workaround not necessary OBS-URL: https://build.opensuse.org/request/show/355392 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=246 --- ...onfigurations-per-network-interface-.patch | 122 ++++++++---------- 0134-Remove-bootdev-warning-bnc-881112.patch | 58 --------- ...rk-handle-ip-ifname-static-correctly.patch | 35 +++-- ...DHCP-lease-instead-of-getting-applyi.patch | 37 +++--- dracut.changes | 10 ++ dracut.spec | 18 +-- 6 files changed, 103 insertions(+), 177 deletions(-) delete mode 100644 0134-Remove-bootdev-warning-bnc-881112.patch diff --git a/0133-Allow-multiple-configurations-per-network-interface-.patch b/0133-Allow-multiple-configurations-per-network-interface-.patch index a32ac01..a34ecd1 100644 --- a/0133-Allow-multiple-configurations-per-network-interface-.patch +++ b/0133-Allow-multiple-configurations-per-network-interface-.patch @@ -12,11 +12,11 @@ Signed-off-by: Julian Wolf modules.d/40network/parse-ip-opts.sh | 14 ++--- 5 files changed, 70 insertions(+), 45 deletions(-) -diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh -index 84dc530..0362287 100755 ---- a/modules.d/40network/ifup.sh -+++ b/modules.d/40network/ifup.sh -@@ -91,6 +91,7 @@ else +Index: dracut-044/modules.d/40network/ifup.sh +=================================================================== +--- dracut-044.orig/modules.d/40network/ifup.sh ++++ dracut-044/modules.d/40network/ifup.sh +@@ -90,6 +90,7 @@ else fi dhcp_apply() { @@ -24,7 +24,7 @@ index 84dc530..0362287 100755 if [ -f /tmp/leaseinfo.${netif}.dhcp.ipv${1:1:1} ]; then . /tmp/leaseinfo.${netif}.dhcp.ipv${1:1:1} else -@@ -132,24 +133,37 @@ dhcp_apply() { +@@ -131,24 +132,37 @@ dhcp_apply() { [ -n "${HOSTNAME}" ] && hostname "$HOSTNAME" # If nameserver= has not been specified, use what dhcp provides @@ -69,7 +69,7 @@ index 84dc530..0362287 100755 info "DHCP is finished successfully" return 0 } -@@ -171,9 +185,6 @@ do_dhcp() { +@@ -175,9 +189,6 @@ do_dhcp() { dhclient="wickedd-dhcp6" fi @@ -79,7 +79,7 @@ index 84dc530..0362287 100755 if ! iface_has_link $netif; then warn "No carrier detected" warn "Trying to set $netif up..." -@@ -188,7 +199,6 @@ do_dhcp() { +@@ -191,7 +202,6 @@ do_dhcp() { $dhclient --test $netif > /tmp/leaseinfo.${netif}.dhcp.ipv${1:1:1} dhcp_apply $1 || return $? @@ -87,7 +87,7 @@ index 84dc530..0362287 100755 echo $netif > /tmp/setup_net_${netif}.ok return 0 } -@@ -218,6 +228,31 @@ do_ipv6auto() { +@@ -222,6 +232,31 @@ do_ipv6auto() { # Handle static ip configuration do_static() { @@ -118,16 +118,16 @@ index 84dc530..0362287 100755 +do_static_setup() { strglobin $ip '*:*:*' && load_ipv6 - linkup $netif -@@ -237,7 +272,6 @@ do_static() { - else + if ! linkup $netif; then +@@ -258,7 +293,6 @@ if strglobin $ip '*:*:*'; then + fi # Assume /24 prefix for IPv4 [ -z "$prefix" ] && prefix=24 - ip addr flush dev $netif ip addr add $ip/$prefix ${srv:+peer $srv} brd + dev $netif fi -@@ -256,8 +290,6 @@ do_static() { +@@ -277,8 +311,6 @@ if strglobin $ip '*:*:*'; then done [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname @@ -136,7 +136,7 @@ index 84dc530..0362287 100755 } # loopback is always handled the same way -@@ -404,6 +436,14 @@ for p in $(getargs ip=); do +@@ -426,6 +458,14 @@ for p in $(getargs ip=); do ip_to_var $p # skip ibft [ "$autoconf" = "ibft" ] && continue @@ -151,7 +151,7 @@ index 84dc530..0362287 100755 case "$dev" in ??:??:??:??:??:??) # MAC address -@@ -421,29 +461,12 @@ for p in $(getargs ip=); do +@@ -443,29 +483,12 @@ for p in $(getargs ip=); do [ "$use_bridge" != 'true' ] && \ [ "$use_vlan" != 'true' ] && continue @@ -168,8 +168,8 @@ index 84dc530..0362287 100755 - fi - # setup nameserver - namesrv="$dns1 $dns2 $(getargs nameserver)" - for s in $namesrv; do + for s in "$dns1" "$dns2" $(getargs nameserver); do + [ -n "$s" ] || continue echo nameserver $s >> /tmp/net.$netif.resolv.conf done @@ -178,18 +178,19 @@ index 84dc530..0362287 100755 - eval '[ "$'$i'" ] && echo '$i'="$'$i'"' - done > /tmp/net.$netif.override - - case $autoconf in - dhcp4|dhcp|on|any) - do_dhcp -4 ;; -@@ -466,7 +489,6 @@ for p in $(getargs ip=); do + for autoopt in $(str_replace "$autoconf" "," " "); do + case $autoopt in + dhcp4|dhcp|on|any) +@@ -493,8 +516,6 @@ for p in $(getargs ip=); do + /sbin/netroot $netif fi fi - +- - exit 0 done # netif isn't the top stack? Then we should exit here. -@@ -486,4 +508,9 @@ if [ ! -e /tmp/net.${netif}.up ]; then +@@ -523,4 +544,9 @@ if [ ! -e /tmp/net.${netif}.up ]; then fi fi @@ -199,11 +200,11 @@ index 84dc530..0362287 100755 + > /tmp/net.$(cat /sys/class/net/$netif/address).did-setup +fi exit 0 -diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh -index 2fd8c6b..9d0ed20 100755 ---- a/modules.d/40network/net-genrules.sh -+++ b/modules.d/40network/net-genrules.sh -@@ -99,7 +99,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh +Index: dracut-044/modules.d/40network/net-genrules.sh +=================================================================== +--- dracut-044.orig/modules.d/40network/net-genrules.sh ++++ dracut-044/modules.d/40network/net-genrules.sh +@@ -96,7 +96,7 @@ command -v fix_bootif >/dev/null || . /l # if you change the name of "91-default-net.rules", also change modules.d/80cms/cmssetup.sh if [ "$NEEDNET" = "1" ]; then echo "$cond, $runcmd" > /etc/udev/rules.d/91-default-net.rules @@ -212,11 +213,11 @@ index 2fd8c6b..9d0ed20 100755 fi fi -diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh -index fce845a..e8d898a 100755 ---- a/modules.d/40network/net-lib.sh -+++ b/modules.d/40network/net-lib.sh -@@ -111,6 +111,7 @@ ifdown() { +Index: dracut-044/modules.d/40network/net-lib.sh +=================================================================== +--- dracut-044.orig/modules.d/40network/net-lib.sh ++++ dracut-044/modules.d/40network/net-lib.sh +@@ -130,6 +130,7 @@ ifdown() { ip addr flush dev $netif echo "#empty" > /etc/resolv.conf rm -f -- /tmp/net.$netif.did-setup @@ -224,7 +225,7 @@ index fce845a..e8d898a 100755 [ -e /sys/class/net/$netif/address ] && \ rm -f -- /tmp/net.$(cat /sys/class/net/$netif/address).did-setup # TODO: send "offline" uevent? -@@ -165,9 +166,6 @@ setup_net() { +@@ -202,9 +203,6 @@ setup_net() { fi unset layer2 @@ -234,36 +235,24 @@ index fce845a..e8d898a 100755 } save_netinfo() { -diff --git a/modules.d/40network/parse-ibft.sh b/modules.d/40network/parse-ibft.sh -index 9776c75..b81ddb1 100755 ---- a/modules.d/40network/parse-ibft.sh -+++ b/modules.d/40network/parse-ibft.sh -@@ -6,5 +6,7 @@ command -v getarg >/dev/null || . /lib/dracut-lib.sh - command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh - - # If ibft is requested, read ibft vals and write ip=XXX cmdline args --[ "ibft" = "$(getarg ip=)" ] && ibft_to_cmdline -+for i in $(getargs ip=); do -+ [ "ibft" = "$i" ] && ibft_to_cmdline && break -+done - -diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh -index 52a1923..13bc45c 100755 ---- a/modules.d/40network/parse-ip-opts.sh -+++ b/modules.d/40network/parse-ip-opts.sh -@@ -78,24 +78,22 @@ for p in $(getargs ip=); do - die "Sorry, automatic calculation of netmask is not yet supported" - ;; - auto6);; -- dhcp|dhcp6|on|any) \ -- [ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \ -- die "Sorry, 'ip=$p' does not make sense for multiple interface configurations" -- [ -n "$ip" ] && \ -- die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'" -- ;; -+ dhcp|dhcp6|on|any) ;; - *) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";; - esac +Index: dracut-044/modules.d/40network/parse-ip-opts.sh +=================================================================== +--- dracut-044.orig/modules.d/40network/parse-ip-opts.sh ++++ dracut-044/modules.d/40network/parse-ip-opts.sh +@@ -83,25 +83,23 @@ for p in $(getargs ip=); do + die "Sorry, automatic calculation of netmask is not yet supported" + ;; + auto6);; +- dhcp|dhcp6|on|any) \ +- [ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \ +- die "Sorry, 'ip=$p' does not make sense for multiple interface configurations" +- [ -n "$ip" ] && \ +- die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoopt'" +- ;; ++ dhcp|dhcp6|on|any);; + *) die "For argument 'ip=$p'\nSorry, unknown value '$autoopt'";; + esac + done + dup=0 if [ -n "$dev" ] ; then @@ -277,11 +266,8 @@ index 52a1923..13bc45c 100755 # IFACES list for later use - IFACES="$IFACES $dev" + if [ $dup -eq 0 ]; then -+ IFACES="$IFACES $dev" ++ IFACES="$IFACES $dev" + fi fi # Do we need to check for specific options? --- -1.7.6.1 - diff --git a/0134-Remove-bootdev-warning-bnc-881112.patch b/0134-Remove-bootdev-warning-bnc-881112.patch deleted file mode 100644 index 21b8d5e..0000000 --- a/0134-Remove-bootdev-warning-bnc-881112.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 819be42f7f95d8bac0fd952a6fcc95df019064c7 Mon Sep 17 00:00:00 2001 -From: Julian Wolf -Date: Tue, 12 Aug 2014 17:11:44 +0200 -Subject: Remove bootdev warning (bnc#881112) - -Signed-off-by: Julian Wolf ---- - modules.d/40network/parse-ip-opts.sh | 19 ++----------------- - 1 files changed, 2 insertions(+), 17 deletions(-) - -diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh -index 13bc45c..abd8e17 100755 ---- a/modules.d/40network/parse-ip-opts.sh -+++ b/modules.d/40network/parse-ip-opts.sh -@@ -21,23 +21,8 @@ if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] && [ -z "$(getarg BOOTIF=)" ]; th - return; - fi - --# Count ip= lines to decide whether we need bootdev= or not --if [ -z "$NEEDBOOTDEV" ] ; then -- count=0 -- for p in $(getargs ip=); do -- count=$(( $count + 1 )) -- done -- [ $count -gt 1 ] && NEEDBOOTDEV=1 --fi --unset count -- --# If needed, check if bootdev= contains anything usable - BOOTDEV=$(getarg bootdev=) - --if [ -n "$NEEDBOOTDEV" ] ; then -- [ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines" --fi -- - # Check ip= lines - # XXX Would be nice if we could errorcheck ip addresses here as well - for p in $(getargs ip=); do -@@ -46,14 +31,14 @@ for p in $(getargs ip=); do - # make first device specified the BOOTDEV - if [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then - BOOTDEV="$dev" -- [ -n "$NEEDBOOTDEV" ] && warn "Setting bootdev to '$BOOTDEV'" -+ warn "Setting bootdev to '$BOOTDEV'" - fi - - # skip ibft since we did it above - [ "$autoconf" = "ibft" ] && continue - - # We need to have an ip= line for the specified bootdev -- [ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1 -+ [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1 - - # Empty autoconf defaults to 'dhcp' - if [ -z "$autoconf" ] ; then --- -1.7.6.1 - diff --git a/0145-40network-handle-ip-ifname-static-correctly.patch b/0145-40network-handle-ip-ifname-static-correctly.patch index b791387..0cafb18 100644 --- a/0145-40network-handle-ip-ifname-static-correctly.patch +++ b/0145-40network-handle-ip-ifname-static-correctly.patch @@ -16,11 +16,11 @@ Signed-off-by: Hannes Reinecke modules.d/40network/ifup.sh | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) -diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh -index 0362287..5cd4f68 100755 ---- a/modules.d/40network/ifup.sh -+++ b/modules.d/40network/ifup.sh -@@ -178,11 +178,13 @@ do_dhcp() { +Index: dracut-044/modules.d/40network/ifup.sh +=================================================================== +--- dracut-044.orig/modules.d/40network/ifup.sh ++++ dracut-044/modules.d/40network/ifup.sh +@@ -182,11 +182,13 @@ do_dhcp() { info "Preparation for DHCP transaction" @@ -37,7 +37,7 @@ index 0362287..5cd4f68 100755 fi if ! iface_has_link $netif; then -@@ -226,33 +228,49 @@ do_ipv6auto() { +@@ -230,33 +232,49 @@ do_ipv6auto() { return 0 } @@ -93,16 +93,13 @@ index 0362287..5cd4f68 100755 +do_static() { strglobin $ip '*:*:*' && load_ipv6 - linkup $netif -@@ -475,6 +493,8 @@ for p in $(getargs ip=); do - do_dhcp -6 ;; - auto6) - do_ipv6auto ;; -+ static) -+ do_ifcfg ;; - *) - do_static ;; - esac --- -1.8.4.5 - + if ! linkup $netif; then +@@ -498,6 +516,8 @@ for p in $(getargs ip=); do + do_dhcp -6 ;; + auto6) + do_ipv6auto ;; ++ static) ++ do_ifcfg ;; + *) + do_static ;; + esac diff --git a/0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch b/0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch index 72fc3ff..a257596 100644 --- a/0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch +++ b/0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch @@ -12,11 +12,11 @@ Signed-off-by: Pawel Wieczorkiewicz modules.d/40network/ifup.sh | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) -diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh -index 5cd4f68..1ff1a4a 100755 ---- a/modules.d/40network/ifup.sh -+++ b/modules.d/40network/ifup.sh -@@ -182,9 +182,15 @@ do_dhcp() { +Index: dracut-044/modules.d/40network/ifup.sh +=================================================================== +--- dracut-044.orig/modules.d/40network/ifup.sh ++++ dracut-044/modules.d/40network/ifup.sh +@@ -186,9 +186,15 @@ do_dhcp() { local dhclient='' if [ "$1" = "-6" ] ; then @@ -34,24 +34,24 @@ index 5cd4f68..1ff1a4a 100755 fi if ! iface_has_link $netif; then -@@ -198,10 +204,14 @@ do_dhcp() { +@@ -201,10 +207,14 @@ do_dhcp() { + fi fi - echo "Starting dhcp for interface $netif" - $dhclient --test $netif > /tmp/leaseinfo.${netif}.dhcp.ipv${1:1:1} + $dhclient --test-format leaseinfo --test-output /tmp/leaseinfo.${netif}.dhcp.ipv${1:1:1} --test-request - $netif << EOF + +EOF dhcp_apply $1 || return $? + + if [ "$1" = "-6" ] ; then + wait_for_ipv6_dad $netif + fi - - echo $netif > /tmp/setup_net_${netif}.ok return 0 } -@@ -220,6 +230,7 @@ do_ipv6auto() { +@@ -224,6 +234,7 @@ do_ipv6auto() { echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects @@ -59,14 +59,11 @@ index 5cd4f68..1ff1a4a 100755 linkup $netif wait_for_ipv6_auto $netif -@@ -492,6 +503,7 @@ for p in $(getargs ip=); do - load_ipv6 - do_dhcp -6 ;; - auto6) -+ echo $netif > /tmp/net.$netif.auto6 - do_ipv6auto ;; - static) - do_ifcfg ;; --- -1.7.6.1 - +@@ -515,6 +526,7 @@ for p in $(getargs ip=); do + load_ipv6 + do_dhcp -6 ;; + auto6) ++ echo $netif > /tmp/net.$netif.auto6 + do_ipv6auto ;; + static) + do_ifcfg ;; diff --git a/dracut.changes b/dracut.changes index 2b1e12e..d86ac73 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Jan 22 13:18:33 UTC 2016 - fvogt@suse.com + +- Refresh and merge: + 0133-Allow-multiple-configurations-per-network-interface-.patch + 0145-40network-handle-ip-ifname-static-correctly.patch + 0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch +- Delete 0134-Remove-bootdev-warning-bnc-881112.patch: + - ip=ibft got deprecated, so workaround not necessary + ------------------------------------------------------------------- Thu Jan 21 11:33:47 UTC 2016 - fvogt@suse.com diff --git a/dracut.spec b/dracut.spec index 174aae1..22bbbcc 100644 --- a/dracut.spec +++ b/dracut.spec @@ -46,8 +46,11 @@ Patch124: 0124-40network-Update-iBFT-scanning-code-to-handle-IPv6.patch Patch125: 0125-40network-separate-mask-and-prefix.patch Patch131: 0131-40network-handle-prefixed-IP-addresses-correctly.patch Patch132: 0132-40network-fixup-static-network-configuration.patch +Patch133: 0133-Allow-multiple-configurations-per-network-interface-.patch Patch142: 0142-40network-Don-t-report-error-for-etc-sysconfig-netwo.patch +Patch145: 0145-40network-handle-ip-ifname-static-correctly.patch Patch159: 0159-network-Try-to-load-xennet.patch +Patch162: 0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch #S390 Patch16: 0016-Add-new-s390x-specific-rule-files.patch @@ -101,12 +104,6 @@ Patch181: 0181-no_systemd_cryptsetup.patch Patch182: 0182-fix-include-parsing.patch Patch183: 0183-fix_add_drivers_hang.patch -# Still needed -Patch133: 0133-Allow-multiple-configurations-per-network-interface-.patch -Patch134: 0134-Remove-bootdev-warning-bnc-881112.patch -Patch145: 0145-40network-handle-ip-ifname-static-correctly.patch -Patch162: 0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch - # Submit mainline asap Patch128: 0128-90lvm-Install-dm-snapshot-module.patch Patch200: 0200-dracut_fix_multipath_without_config.patch @@ -235,22 +232,19 @@ chmod a+x modules.d/91zipl/install_zipl_cmdline.sh %patch130 -p1 %patch131 -p1 %patch132 -p1 - -# Still needed! -#patch133 -p1 -#patch134 -p1 -#patch145 -p1 -#patch162 -p1 +%patch133 -p1 %patch137 -p1 %patch138 -p1 %patch142 -p1 %patch144 -p1 +%patch145 -p1 %patch150 -p1 %patch157 -p1 %patch158 -p1 %patch159 -p1 +%patch162 -p1 %patch163 -p1 %patch164 -p1 %patch168 -p1