From f64c3ce18dc589ee45bd74749b4abde29cb5342d Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 13 Jan 2015 15:23:50 -0800 Subject: [PATCH] kernel: Add a patch to remove checks for bridge stp helpers --- .../kernel/dont-require-bridge-helper.patch | 50 +++++++++++++++++++ pkgs/os-specific/linux/kernel/patches.nix | 5 ++ pkgs/top-level/all-packages.nix | 24 ++++++--- 3 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 pkgs/os-specific/linux/kernel/dont-require-bridge-helper.patch diff --git a/pkgs/os-specific/linux/kernel/dont-require-bridge-helper.patch b/pkgs/os-specific/linux/kernel/dont-require-bridge-helper.patch new file mode 100644 index 000000000000..42756120e25d --- /dev/null +++ b/pkgs/os-specific/linux/kernel/dont-require-bridge-helper.patch @@ -0,0 +1,50 @@ +diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c +index 4114687..49832c0 100644 +--- a/net/bridge/br_stp_if.c ++++ b/net/bridge/br_stp_if.c +@@ -124,12 +124,6 @@ void br_stp_disable_port(struct net_bridge_port *p) + + static void br_stp_start(struct net_bridge *br) + { +- int r; +- char *argv[] = { BR_STP_PROG, br->dev->name, "start", NULL }; +- char *envp[] = { NULL }; +- +- r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC); +- + spin_lock_bh(&br->lock); + + if (br->bridge_forward_delay < BR_MIN_FORWARD_DELAY) +@@ -137,29 +131,16 @@ static void br_stp_start(struct net_bridge *br) + else if (br->bridge_forward_delay > BR_MAX_FORWARD_DELAY) + __br_set_forward_delay(br, BR_MAX_FORWARD_DELAY); + +- if (r == 0) { +- br->stp_enabled = BR_USER_STP; +- br_debug(br, "userspace STP started\n"); +- } else { +- br->stp_enabled = BR_KERNEL_STP; +- br_debug(br, "using kernel STP\n"); +- +- /* To start timers on any ports left in blocking */ +- br_port_state_selection(br); +- } ++ br->stp_enabled = BR_USER_STP; ++ br_debug(br, "userspace STP started\n"); + + spin_unlock_bh(&br->lock); + } + + static void br_stp_stop(struct net_bridge *br) + { +- int r; +- char *argv[] = { BR_STP_PROG, br->dev->name, "stop", NULL }; +- char *envp[] = { NULL }; +- + if (br->stp_enabled == BR_USER_STP) { +- r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC); +- br_info(br, "userspace STP stopped, return code %d\n", r); ++ br_info(br, "userspace STP stoppe\n"); + + /* To start timers on any ports left in blocking */ + spin_lock_bh(&br->lock); diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix index 6265a2eea18b..82dfa0935531 100644 --- a/pkgs/os-specific/linux/kernel/patches.nix +++ b/pkgs/os-specific/linux/kernel/patches.nix @@ -32,6 +32,11 @@ in rec { + dont_require_bridge_helper = + { name = "dont-require-bridge-helper"; + patch = ./dont-require-bridge-helper.patch; + }; + no_xsave = { name = "no-xsave"; patch = ./no-xsave.patch; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7fe6b9f53fe5..115670d5736b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8395,12 +8395,13 @@ let linux_3_2 = makeOverridable (import ../os-specific/linux/kernel/linux-3.2.nix) { inherit fetchurl stdenv perl buildLinux; - kernelPatches = []; + kernelPatches = [ kernelPatches.dont_require_bridge_helper ]; }; linux_3_4 = makeOverridable (import ../os-specific/linux/kernel/linux-3.4.nix) { inherit fetchurl stdenv perl buildLinux; - kernelPatches = lib.optionals ((platform.kernelArch or null) == "mips") + kernelPatches = [ kernelPatches.dont_require_bridge_helper ] + ++ lib.optionals ((platform.kernelArch or null) == "mips") [ kernelPatches.mips_fpureg_emu kernelPatches.mips_fpu_sigill ]; @@ -8408,11 +8409,13 @@ let linux_3_6_rpi = makeOverridable (import ../os-specific/linux/kernel/linux-rpi-3.6.nix) { inherit fetchurl stdenv perl buildLinux; + kernelPatches = [ kernelPatches.dont_require_bridge_helper ]; }; linux_3_10 = makeOverridable (import ../os-specific/linux/kernel/linux-3.10.nix) { inherit fetchurl stdenv perl buildLinux; - kernelPatches = lib.optionals ((platform.kernelArch or null) == "mips") + kernelPatches = [ kernelPatches.dont_require_bridge_helper ] + ++ lib.optionals ((platform.kernelArch or null) == "mips") [ kernelPatches.mips_fpureg_emu kernelPatches.mips_fpu_sigill kernelPatches.mips_ext3_n32 @@ -8421,7 +8424,8 @@ let linux_3_12 = makeOverridable (import ../os-specific/linux/kernel/linux-3.12.nix) { inherit fetchurl stdenv perl buildLinux; - kernelPatches = lib.optionals ((platform.kernelArch or null) == "mips") + kernelPatches = [ kernelPatches.dont_require_bridge_helper ] + ++ lib.optionals ((platform.kernelArch or null) == "mips") [ kernelPatches.mips_fpureg_emu kernelPatches.mips_fpu_sigill kernelPatches.mips_ext3_n32 @@ -8430,7 +8434,8 @@ let linux_3_14 = makeOverridable (import ../os-specific/linux/kernel/linux-3.14.nix) { inherit fetchurl stdenv perl buildLinux; - kernelPatches = lib.optionals ((platform.kernelArch or null) == "mips") + kernelPatches = [ kernelPatches.dont_require_bridge_helper ] + ++ lib.optionals ((platform.kernelArch or null) == "mips") [ kernelPatches.mips_fpureg_emu kernelPatches.mips_fpu_sigill kernelPatches.mips_ext3_n32 @@ -8439,7 +8444,8 @@ let linux_3_17 = makeOverridable (import ../os-specific/linux/kernel/linux-3.17.nix) { inherit fetchurl stdenv perl buildLinux; - kernelPatches = lib.optionals ((platform.kernelArch or null) == "mips") + kernelPatches = [ kernelPatches.dont_require_bridge_helper ] + ++ lib.optionals ((platform.kernelArch or null) == "mips") [ kernelPatches.mips_fpureg_emu kernelPatches.mips_fpu_sigill kernelPatches.mips_ext3_n32 @@ -8448,7 +8454,8 @@ let linux_3_18 = makeOverridable (import ../os-specific/linux/kernel/linux-3.18.nix) { inherit fetchurl stdenv perl buildLinux; - kernelPatches = lib.optionals ((platform.kernelArch or null) == "mips") + kernelPatches = [ kernelPatches.dont_require_bridge_helper ] + ++ lib.optionals ((platform.kernelArch or null) == "mips") [ kernelPatches.mips_fpureg_emu kernelPatches.mips_fpu_sigill kernelPatches.mips_ext3_n32 @@ -8457,7 +8464,8 @@ let linux_testing = makeOverridable (import ../os-specific/linux/kernel/linux-testing.nix) { inherit fetchurl stdenv perl buildLinux; - kernelPatches = lib.optionals ((platform.kernelArch or null) == "mips") + kernelPatches = [ kernelPatches.dont_require_bridge_helper ] + ++ lib.optionals ((platform.kernelArch or null) == "mips") [ kernelPatches.mips_fpureg_emu kernelPatches.mips_fpu_sigill kernelPatches.mips_ext3_n32