summaryrefslogtreecommitdiffstats
path: root/source/n/NetworkManager
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/NetworkManager')
-rwxr-xr-xsource/n/NetworkManager/NetworkManager.SlackBuild83
-rw-r--r--source/n/NetworkManager/conf.d/00-dhcp-client.conf8
-rw-r--r--source/n/NetworkManager/patches/dhcpcd.graceful.exit.patch88
3 files changed, 134 insertions, 45 deletions
diff --git a/source/n/NetworkManager/NetworkManager.SlackBuild b/source/n/NetworkManager/NetworkManager.SlackBuild
index fb108b5bf..7fa8d4a56 100755
--- a/source/n/NetworkManager/NetworkManager.SlackBuild
+++ b/source/n/NetworkManager/NetworkManager.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 2010, 2011, 2014, 2016 Robby Workman, Northport, Alabama, USA
-# Copyright 2013, 2014, 2015, 2016, 2018, 2020 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2013, 2014, 2015, 2016, 2018, 2020, 2024 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -53,7 +53,7 @@ NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
-OUTPUT=${OUTPUT:-/tmp}
+OUTPUT=${OUTPUT:-$TMP}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
@@ -98,50 +98,44 @@ for dfile in $CWD/patches/* ; do
zcat $dfile | patch -p1 --verbose || exit 1
done
-# For git-patched builds
-autoreconf -vif
-automake
-./autogen.sh
-
-# Configuring --enable-json-validation --enable-ovs requires the Jansson
-# json-c library. If there's any interest or usefulness with that, let me
-# know. The library is fairly small, but in order to actually use team
-# interfaces will probably require more stuff (not sure how much).
-#
-# Update September 2018: Added those options since we needed Jansson
-# already for HTTP/2 support.
-
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-./configure \
+# Configure, build, and install:
+export CFLAGS="$SLKCFLAGS"
+export CXXFLAGS="$SLKCFLAGS"
+mkdir meson-build
+cd meson-build
+meson setup \
--prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --libdir=lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
- --docdir=/usr/doc/$PKGNAM-$VERSION \
- --with-udev-dir=/lib/udev \
- --with-pppd-plugin-dir=/usr/lib${LIBDIRSUFFIX}/pppd/$PPPD \
- --with-crypto=nss \
- --enable-more-warnings=no \
- --without-resolvconf \
- --with-dhcpcd=/sbin/dhcpcd \
- --with-dhclient=yes \
- --with-modem-manager-1=yes \
- --with-nmtui=yes \
- --enable-json-validation \
- --enable-ovs \
- --with-consolekit=no \
- --with-session-tracking=elogind \
- --with-suspend-resume=elogind \
- --with-hostname-persist=slackware \
- --build=$TARGET || exit 1
-
-make $NUMJOBS || exit 1
-make install DESTDIR=$PKG || exit 1
-
-# Don't ship .la files:
-rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+ --buildtype=release \
+ -Dudev_dir=/lib/udev \
+ -Ddbus_conf_dir=/usr/share/dbus-1/system.d \
+ -Dpppd_plugin_dir=/usr/lib${LIBDIRSUFFIX}/pppd/$PPPD \
+ -Dcrypto=nss \
+ -Dresolvconf=false \
+ -Ddhcpcd=/sbin/dhcpcd \
+ -Dconfig_dhcp_default=dhcpcd \
+ -Ddhclient=/sbin/dhclient \
+ -Dmodem_manager=true \
+ -Dnmtui=true \
+ -Dovs=true \
+ -Dsession_tracking_consolekit=false \
+ -Dsession_tracking=elogind \
+ -Dsuspend_resume=elogind \
+ -Dhostname_persist=slackware \
+ -Dsystemd_journal=false \
+ -Dsystemdsystemunitdir=no \
+ -Dmore_logging=false \
+ -Dselinux=false \
+ -Dlibaudit=no \
+ -Dqt=false \
+ -Ddocs=true \
+ .. || exit 1
+ "${NINJA:=ninja}" $NUMJOBS || exit 1
+ DESTDIR=$PKG $NINJA install || exit 1
+cd ..
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -158,6 +152,11 @@ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
find $PKG/usr/man -type f -exec gzip -9 {} \+
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+# Relocate:
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+mv $PKG/usr/share/doc/NetworkManager/examples $PKG/usr/doc/$PKGNAM-$VERSION
+rm -r $PKG/usr/share/doc
+
# In case NetworkManager tries to install something here:
rm -f $PKG/etc/rc.d/rc.networkmanager
diff --git a/source/n/NetworkManager/conf.d/00-dhcp-client.conf b/source/n/NetworkManager/conf.d/00-dhcp-client.conf
index 8f4356924..78518ac56 100644
--- a/source/n/NetworkManager/conf.d/00-dhcp-client.conf
+++ b/source/n/NetworkManager/conf.d/00-dhcp-client.conf
@@ -1,9 +1,11 @@
[main]
# Choose a DHCP client below. Upstream recommends internal, but results may vary.
-# dhcpcd is the DHCP client usually used by Slackware. The --noconfigure
-# option must be used or the network will not return after suspend/resume:
-dhcp=dhcpcd --noconfigure
+#
+# dhcpcd is the DHCP client usually used by Slackware:
+dhcp=dhcpcd
+#
# dhclient is the ISC reference DHCP client, part of the dhcp package:
#dhcp=dhclient
+#
# This is a simple DHCP client that is built into NetworkManager:
#dhcp=internal
diff --git a/source/n/NetworkManager/patches/dhcpcd.graceful.exit.patch b/source/n/NetworkManager/patches/dhcpcd.graceful.exit.patch
new file mode 100644
index 000000000..6abc3e468
--- /dev/null
+++ b/source/n/NetworkManager/patches/dhcpcd.graceful.exit.patch
@@ -0,0 +1,88 @@
+--- ./src/core/dhcp/nm-dhcp-client.h.orig 2024-02-22 00:44:13.335158315 -0600
++++ ./src/core/dhcp/nm-dhcp-client.h 2024-02-22 19:41:56.134066083 -0600
+@@ -249,7 +249,7 @@
+ /* Backend helpers for subclasses */
+ void nm_dhcp_client_stop_existing(const char *pid_file, const char *binary_name);
+
+-void nm_dhcp_client_stop_pid(pid_t pid, const char *iface);
++void nm_dhcp_client_stop_pid(pid_t pid, const char *iface, int sig);
+
+ void nm_dhcp_client_start_timeout(NMDhcpClient *self);
+
+--- ./src/core/dhcp/nm-dhcp-dhcpcd.c.orig 2024-02-22 19:41:56.134066083 -0600
++++ ./src/core/dhcp/nm-dhcp-dhcpcd.c 2024-02-22 19:47:18.556073296 -0600
+@@ -158,31 +158,17 @@
+ {
+ NMDhcpDhcpcd *self = NM_DHCP_DHCPCD(client);
+ pid_t pid;
+- int sig, errsv;
++ int sig;
+
+ pid = nm_dhcp_client_get_pid(client);
+ if (pid > 1) {
+ sig = release ? SIGALRM : SIGTERM;
+ _LOGD("sending %s to dhcpcd pid %d", sig == SIGALRM ? "SIGALRM" : "SIGTERM", pid);
+
+- /* dhcpcd-9.x features privilege separation.
+- * It's not our job to track all these processes so we rely on dhcpcd
+- * to always cleanup after itself.
+- * Because it also re-parents itself to PID 1, the process cannot be
+- * reaped or waited for.
+- * As such, just send the correct signal.
+- */
+- if (kill(pid, sig) == -1) {
+- errsv = errno;
+- _LOGE("failed to kill dhcpcd %d:%s", errsv, nm_strerror_native(errsv));
+- }
+-
+- /* When this function exits NM expects the PID to be -1.
+- * This means we also need to stop watching the pid.
+- * If we need to know the exit status then we need to refactor NM
+- * to allow a non -1 to mean we're waiting to exit still.
+- */
++ /* We need to remove the watch before stopping the process */
+ nm_dhcp_client_stop_watch_child(client, pid);
++
++ nm_dhcp_client_stop_pid(pid, nm_dhcp_client_get_iface(client), sig);
+ }
+ }
+
+--- ./src/core/dhcp/nm-dhcp-dhclient.c.orig 2024-02-22 00:44:13.335158315 -0600
++++ ./src/core/dhcp/nm-dhcp-dhclient.c 2024-02-22 19:41:56.134066083 -0600
+@@ -622,7 +622,7 @@
+
+ if (dhclient_start(client, FALSE, TRUE, FALSE, &rpid, NULL)) {
+ /* Wait a few seconds for the release to happen */
+- nm_dhcp_client_stop_pid(rpid, nm_dhcp_client_get_iface(client));
++ nm_dhcp_client_stop_pid(rpid, nm_dhcp_client_get_iface(client), SIGTERM);
+ }
+ }
+ }
+--- ./src/core/dhcp/nm-dhcp-client.c.orig 2024-02-22 00:44:13.334158313 -0600
++++ ./src/core/dhcp/nm-dhcp-client.c 2024-02-22 19:41:56.134066083 -0600
+@@ -367,14 +367,14 @@
+ }
+
+ void
+-nm_dhcp_client_stop_pid(pid_t pid, const char *iface)
++nm_dhcp_client_stop_pid(pid_t pid, const char *iface, int sig)
+ {
+ char *name = iface ? g_strdup_printf("dhcp-client-%s", iface) : NULL;
+
+ g_return_if_fail(pid > 1);
+
+ nm_utils_kill_child_sync(pid,
+- SIGTERM,
++ sig,
+ LOGD_DHCP,
+ name ?: "dhcp-client",
+ NULL,
+@@ -395,7 +395,7 @@
+ if (priv->pid > 0) {
+ /* Clean up the watch handler since we're explicitly killing the daemon */
+ watch_cleanup(self);
+- nm_dhcp_client_stop_pid(priv->pid, priv->config.iface);
++ nm_dhcp_client_stop_pid(priv->pid, priv->config.iface, SIGTERM);
+ }
+ priv->pid = -1;
+ }