summaryrefslogtreecommitdiff
path: root/source/n/network-scripts
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2021-11-11 20:36:12 +0000
committerEric Hameleers <alien@slackware.com>2021-11-12 08:59:57 +0100
commit5f74398bf9e65ea1aa61c9a843a88f98700ccab7 (patch)
treebb5df74846116525f315ca070b70133df8cbfce8 /source/n/network-scripts
parent53b8e9dd3942dcddfe065960ad276233e3e791a0 (diff)
downloadcurrent-5f74398bf9e65ea1aa61c9a843a88f98700ccab7.tar.gz
Thu Nov 11 20:36:12 UTC 202120211111203612
a/sdparm-1.12-x86_64-2.txz: Rebuilt. Recompiled against sg3_utils-1.47. a/sysvinit-scripts-15.0-noarch-6.txz: Rebuilt. rc.{6,S,M}: merged changes for compatibility with LXC containers. a/udisks-1.0.5-x86_64-10.txz: Rebuilt. Recompiled against sg3_utils-1.47. ap/lxc-4.0.11-x86_64-1.txz: Upgraded. Requires libseccomp-2.5.3. No more local versions of rc.{6,S,M,inet1}: the regular versions work now. l/elfutils-0.186-x86_64-1.txz: Upgraded. l/libgpod-0.8.3-x86_64-11.txz: Rebuilt. Recompiled against sg3_utils-1.47. l/libseccomp-2.5.3-x86_64-1.txz: Added. This is needed by lxc-4.0.11. Thanks to Willy Sudiarto Raharjo. l/sg3_utils-1.47-x86_64-1.txz: Upgraded. Shared library .so-version bump. n/network-scripts-15.0-noarch-17.txz: Rebuilt. Merged changes in rc.inet1 to make it compatible with LXC containers. Patched netconfig to ensure the proper permissions on rc.networkmanager when NetworkManager is not chosen. x/ibus-1.5.25-x86_64-4.txz: Rebuilt. [PATCH] client/gtk2/ibusimcontext: Fix wrong cursor location in gtk3 apps. Thanks to Lockywolf.
Diffstat (limited to 'source/n/network-scripts')
-rw-r--r--source/n/network-scripts/0000-rc.inet1.new-lxc-additions.patch39
-rw-r--r--source/n/network-scripts/0001-netconfig-turn-off-rc.networkmanager-if-networkmanager-is-not-selected.patch20
-rwxr-xr-xsource/n/network-scripts/network-scripts.SlackBuild16
3 files changed, 73 insertions, 2 deletions
diff --git a/source/n/network-scripts/0000-rc.inet1.new-lxc-additions.patch b/source/n/network-scripts/0000-rc.inet1.new-lxc-additions.patch
new file mode 100644
index 00000000..d9c14d44
--- /dev/null
+++ b/source/n/network-scripts/0000-rc.inet1.new-lxc-additions.patch
@@ -0,0 +1,39 @@
+From 2ef0c19e3ebfd99c1c89bf13dee0ec198c5ef559 Mon Sep 17 00:00:00 2001
+From: Patrick J. Volkerding <volkerdi@slackware.com>
+Date: Wed, 10 Nov 2021 16:22:43 -0600
+Subject: [PATCH] Skip bridge and bond configuration in LXC container
+
+Add LXC detection at the beginning of the script to set container="lxc" if an
+LXC container is detected. Later, use this to skip bridge and bond creation in
+an LXC container. Patched script works in both LXC and on bare metal.
+
+--- ./etc/rc.d/rc.inet1.new.orig 2021-03-08 18:13:50.484386646 -0600
++++ ./etc/rc.d/rc.inet1.new 2021-11-10 02:32:58.780223136 -0600
+@@ -2,7 +2,14 @@
+ # /etc/rc.d/rc.inet1
+ # This script is used to bring up the various network interfaces.
+ #
+-# @(#)/etc/rc.d/rc.inet1 10.2 Sun Jul 24 12:45:56 PDT 2005 (pjv)
++# @(#)/etc/rc.d/rc.inet1 15.0 Wed Nov 10 08:17:22 UTC 2021 (pjv)
++
++# If we are in an lxc container, set $container to skip parts of the script.
++# Thanks to Matteo Bernardini <ponce@slackbuilds.org> and Chris Willing for
++# the initial work making this script lxc compatible.
++if grep -aq container=lxc /proc/1/environ 2> /dev/null ; then
++ container="lxc"
++fi
+
+ ############################
+ # READ NETWORK CONFIG FILE #
+@@ -254,9 +261,9 @@
+ # bond or bridge, configure the interfaces with IPs of 0.0.0.0 and set the
+ # MAC address with HWADDR. Then, finally, define the bond or bridge.
+ # If the interface is a bond, create it.
+- [ -n "${BONDNICS[$i]}" ] && bond_create $i
++ [ -n "${BONDNICS[$i]}" -a -z "$container" ] && bond_create $i
+ # If the interface is a bridge, create it.
+- [ -n "${BRNICS[$i]}" ] && br_open $i
++ [ -n "${BRNICS[$i]}" -a -z "$container" ] && br_open $i
+ if [ -e /sys/class/net/${1%%[:.]*} ]; then # interface exists
+ if ! /sbin/ip address show scope global dev ${1} 2>/dev/null | grep -Ewq '(inet|inet6)' || \
+ ! /sbin/ip link show dev ${1} | grep -wq "state UP"; then # interface not up or not configured
diff --git a/source/n/network-scripts/0001-netconfig-turn-off-rc.networkmanager-if-networkmanager-is-not-selected.patch b/source/n/network-scripts/0001-netconfig-turn-off-rc.networkmanager-if-networkmanager-is-not-selected.patch
new file mode 100644
index 00000000..75700804
--- /dev/null
+++ b/source/n/network-scripts/0001-netconfig-turn-off-rc.networkmanager-if-networkmanager-is-not-selected.patch
@@ -0,0 +1,20 @@
+From d5e9803b79f3bf909b01c3ff3a5cdb0d7594dba0 Mon Sep 17 00:00:00 2001
+From: Patrick J. Volkerding <volkerdi@slackware.com>
+Date: Wed, 10 Nov 2021 16:27:08 -0600
+Subject: [PATCH] Ensure proper rc.networkmanager permissions
+
+In case rc.networkmanager was made executable by the admin or with a previous
+run of netconfig, we need to disable it if networkmanager wasn't selected in
+this netconfig run.
+
+--- ./sbin/netconfig.orig 2021-04-16 13:51:20.261045081 -0500
++++ ./sbin/netconfig 2021-11-10 16:14:09.388939104 -0600
+@@ -1071,6 +1071,8 @@
+ write_config_files
+ if [ "$NETWORKMANAGER" = "yes" -a -r etc/rc.d/rc.networkmanager ]; then
+ chmod 755 etc/rc.d/rc.networkmanager
++ elif [ ! "$NETWORKMANAGER" = "yes" -a -x etc/rc.d/rc.networkmanager ]; then
++ chmod 644 etc/rc.d/rc.networkmanager
+ fi
+ dialog --msgbox "Settings accepted. Basic network configuration is complete." 6 40
+ else
diff --git a/source/n/network-scripts/network-scripts.SlackBuild b/source/n/network-scripts/network-scripts.SlackBuild
index 0476a7b8..ea4bad77 100755
--- a/source/n/network-scripts/network-scripts.SlackBuild
+++ b/source/n/network-scripts/network-scripts.SlackBuild
@@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=network-scripts
VERSION=${VERSION:-15.0}
ARCH=noarch
-BUILD=${BUILD:-16}
+BUILD=${BUILD:-17}
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
@@ -84,6 +84,18 @@ mkdir -p $PKG/install
zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
+# Patch to fix rc.inet1.new for LXC:
+( cd $PKG
+ cat $CWD/0000-rc.inet1.new-lxc-additions.patch | patch -p1 --verbose || exit 1
+ rm -f etc/rc.d/rc.inet1.new.orig
+) || exit 1
+
+# Patch netconfig to fix leaving a previously enabled rc.networkmanager
+# executable even if networkmanager is no longer selected:
+( cd $PKG
+ cat $CWD/0001-netconfig-turn-off-rc.networkmanager-if-networkmanager-is-not-selected.patch | patch -p1 --verbose || exit 1
+ rm -f sbin/netconfig.orig
+)
+
cd $PKG
/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
-