public inbox for initramfs@vger.kernel.org
 help / color / mirror / Atom feed
* Recent network bug fixes from the latest SuSE dracut repo
@ 2016-05-12 18:03 Thomas Renninger
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k

These are network related patches to get SuSE and mainline dracut
sources closer together again.

If format, etc is ok, some more patches from other areas will follow.

I added a link to public bugzilla entries.

References like bnc# and bsc# point to restricted SLE bugzilla entries.
If these patches need discussion, I should be able to add you to the bug
or copy relevant parts to public, so this info is still needed.

Would be great to see these patches pushed into mainline git repo soon.

Thanks,

         Thomas

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 01/12] 40network: Fix race condition when wait for networks
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 02/12] 40network: always start netroot in ifup.sh Thomas Renninger
                     ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k, Hannes Reinecke

From: Pawel Wieczorkiewicz <pwieczorkiewicz-l3A5Bk7waGM@public.gmane.org>

If no network related params are specific, but rd.neednet=1 is set,
the default initqueue action is to wait until one of the network
interfaces is marked as setup properly.

This also help with initqueue's race condition when the network interface
shows upd late

References: bnc#866771

Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/40network/net-genrules.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
index 5df50bd..c964531 100755
--- a/modules.d/40network/net-genrules.sh
+++ b/modules.d/40network/net-genrules.sh
@@ -105,6 +105,9 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
         cond='ACTION=="add", SUBSYSTEM=="net"'
         # if you change the name of "91-default-net.rules", also change modules.d/80cms/cmssetup.sh
         echo "$cond, $runcmd" > /etc/udev/rules.d/91-default-net.rules
