summaryrefslogtreecommitdiff
path: root/source/n/NetworkManager
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/NetworkManager')
-rw-r--r--source/n/NetworkManager/55NetworkManager15
-rwxr-xr-xsource/n/NetworkManager/NetworkManager.SlackBuild61
-rw-r--r--source/n/NetworkManager/NetworkManager.conf7
-rw-r--r--source/n/NetworkManager/NetworkManager.conf.new11
-rw-r--r--source/n/NetworkManager/README15
-rw-r--r--source/n/NetworkManager/conf.d/00-dhcp-client.conf8
-rw-r--r--source/n/NetworkManager/conf.d/00-rc-manager.conf2
-rw-r--r--source/n/NetworkManager/doinst.sh2
-rw-r--r--source/n/NetworkManager/rc.networkmanager8
9 files changed, 67 insertions, 62 deletions
diff --git a/source/n/NetworkManager/55NetworkManager b/source/n/NetworkManager/55NetworkManager
index f3c6df5e..d7b3ee6a 100644
--- a/source/n/NetworkManager/55NetworkManager
+++ b/source/n/NetworkManager/55NetworkManager
@@ -1,10 +1,5 @@
#!/bin/sh
# If we are running NetworkManager, tell it we are going to sleep.
-# TODO: Make NetworkManager smarter about how to handle sleep/resume
-# If we are asleep for less time than it takes for TCP to reset a
-# connection, and we are assigned the same IP on resume, we should
-# not break established connections. Apple can do this, and it is
-# rather nifty.
. "${PM_FUNCTIONS}"
@@ -12,10 +7,11 @@ suspend_nm()
{
# Tell NetworkManager to shut down networking
printf "Having NetworkManager put all interaces to sleep..."
- dbus_send --system \
+ dbus_send --system --print-reply \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
- org.freedesktop.NetworkManager.sleep && \
+ org.freedesktop.NetworkManager.Sleep \
+ boolean:true && \
echo Done. || echo Failed.
}
@@ -23,10 +19,11 @@ resume_nm()
{
# Wake up NetworkManager and make it do a new connection
printf "Having NetworkManager wake interfaces back up..."
- dbus_send --system \
+ dbus_send --system --print-reply \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
- org.freedesktop.NetworkManager.wake && \
+ org.freedesktop.NetworkManager.Sleep \
+ boolean:false && \
echo Done. || echo Failed.
}
diff --git a/source/n/NetworkManager/NetworkManager.SlackBuild b/source/n/NetworkManager/NetworkManager.SlackBuild
index 41e0d18d..d152c07c 100755
--- a/source/n/NetworkManager/NetworkManager.SlackBuild
+++ b/source/n/NetworkManager/NetworkManager.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/sh
-# Copyright 2010, 2011 Robby Workman, Northport, Alabama, USA
-# Copyright 2013 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2010, 2011, 2014, 2016 Robby Workman, Northport, Alabama, USA
+# Copyright 2013, 2014, 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,13 +25,13 @@
PKGNAM=NetworkManager
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
MARCH=$( uname -m )
if [ -z "$ARCH" ]; then
case "$MARCH" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
armv7hl) export ARCH=$MARCH ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
@@ -46,8 +46,8 @@ TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -81,9 +81,8 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# Find the version off pppd installed or else assume we are on -current:
-PPPD=$( basename $(find /usr/lib${LIBDIRSUFFIX}/pppd -type d -maxdepth 1 -mindepth 1) )
-[ -z "$PPPD" ] && PPPD=2.4.5
+# Find the version number for pppd, used to specify the plugin directory:
+PPPD=$(echo /usr/lib${LIBDIRSUFFIX}/pppd/?.?.? | rev | cut -f 1 -d / | rev)
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@@ -94,6 +93,7 @@ CXXFLAGS="$SLKCFLAGS" \
--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 \
@@ -101,24 +101,26 @@ CXXFLAGS="$SLKCFLAGS" \
--with-dhcpcd=/sbin/dhcpcd \
--with-dhclient=yes \
--with-modem-manager-1=yes \
+ --with-nmtui=yes \
+ --disable-vala \
+ --with-session-tracking=consolekit \
+ --with-suspend-resume=consolekit \
+ --with-hostname-persist=slackware \
--build=$TARGET || exit 1
make $NUMJOBS || exit 1
make install DESTDIR=$PKG || exit 1
-# For some reason NetworkManager-0.9.8.0 does not install these:
-( cd man
- mkdir -p $PKG/usr/man/man1
- cp -a *.1 $PKG/usr/man/man1
- mkdir -p $PKG/usr/man/man5
- cp -a *.5 $PKG/usr/man/man5
- mkdir -p $PKG/usr/man/man8
- cp -a *.8 $PKG/usr/man/man8
-)
-
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+# Fix hardlinked manpages:
+( cd $PKG/usr/man/man1
+ ln -sf nmtui.1 nmtui-connect.1
+ ln -sf nmtui.1 nmtui-edit.1
+ ln -sf nmtui.1 nmtui-hostname.1
+)
+
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
@@ -133,19 +135,24 @@ mkdir -p $PKG/etc/rc.d
cat $CWD/rc.networkmanager > $PKG/etc/rc.d/rc.networkmanager.new
chmod 0644 $PKG/etc/rc.d/rc.networkmanager.new
-# Add a 'starter' NetworkManager.conf file
-# This sets the hostname (during postinstall) to match the system's name
-# and defines dhcpcd as the dhcp client to use
-mkdir -p $PKG/etc/NetworkManager
-cat $CWD/NetworkManager.conf.new > \
- $PKG/etc/NetworkManager/NetworkManager.conf.new
+# Add the pm-utils hook back in
+# xfce4-power-manager needs to be built *without* NM support
+mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/sleep.d/
+cat $CWD/55NetworkManager > $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/sleep.d/55NetworkManager
+chmod 0755 $PKG/usr/lib${LIBDIRSUFFIX}/pm-utils/sleep.d/55NetworkManager
+
+# Add default (plain) config file to enable keyfile plugin
+cat $CWD/NetworkManager.conf > $PKG/etc/NetworkManager/NetworkManager.conf.new
+
+# Set dhcp client to "dhcpcd" and rc-manager to "file" by default
+mkdir -p $PKG/etc/NetworkManager/conf.d
+cat $CWD/conf.d/00-dhcp-client.conf > $PKG/etc/NetworkManager/conf.d/00-dhcp-client.conf.new
+cat $CWD/conf.d/00-rc-manager.conf > $PKG/etc/NetworkManager/conf.d/00-rc-manager.conf.new
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
AUTHORS CONTRIBUTING COPYING ChangeLog INSTALL NEWS README TODO \
$PKG/usr/doc/$PKGNAM-$VERSION
-# In case someone needs this still:
-cp $CWD/55NetworkManager $PKG/usr/doc/$PKGNAM-$VERSION/
# If there's a ChangeLog, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
diff --git a/source/n/NetworkManager/NetworkManager.conf b/source/n/NetworkManager/NetworkManager.conf
new file mode 100644
index 00000000..eb8f6ae1
--- /dev/null
+++ b/source/n/NetworkManager/NetworkManager.conf
@@ -0,0 +1,7 @@
+# /etc/NetworkManager/NetworkManager.conf
+#
+# See additional config files (such as for DHCP settings) in ./conf.d
+
+[main]
+plugins=keyfile
+
diff --git a/source/n/NetworkManager/NetworkManager.conf.new b/source/n/NetworkManager/NetworkManager.conf.new
deleted file mode 100644
index 71945e90..00000000
--- a/source/n/NetworkManager/NetworkManager.conf.new
+++ /dev/null
@@ -1,11 +0,0 @@
-# /etc/NetworkManager/NetworkManager.conf
-#
-# See NetworkManager.conf(5) for more information on this file
-
-[main]
-plugins=keyfile
-dhcp=dhcpcd
-
-[keyfile]
-hostname=yourhostname
-
diff --git a/source/n/NetworkManager/README b/source/n/NetworkManager/README
deleted file mode 100644
index 5556f27f..00000000
--- a/source/n/NetworkManager/README
+++ /dev/null
@@ -1,15 +0,0 @@
-NetworkManager attempts to keep an active network connection available at all
-times. The point of NetworkManager is to make networking configuration and
-setup as painless and automatic as possible. NetworkManager is intended to
-replace default route, replace other routes, set IP addresses, and in general
-configure networking as NM sees fit (with the possibility of manual override as
-necessary). In effect, the goal of NetworkManager is to make networking Just
-Work with a minimum of user hassle, but still allow customization and a high
-level of manual network control.
-
-You will probably want to install network-manager-applet (for a configuration
-UI) for sure, along with ModemManager (if you want support for configuring
-broadband modem connections) perhaps one or more of the VPN-related addons.
-
-You will also need to start rc.networkmanager during boot - you can use
-rc.local, or perhaps you'll want to edit rc.M's call to rc.wicd... :-)
diff --git a/source/n/NetworkManager/conf.d/00-dhcp-client.conf b/source/n/NetworkManager/conf.d/00-dhcp-client.conf
new file mode 100644
index 00000000..7b52815f
--- /dev/null
+++ b/source/n/NetworkManager/conf.d/00-dhcp-client.conf
@@ -0,0 +1,8 @@
+[main]
+# Choose a DHCP client below. Upstream recommends dhclient, but results may vary.
+# 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/conf.d/00-rc-manager.conf b/source/n/NetworkManager/conf.d/00-rc-manager.conf
new file mode 100644
index 00000000..c848c003
--- /dev/null
+++ b/source/n/NetworkManager/conf.d/00-rc-manager.conf
@@ -0,0 +1,2 @@
+[main]
+rc-manager=file
diff --git a/source/n/NetworkManager/doinst.sh b/source/n/NetworkManager/doinst.sh
index cf091e8d..6c88b8cf 100644
--- a/source/n/NetworkManager/doinst.sh
+++ b/source/n/NetworkManager/doinst.sh
@@ -32,6 +32,8 @@ fi
# connection could be lost at a remote location.
preserve_perms etc/rc.d/rc.networkmanager.new
config etc/NetworkManager/NetworkManager.conf.new
+config etc/NetworkManager/conf.d/00-rc-manager.conf.new
+config etc/NetworkManager/conf.d/00-dhcp-client.conf.new
# If the .pid file is found in the old location, move it to the new one:
if [ -r var/run/NetworkManager.pid ]; then
diff --git a/source/n/NetworkManager/rc.networkmanager b/source/n/NetworkManager/rc.networkmanager
index 430e61a4..dbdf19d5 100644
--- a/source/n/NetworkManager/rc.networkmanager
+++ b/source/n/NetworkManager/rc.networkmanager
@@ -69,6 +69,14 @@ nm_stop()
sleep 3
rm -f $PIDFILE &>/dev/null
fi
+ # If wpa_supplicant is running here, it needs to be shut down as well.
+ # Since you're asking for NetworkManager to shut down, we have to assume
+ # that wpa_supplicant was started by it.
+ if [ -r /var/run/wpa_supplicant.pid ]; then
+ kill $(cat /var/run/wpa_supplicant.pid)
+ elif [ -r /run/wpa_supplicant.pid ]; then
+ kill $(cat /run/wpa_supplicant.pid)
+ fi
echo "stopped";
sleep 3
}