dracut/0132-40network-fixup-static-network-configuration.patch
Thomas Renninger 233f49d9a7 Accepting request 356300 from home:favogt:branches:Base:System
Modify 0017-45ifcfg-use-distro-specific-scripts.patch:
 - Also revert upstream commit f34e1d6b to not forcibly
   include network and ifcfg modules (bsc#960669)
Refresh:
  - 0094-Implement-shortcut-ip-ifname-static-for-static-confi.patch
  - 0132-40network-fixup-static-network-configuration.patch
  - 0142-40network-Don-t-report-error-for-etc-sysconfig-netwo.patch
  - 0402-driver-fail-summary.patch
Add 0209-fix_modules_load_d_hostonly.patch:
  - Fix modules-load.d with hostonly (boo#962224)

OBS-URL: https://build.opensuse.org/request/show/356300
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=248
2016-01-27 16:45:27 +00:00

58 lines
2.2 KiB
Diff

From 6fd2c01a1cd2dcbd7d2fc3bbe6e62c7d8336bf24 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Thu, 31 Jul 2014 09:21:14 +0200
Subject: 40network: fixup static network configuration
The static network configuration was broken; the 'gateway' was
written as the complete 'ip' command line, but simply sourced
later on.
The patch fixes the gateway registration that the '.gw' file
holds entire 'ip route' command lines, which just needs to
be evaluated later on.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
modules.d/40network/ifup.sh | 13 +++++++++++++
modules.d/40network/module-setup.sh | 2 ++
modules.d/40network/net-lib.sh | 6 +++++-
3 files changed, 20 insertions(+), 1 deletion(-)
Index: dracut-044/modules.d/40network/ifup.sh
===================================================================
--- dracut-044.orig/modules.d/40network/ifup.sh
+++ dracut-044/modules.d/40network/ifup.sh
@@ -263,6 +263,19 @@ if strglobin $ip '*:*:*'; then
fi
[ -n "$gw" ] && echo ip route replace default via $gw dev $netif > /tmp/net.$netif.gw
+
+ for ifroute in /etc/sysconfig/network/ifroute-${netif} /etc/sysconfig/netwrk/routes ; do
+ [ -e ${ifroute} ] || continue
+ # Pull in existing routing configuration
+ read ifr_dest ifr_gw ifr_mask ifr_if < ${ifroute}
+ [ -z "$ifr_dest" -o -z "$ifr_gw" ] && continue
+ if [ "$ifr_if" = "-" ] ; then
+ echo ip route add $ifr_dest via $ifr_gw >> /tmp/net.$netif.gw
+ else
+ echo ip route add $ifr_dest via $ifr_gw dev $ifr_if >> /tmp/net.$netif.gw
+ fi
+ done
+
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
return 0
Index: dracut-044/modules.d/40network/module-setup.sh
===================================================================
--- dracut-044.orig/modules.d/40network/module-setup.sh
+++ dracut-044/modules.d/40network/module-setup.sh
@@ -60,6 +60,8 @@ install() {
[[ $hostonly ]] && {
inst_multiple /etc/sysconfig/network/ifcfg-*
+ inst_multiple /etc/sysconfig/network/ifroute-*
+ inst_simple /etc/sysconfig/network/routes
}
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \