Accepting request 251839 from Base:System

1

OBS-URL: https://build.opensuse.org/request/show/251839
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dracut?expand=0&rev=61
This commit is contained in:
Stephan Kulow 2014-10-01 09:21:57 +00:00 committed by Git OBS Bridge
commit 456d525e23
6 changed files with 208 additions and 2 deletions

View File

@ -3,7 +3,7 @@ From: Thomas Renninger <trenn@suse.de>
Date: Fri, 19 Sep 2014 15:34:54 +0200
Subject: network: Try to load xennet
bnc#896464
bnc#896464, bnc#896259
Signed-off-by: Thomas Renninger <trenn@suse.de>
---

View File

@ -0,0 +1,74 @@
From 25e7640c04a687f7bbd3ac2416ea2f1fef122c48 Mon Sep 17 00:00:00 2001
From: Thomas Renninger <trenn@suse.de>
Date: Wed, 24 Sep 2014 17:23:32 +0200
Subject: nfs: Add ip=... and root=nfs... parameters to internal dracut
cmdline
If the rootfs is an nfs mount, also know as nfsroot, add the correct
parameter to the dracut cmdline.
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
modules.d/95nfs/module-setup.sh | 39 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index c126efc..b6ddb21 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -31,14 +31,51 @@ installkernel() {
hostonly='' instmods nfs sunrpc ipv6 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files lockd rpcsec_gss_krb5 auth_rpcgss
}
+cmdline() {
+ local nfs_device
+ local nfs_options
+ local nfs_root
+ local nfs_address
+ local lookup
+ local ifname
+
+ ### nfsroot= ###
+ nfs_device=$(findmnt -t nfs4 -n -o SOURCE /)
+ if [ -n "$nfs_device" ];then
+ nfs_root="root=nfs4:$nfs_device"
+ else
+ nfs_device=$(findmnt -t nfs -n -o SOURCE /)
+ [ -z "$nfs_device" ] && return
+ nfs_root="root=nfs:$nfs_device"
+ fi
+ nfs_options=$(findmnt -t nfs4,nfs -n -o OPTIONS /)
+ [ -n "$nfs_options" ] && nfs_root="$nfs_root:$nfs_options"
+ echo "$nfs_root"
+
+ ### ip= ###
+ if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then
+ nfs_address="$nfs_device"
+ else
+ lookup=$(host $(echo ${nfs_device%%:*})| head -n1)
+ nfs_address=${lookup##* }
+ fi
+ ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
+ printf 'ip=%s:static\n' ${ifname}
+}
+
# called by dracut
install() {
local _i
local _nsslibs
inst_multiple -o portmap rpcbind rpc.statd mount.nfs \
- mount.nfs4 umount rpc.idmapd sed /etc/netconfig
+ mount.nfs4 umount rpc.idmapd sed /etc/netconfig host sed
inst_multiple /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf
+ if [[ $hostonly_cmdline == "yes" ]]; then
+ local _netconf="$(cmdline)"
+ [[ $_netconf ]] && printf "%s\n" "$_netconf" >> "${initdir}/etc/cmdline.d/95nfs.conf"
+ fi
+
if [ -f /lib/modprobe.d/nfs.conf ]; then
inst_multiple /lib/modprobe.d/nfs.conf
else
--
1.7.6.1

View File

@ -0,0 +1,41 @@
From 044c4999b7791f40c27bb5f92b76f67bbd6cc18a Mon Sep 17 00:00:00 2001
From: Thomas Renninger <trenn@suse.de>
Date: Wed, 24 Sep 2014 17:35:28 +0200
Subject: Fix error message when there are no internal kernel commandline
parameters
Otherwise you could get messages like that:
Stored kernel commandline:
/usr/bin/dracut: line 1559: /var/tmp/initramfs.psHn4a/etc/cmdline.d/*.conf: No such file or directory
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
dracut.sh | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index c301138..eab56f5 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1564,10 +1564,14 @@ if ! ( echo $PARMS_TO_STORE > $initdir/lib/dracut/build-parameter.txt ); then
fi
if [[ $hostonly_cmdline ]] ; then
- dinfo "Stored kernel commandline:"
- for conf in $initdir/etc/cmdline.d/*.conf ; do
- dinfo "$(< $conf)"
- done
+ if [ -d $initdir/etc/cmdline.d ];then
+ dinfo "Stored kernel commandline:"
+ for conf in $initdir/etc/cmdline.d/*.conf ; do
+ dinfo "$(< $conf)"
+ done
+ else
+ dinfo "No dracut internal kernel commandline stored in initrd"
+ fi
fi
rm -f -- "$outfile"
dinfo "*** Creating image file ***"
--
1.7.6.1

View File

@ -0,0 +1,72 @@
From b4216546ff3254f2ca21c6b29c745e1bfd4956cc Mon Sep 17 00:00:00 2001
From: Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
Date: Wed, 24 Sep 2014 18:14:37 +0200
Subject: network: Request DHCP lease instead of getting/applying the offer
- Request ipv6 lease in proper mode: auto when auto6+dhcp6 requested
otherwise managed mode
- wait for DAD results in case of ipv6
Signed-off-by: Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
---
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() {
local dhclient=''
if [ "$1" = "-6" ] ; then
- dhclient="wickedd-dhcp6"
+ local ipv6_mode=''
+ if [ -f /tmp/net.$netif.auto6 ] ; then
+ ipv6_mode="auto"
+ else
+ ipv6_mode="managed"
+ fi
+ dhclient="wickedd-dhcp6 --test --test-mode $ipv6_mode"
else
- dhclient="wickedd-dhcp4"
+ dhclient="wickedd-dhcp4 --test"
fi
if ! iface_has_link $netif; then
@@ -198,10 +204,14 @@ do_dhcp() {
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
+<request type="lease"/>
+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() {
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
+ echo 1 > /proc/sys/net/ipv6/conf/$netif/autoconf
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

View File

@ -1,8 +1,21 @@
-------------------------------------------------------------------
Wed Sep 24 16:21:11 UTC 2014 - trenn@suse.de
- Add ip= and root=nfs.. to dracut internal cmdline to make nfsroot working
(bnc#896464)
* Add 0160-nfs-Add-ip-.-and-root-nfs.-parameters-to-internal-dr.patch
- Fix error message in case there is no internal dracut cmdline added
Simple fix
* Add 0161-Fix-error-message-when-there-are-no-internal-kernel-.patch
- Request DHCP lease instead of getting/applying the offer
No bug number, but Pawel rated this high prio. This should hit SLE12 still.
* Add 0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch
-------------------------------------------------------------------
Mon Sep 22 13:33:11 UTC 2014 - trenn@suse.de
- Try to load xennet driver in network module (if loaded).
bnc#896464
bnc#896464, bnc#896259
* Add 0159-network-Try-to-load-xennet.patch
-------------------------------------------------------------------

View File

@ -180,6 +180,9 @@ Patch156: 0156-dracut.usage.asc-Remove-distro-specific-help-from-ma.patch
Patch157: 0157-Add-boot-zipl-to-host-devs-if-it-is-a-mount-point.patch
Patch158: 0158-Add-SUSE-kernel-module-dependencies-in-etc-modprobe..patch
Patch159: 0159-network-Try-to-load-xennet.patch
Patch160: 0160-nfs-Add-ip-.-and-root-nfs.-parameters-to-internal-dr.patch
Patch161: 0161-Fix-error-message-when-there-are-no-internal-kernel-.patch
Patch162: 0162-network-Request-DHCP-lease-instead-of-getting-applyi.patch
BuildRequires: asciidoc
BuildRequires: bash
@ -382,6 +385,9 @@ and its cryptography during startup.
%patch157 -p1
%patch158 -p1
%patch159 -p1
%patch160 -p1
%patch161 -p1
%patch162 -p1
%build
%configure\