+        if [ "$NEEDNET" = "1" ]; then
+            echo "[ -f /tmp/net.*.did-setup ]" >$hookdir/initqueue/finished/wait-network.sh
+        fi
     fi
 
 # if you change the name of "90-net.rules", also change modules.d/80cms/cmssetup.sh
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 02/12] 40network: always start netroot in ifup.sh
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
  2016-05-12 18:03   ` [PATCH 01/12] 40network: Fix race condition when wait for networks Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 03/12] 40network: Only enable network interfaces if explicitly requested Thomas Renninger
                     ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k, Hannes Reinecke

From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>

It's totally irrelevant how the network is configured when
trying to setup netroot. It only matters if it could be
configured at all.
So change the logic the check for correct network setup
and then start netroot.

References: bnc#881235

Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/40network/ifup.sh | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index 1185523..3234c56 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -388,19 +388,11 @@ for p in $(getargs ip=); do
             > /tmp/net.$(cat /sys/class/net/${netif}/address).up
         fi
 
-        case $autoconf in
-            dhcp|on|any|dhcp6)
-            ;;
-            *)
-                if [ $ret -eq 0 ]; then
-                    setup_net $netif
-                    source_hook initqueue/online $netif
-                    if [ -z "$manualup" ]; then
-                        /sbin/netroot $netif
-                    fi
-                fi
-                ;;
-        esac
+        setup_net $netif
+        source_hook initqueue/online $netif
+        if [ -z "$manualup" ]; then
+            /sbin/netroot $netif
+        fi
         exit $ret
     fi
 done
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 03/12] 40network: Only enable network interfaces if explicitly requested
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
  2016-05-12 18:03   ` [PATCH 01/12] 40network: Fix race condition when wait for networks Thomas Renninger
  2016-05-12 18:03   ` [PATCH 02/12] 40network: always start netroot in ifup.sh Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 04/12] 40network: Update iBFT scanning code to handle IPv6 Thomas Renninger
                     ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k

From: Pawel Wieczorkiewicz <pwieczorkiewicz-l3A5Bk7waGM@public.gmane.org>

Currently all available network interfaces are started whenever
40network is pulled in. This causes massive delays during bootup.
This patch modifies the behaviour to start interfaces only if
rd.neednet is specified.

References: bnc#879038

Signed-off-by: Pawel Wieczorkiewicz <pwieczorkiewicz-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/40network/net-genrules.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
index c964531..acaee7c 100755
--- a/modules.d/40network/net-genrules.sh
+++ b/modules.d/40network/net-genrules.sh
@@ -104,8 +104,8 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
     else
         cond='ACTION=="add", SUBSYSTEM=="net"'
         # if you change the name of "91-default-net.rules", also change modules.d/80cms/cmssetup.sh
-        echo "$cond, $runcmd" > /etc/udev/rules.d/91-default-net.rules
         if [ "$NEEDNET" = "1" ]; then
+            echo "$cond, $runcmd" > /etc/udev/rules.d/91-default-net.rules
             echo "[ -f /tmp/net.*.did-setup ]" >$hookdir/initqueue/finished/wait-network.sh
         fi
     fi
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 04/12] 40network: Update iBFT scanning code to handle IPv6
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 03/12] 40network: Only enable network interfaces if explicitly requested Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 05/12] 40network: separate 'mask' and 'prefix' Thomas Renninger
                     ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k, Hannes Reinecke

From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>

IPv6 addresses should be specified in brackets so that the
ip= scanning code doesn't get confused.

References: bnc#887542

Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/40network/net-lib.sh | 48 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 43 insertions(+), 5 deletions(-)

diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index 31f1a56..c372665 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -241,23 +241,54 @@ ibft_to_cmdline() {
 
             [ -e /tmp/net.${dev}.has_ibft_config ] && continue
 
+            [ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a)
+            # Skip invalid interfaces
+            (( $flags & 1 )) || continue
+            # Skip interfaces not used for booting
+            (( $flags & 2 )) || continue
             [ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
-
-            if [ -n "$dhcp" ]; then
-                echo "ip=$dev:dhcp"
+            [ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a)
+            [ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
+
+            if [ -n "$ip" ] ; then
+                case "$ip" in
+                    *.*.*.*)
+                        family=ipv4
+                        ;;
+                    *:*)
+                        family=ipv6
+                        ;;
+                esac
+            fi
+            if [ -n "$dhcp" ] || [ "$origin" -eq 3 ]; then
+                if [ "$family" = "ipv6" ] ; then
+                    echo "ip=$dev:dhcp6"
+                else
+                    echo "ip=$dev:dhcp"
+                fi
             elif [ -e ${iface}/ip-addr ]; then
-                [ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
                 # skip not assigned ip adresses
                 [ "$ip" = "0.0.0.0" ] && continue
                 [ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
                 [ "$gateway" = "0.0.0.0" ] && unset $gateway
                 [ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
+                [ -e ${iface}/prefix-len ] && prefix=$(read a < ${iface}/prefix-len; echo $a)
                 [ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a)
                 [ "$dns1" = "0.0.0.0" ] && unset $dns1
                 [ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a)
                 [ "$dns2" = "0.0.0.0" ] && unset $dns2
                 [ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
-                if [ -n "$ip" ] && [ -n "$mask" ]; then
+                if [ "$family" = "ipv6" ] ; then
+                    if [ -n "$ip" ] ; then
+                        [ -n "$prefix" ] || prefix=64
+                        ip="[${ip}/${prefix}]"
+                        mask=
+                    fi
+                    if [ -n "$gw" ] ; then
+                        gw="[${gw}]"
+                    fi
+                fi
+                if [ -n "$ip" ] && [ -n "$mask" -o -n "$prefix" ]; then
                     echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}"
                 else
                     warn "${iface} does not contain a valid iBFT configuration"
@@ -439,6 +470,13 @@ ip_to_var() {
             esac
             ;;
     esac
+    # Extract prefix length from CIDR notation
+    case $ip in
+        */*)
+            mask=${ip##*/}
+            ip=${ip%/*}
+            ;;
+    esac
 
     # ip=<ipv4-address> means anaconda-style static config argument cluster:
     # ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu>
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 05/12] 40network: separate 'mask' and 'prefix'
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 04/12] 40network: Update iBFT scanning code to handle IPv6 Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 06/12] network/iscsi: Skip invalid ibft dhcp address Thomas Renninger
                     ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k, Hannes Reinecke

From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>

The 'mask' parameter is used for both, the (IPv4) netmask and
the prefix length. As both are in different format separate them
out into 'mask' for the netmask and 'prefix' for the prefix length.
And also prefer the use of 'prefix' where possible to ease
calculation and better IPv6 support.

References: bnc#887542

Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/40network/ifup.sh          | 17 +++++++++++----
 modules.d/40network/net-lib.sh       | 42 +++++++++++++++++++++++++++++++++---
 modules.d/40network/parse-ip-opts.sh |  2 +-
 3 files changed, 53 insertions(+), 8 deletions(-)

diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index 3234c56..4ab597f 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -105,17 +105,26 @@ do_static() {
 
     [ -n "$macaddr" ] && ip link set address $macaddr dev $netif
     [ -n "$mtu" ] && ip link set mtu $mtu dev $netif
-    if strglobin $ip '*:*:*'; then
+    [ -n "$mask" -a -z "$prefix" ] && prefix=$(mask_to_prefix $mask)
+    if [ "${ip##*/}" != "${ip}" ] ; then
+        prefix="${ip##*/}"
+        ip="${ip%/*}"
+    fi
+if strglobin $ip '*:*:*'; then
+        # Always assume /64 prefix for IPv6
+        [ -z "$prefix" ] && prefix=64
         # note no ip addr flush for ipv6
-        ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
+        ip addr add $ip/$prefix ${srv:+peer $srv} dev $netif
         wait_for_ipv6_dad $netif
     else
         if ! arping -f -q -D -c 2 -I $netif $ip; then
             warn "Duplicate address detected for $ip for interface $netif."
             return 1
         fi
+        # Assume /24 prefix for IPv4
+        [ -z "$prefix" ] && prefix=24
         ip addr flush dev $netif
-        ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
+        ip addr add $ip/$prefix ${srv:+peer $srv} brd + dev $netif
     fi
 
     [ -n "$gw" ] && echo ip route replace default via $gw dev $netif > /tmp/net.$netif.gw
@@ -362,7 +371,7 @@ for p in $(getargs ip=); do
     done
 
     # Store config for later use
-    for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do
+    for i in ip srv gw mask prefix hostname macaddr mtu dns1 dns2; do
         eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
     done > /tmp/net.$netif.override
 
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index c372665..322d5b5 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -20,6 +20,35 @@ get_ip() {
     echo $ip
 }
 
+mask_to_prefix() {
+    local mask="$1"
+    local prefix=0
+    local OLDIFS="$IFS"
+
+    IFS=:
+    set -- $mask
+    IFS="$OLDIFS"
+    for mask in $@ ; do
+        if [ "$mask" -eq 255 ] ; then
+            prefix=$(($prefix + 8))
+        elif [ "$mask" -eq 254 ] ; then
+            prefix=$(($prefix + 7))
+        elif [ "$mask" -eq 252 ] ; then
+            prefix=$(($prefix + 6))
+        elif [ "$mask" -eq 248 ] ; then
+            prefix=$(($prefix + 5))
+        elif [ "$mask" -eq 240 ] ; then
+            prefix=$(($prefix + 4))
+        elif [ "$mask" -eq 224 ] ; then
+            prefix=$(($prefix + 3))
+        elif [ "$mask" -eq 192 ] ; then
+            prefix=$(($prefix + 2))
+        elif [ "$mask" -eq 128 ] ; then
+            prefix=$(($prefix + 1))
+        fi
+    done
+}
+
 iface_for_remote_addr() {
     set -- $(ip -o route get to $1)
     echo $5
@@ -232,7 +261,7 @@ ibft_to_cmdline() {
         for iface in /sys/firmware/ibft/ethernet*; do
             local mac="" dev=""
             local dhcp="" ip="" gw="" mask="" hostname=""
-            local dns1 dns2
+            local dns1 dns2 prefix
 
             [ -e ${iface}/mac ] || continue
             mac=$(read a < ${iface}/mac; echo $a)
@@ -280,6 +309,7 @@ ibft_to_cmdline() {
                 [ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
                 if [ "$family" = "ipv6" ] ; then
                     if [ -n "$ip" ] ; then
+                        # Prefix defaults to 64 for IPv6
                         [ -n "$prefix" ] || prefix=64
                         ip="[${ip}/${prefix}]"
                         mask=
@@ -287,6 +317,11 @@ ibft_to_cmdline() {
                     if [ -n "$gw" ] ; then
                         gw="[${gw}]"
                     fi
+                else
+                    if [ -n "$prefix" ] ; then
+                        ip="$ip/$prefix"
+                        mask=
+                    fi
                 fi
                 if [ -n "$ip" ] && [ -n "$mask" -o -n "$prefix" ]; then
                     echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}"
@@ -295,6 +330,7 @@ ibft_to_cmdline() {
                     warn "ip-addr=$ip"
                     warn "gateway=$gw"
                     warn "subnet-mask=$mask"
+                    warn "prefix-len=$prefix"
                     warn "hostname=$hostname"
                 fi
             else
@@ -442,7 +478,7 @@ ip_to_var() {
         fi
     done
 
-    unset ip srv gw mask hostname dev autoconf macaddr mtu dns1 dns2
+    unset ip srv gw mask prefix hostname dev autoconf macaddr mtu dns1 dns2
     case $# in
         0)  autoconf="error" ;;
         1)  autoconf=$1 ;;
@@ -473,7 +509,7 @@ ip_to_var() {
     # Extract prefix length from CIDR notation
     case $ip in
         */*)
-            mask=${ip##*/}
+            prefix=${ip##*/}
             ip=${ip%/*}
             ;;
     esac
diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh
index 5779ef8..75ad0a4 100755
--- a/modules.d/40network/parse-ip-opts.sh
+++ b/modules.d/40network/parse-ip-opts.sh
@@ -72,7 +72,7 @@ for p in $(getargs ip=); do
             none|off)
                 [ -z "$ip" ] && \
                     die "For argument 'ip=$p'\nValue '$autoopt' without static configuration does not make sense"
-                [ -z "$mask" ] && \
+                [ -z "$mask" -a -z "$prefix" ] && \
                     die "Sorry, automatic calculation of netmask is not yet supported"
                 ;;
             auto6);;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 06/12] network/iscsi: Skip invalid ibft dhcp address
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (4 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 05/12] 40network: separate 'mask' and 'prefix' Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 07/12] nfs: Fix nfs rootfs in case of mounting via IPv4 not hostname Thomas Renninger
                     ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k

From: Thomas Blume <thomas.blume-IBi9RG/b67k@public.gmane.org>

bsc#953361

CC: Hannes Reinecke <hare-IBi9RG/b67k@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/40network/net-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index 322d5b5..61aa2a9 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -289,7 +289,7 @@ ibft_to_cmdline() {
                         ;;
                 esac
             fi
-            if [ -n "$dhcp" ] || [ "$origin" -eq 3 ]; then
+            if [ -n "$dhcp" -a "$dhcp" != "0.0.0.0" ] || [ -z "$dhcp" -a "$origin" -eq 3 ]; then
                 if [ "$family" = "ipv6" ] ; then
                     echo "ip=$dev:dhcp6"
                 else
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 07/12] nfs: Fix nfs rootfs in case of mounting via IPv4 not hostname
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (5 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 06/12] network/iscsi: Skip invalid ibft dhcp address Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 08/12] NFS: Support host being a DNS ALIAS Thomas Renninger
                     ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k

https://bugzilla.suse.com/show_bug.cgi?id=931307
Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/95nfs/module-setup.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index 9767e57..c8dfa94 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -51,9 +51,9 @@ cmdline() {
 
     ### ip= ###
     if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then
-        nfs_address="$nfs_device"
+        nfs_address="${nfs_device%%:*}"
     else
-        lookup=$(host $(echo ${nfs_device%%:*})| head -n1)
+        lookup=$(host "${nfs_device%%:*}"| head -n1)
         nfs_address=${lookup##* }
     fi
     ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 08/12] NFS: Support host being a DNS ALIAS
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (6 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 07/12] nfs: Fix nfs rootfs in case of mounting via IPv4 not hostname Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 09/12] kernel-network-modules: Don't include qemu network modules without reason Thomas Renninger
                     ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k

From: Fabian Vogt <fvogt-IBi9RG/b67k@public.gmane.org>

The "host" command may also print something else than
"asdf.local.lan has address 1.2.3.4", like:
"rootserver.local.net is an alias for rainbow.local.net.".
So "head -n1" is not enough.

https://bugzilla.suse.com/show_bug.cgi?id=955592
Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/95nfs/module-setup.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index c8dfa94..ed62b05 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -53,7 +53,7 @@ cmdline() {
     if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then
         nfs_address="${nfs_device%%:*}"
     else
-        lookup=$(host "${nfs_device%%:*}"| head -n1)
+        lookup=$(host "${nfs_device%%:*}"| grep " address " | head -n1)
         nfs_address=${lookup##* }
     fi
     ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 09/12] kernel-network-modules: Don't include qemu network modules without reason
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (7 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 08/12] NFS: Support host being a DNS ALIAS Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 10/12] fcoe-uefi: Add check for usage Thomas Renninger
                     ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k

From: Fabian Vogt <fvogt-IBi9RG/b67k@public.gmane.org>

virtio-net without other network tools does not make sense
and causes various bugs, like:
https://bugzilla.suse.com/show_bug.cgi?id=960669
This patch merges 90qemu-net into 90-kernel-network-modules.

Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/90kernel-network-modules/module-setup.sh | 25 ++++++++++++++++++++
 modules.d/90qemu-net/module-setup.sh               | 27 ----------------------
 2 files changed, 25 insertions(+), 27 deletions(-)
 delete mode 100755 modules.d/90qemu-net/module-setup.sh

diff --git a/modules.d/90kernel-network-modules/module-setup.sh b/modules.d/90kernel-network-modules/module-setup.sh
index 11fbab9..b2c3547 100755
--- a/modules.d/90kernel-network-modules/module-setup.sh
+++ b/modules.d/90kernel-network-modules/module-setup.sh
@@ -10,6 +10,25 @@ depends() {
     return 0
 }
 
+running_in_qemu() {
+    if type -P systemd-detect-virt >/dev/null 2>&1; then
+        vm=$(systemd-detect-virt --vm 2>&1)
+        (($? != 0)) && return 255
+        [[ $vm = "qemu" ]] && return 0
+        [[ $vm = "kvm" ]] && return 0
+        [[ $vm = "bochs" ]] && return 0
+    fi
+
+    for i in /sys/class/dmi/id/*_vendor; do
+        [[ -f $i ]] || continue
+        read vendor < $i
+        [[  "$vendor" == "QEMU" ]] && return 0
+        [[  "$vendor" == "Bochs" ]] && return 0
+    done
+
+    return 255
+}
+
 # called by dracut
 installkernel() {
     # Include wired net drivers, excluding wireless
@@ -30,6 +49,12 @@ installkernel() {
         =drivers/net/ethernet \
         ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net
     hostonly="" instmods iscsi_ibft crc32c iscsi_boot_sysfs
+
+    if running_in_qemu; then
+        hostonly='' instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci
+    else
+        return 0
+    fi
 }
 
 # called by dracut
diff --git a/modules.d/90qemu-net/module-setup.sh b/modules.d/90qemu-net/module-setup.sh
deleted file mode 100755
index 58f1233..0000000
--- a/modules.d/90qemu-net/module-setup.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# called by dracut
-check() {
-    if type -P systemd-detect-virt >/dev/null 2>&1; then
-        vm=$(systemd-detect-virt --vm >/dev/null 2>&1)
-        (($? != 0)) && return 255
-        [[ $vm = "qemu" ]] && return 0
-        [[ $vm = "kvm" ]] && return 0
-        [[ $vm = "bochs" ]] && return 0
-    fi
-
-    for i in /sys/class/dmi/id/*_vendor; do
-        [[ -f $i ]] || continue
-        read vendor < $i
-        [[  "$vendor" == "QEMU" ]] && return 0
-        [[  "$vendor" == "Bochs" ]] && return 0
-    done
-
-    return 255
-}
-
-# called by dracut
-installkernel() {
-    # qemu specific modules
-    hostonly='' instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci
-}
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 10/12] fcoe-uefi: Add check for usage
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (8 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 09/12] kernel-network-modules: Don't include qemu network modules without reason Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 11/12] mulitpath: Boot up, also without multipath.conf, it is not mandatory Thomas Renninger
                     ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k

From: Fabian Vogt <fvogt-IBi9RG/b67k@public.gmane.org>

References:
https://bugzilla.suse.com/show_bug.cgi?id=965477

fcoe-uefi gets included by default on EFI systems,
as it does not do the same check that fcoe does,
therefore needlessly pulling in network modules.
This patch copies the check from fcoe to fcoe-uefi.

Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/95fcoe-uefi/module-setup.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules.d/95fcoe-uefi/module-setup.sh b/modules.d/95fcoe-uefi/module-setup.sh
index 5d8477c..66af804 100755
--- a/modules.d/95fcoe-uefi/module-setup.sh
+++ b/modules.d/95fcoe-uefi/module-setup.sh
@@ -4,6 +4,11 @@
 check() {
     [[ $hostonly ]] || [[ $mount_needs ]] && {
         [ -d /sys/firmware/efi ] || return 255
+        for c in /sys/bus/fcoe/devices/ctlr_* ; do
+            [ -L $c ] || continue
+            fcoe_ctlr=$c
+        done
+        [ -z "$fcoe_ctlr" ] && return 255
     }
     require_binaries dcbtool fipvlan lldpad ip readlink || return 1
     return 0
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 11/12] mulitpath: Boot up, also without multipath.conf, it is not mandatory
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (9 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 10/12] fcoe-uefi: Add check for usage Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-12 18:03   ` [PATCH 12/12] multipath: Fix warning about multipath if not needed Thomas Renninger
  2016-05-18  9:22   ` Recent network bug fixes from the latest SuSE dracut repo Harald Hoyer
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k, Hannes Reinecke

From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>

If rootfs is on multipath, but platform does not have an /etc/multipath.conf
file which is not urgently needed, they system will not boot, due to:

multipathd is not started and rootfs and swap are not found:
systemctl status multipathd.service
* multipathd.service - Device-Mapper Multipath Device Controller
   Loaded: loaded (/usr/lib/systemd/system/multipathd.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
Condition: start condition failed at Thu 2015-05-07 11:49:11 CEST; 7min ago
           ConditionPathExists=/etc/multipath.conf was not met


and exit to dracut shell.

Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/90multipath/multipathd.service | 1 -
 1 file changed, 1 deletion(-)

diff --git a/modules.d/90multipath/multipathd.service b/modules.d/90multipath/multipathd.service
index b64b02c..f7bc65f 100644
--- a/modules.d/90multipath/multipathd.service
+++ b/modules.d/90multipath/multipathd.service
@@ -6,7 +6,6 @@ Conflicts=shutdown.target
 ConditionKernelCommandLine=!nompath
 ConditionKernelCommandLine=!rd.multipath=0
 ConditionKernelCommandLine=!rd_NO_MULTIPATH
-ConditionPathExists=/etc/multipath.conf
 
 [Service]
 Type=simple
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 12/12] multipath: Fix warning about multipath if not needed
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (10 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 11/12] mulitpath: Boot up, also without multipath.conf, it is not mandatory Thomas Renninger
@ 2016-05-12 18:03   ` Thomas Renninger
  2016-05-18  9:22   ` Recent network bug fixes from the latest SuSE dracut repo Harald Hoyer
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Renninger @ 2016-05-12 18:03 UTC (permalink / raw)
  To: harald-H+wXaHxf7aLQT0dZR+AlfA
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k,
	trenn-IBi9RG/b67k

From: Fabian Vogt <fvogt-IBi9RG/b67k@public.gmane.org>

Although no device uses multipath, the module checks
for presence of the multipath binary first, printing a
warning if not present. This patch fixes the wrong ordering.

Signed-off-by: Thomas Renninger <trenn-IBi9RG/b67k@public.gmane.org>
---
 modules.d/90multipath/module-setup.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 1676798..db91296 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -21,13 +21,14 @@ majmin_to_mpath_dev() {
 # called by dracut
 check() {
     local _rootdev
-    # if there's no multipath binary, no go.
-    require_binaries multipath || return 1
 
     [[ $hostonly ]] || [[ $mount_needs ]] && {
         for_each_host_dev_and_slaves is_mpath || return 255
     }
 
+    # if there's no multipath binary, no go.
+    require_binaries multipath || return 1
+
     return 0
 }
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: Recent network bug fixes from the latest SuSE dracut repo
       [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
                     ` (11 preceding siblings ...)
  2016-05-12 18:03   ` [PATCH 12/12] multipath: Fix warning about multipath if not needed Thomas Renninger
@ 2016-05-18  9:22   ` Harald Hoyer
  12 siblings, 0 replies; 14+ messages in thread
From: Harald Hoyer @ 2016-05-18  9:22 UTC (permalink / raw)
  To: Thomas Renninger
  Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, thomas.blume-IBi9RG/b67k,
	pwieczorkiewicz-l3A5Bk7waGM, hare-IBi9RG/b67k, fvogt-IBi9RG/b67k

On 12.05.2016 20:03, Thomas Renninger wrote:
> These are network related patches to get SuSE and mainline dracut
> sources closer together again.
>
> If format, etc is ok, some more patches from other areas will follow.
>
> I added a link to public bugzilla entries.
>
> References like bnc# and bsc# point to restricted SLE bugzilla entries.
> If these patches need discussion, I should be able to add you to the bug
> or copy relevant parts to public, so this info is still needed.
>
> Would be great to see these patches pushed into mainline git repo soon.
>
> Thanks,
>
>          Thomas
>

Thanks! Will review the next days.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-05-18  9:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-12 18:03 Recent network bug fixes from the latest SuSE dracut repo Thomas Renninger
     [not found] ` <1463076216-410-1-git-send-email-trenn-IBi9RG/b67k@public.gmane.org>
2016-05-12 18:03   ` [PATCH 01/12] 40network: Fix race condition when wait for networks Thomas Renninger
2016-05-12 18:03   ` [PATCH 02/12] 40network: always start netroot in ifup.sh Thomas Renninger
2016-05-12 18:03   ` [PATCH 03/12] 40network: Only enable network interfaces if explicitly requested Thomas Renninger
2016-05-12 18:03   ` [PATCH 04/12] 40network: Update iBFT scanning code to handle IPv6 Thomas Renninger
2016-05-12 18:03   ` [PATCH 05/12] 40network: separate 'mask' and 'prefix' Thomas Renninger
2016-05-12 18:03   ` [PATCH 06/12] network/iscsi: Skip invalid ibft dhcp address Thomas Renninger
2016-05-12 18:03   ` [PATCH 07/12] nfs: Fix nfs rootfs in case of mounting via IPv4 not hostname Thomas Renninger
2016-05-12 18:03   ` [PATCH 08/12] NFS: Support host being a DNS ALIAS Thomas Renninger
2016-05-12 18:03   ` [PATCH 09/12] kernel-network-modules: Don't include qemu network modules without reason Thomas Renninger
2016-05-12 18:03   ` [PATCH 10/12] fcoe-uefi: Add check for usage Thomas Renninger
2016-05-12 18:03   ` [PATCH 11/12] mulitpath: Boot up, also without multipath.conf, it is not mandatory Thomas Renninger
2016-05-12 18:03   ` [PATCH 12/12] multipath: Fix warning about multipath if not needed Thomas Renninger
2016-05-18  9:22   ` Recent network bug fixes from the latest SuSE dracut repo Harald Hoyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox