From cdbd2caec49ca242dff013b3555de73a39ca64bb Mon Sep 17 00:00:00 2001 From: Hunter Sezen Date: Fri, 9 Dec 2016 00:29:24 +0000 Subject: network/r8168: Fixed doinst.sh. Signed-off-by: David Spencer --- network/r8168/README | 14 ++++++-------- network/r8168/doinst.sh | 20 ++++++++++++++++++-- network/r8168/r8168.SlackBuild | 7 +++++-- 3 files changed, 29 insertions(+), 12 deletions(-) (limited to 'network/r8168') diff --git a/network/r8168/README b/network/r8168/README index 8e3cb1e69b..1789e6cbd8 100644 --- a/network/r8168/README +++ b/network/r8168/README @@ -4,14 +4,12 @@ This is the Linux device driver released for RealTek RTL8168B/8111B, RTL8168C/8111C, RTL8168CP/8111CP, RTL8168D/8111D, RTL8168DP/8111DP, and RTL8168E/8111E Gigabit Ethernet controllers with PCI-Express interface. -To build the module for a kernel that isn't currently running on the -system pass that kernel's "uname -r" ouput such as: - -KERNEL="4.4.0" ./r8168.SlackBuild +This will need to be rebuilt for every new kernel installed. -To use this module, blacklist the r8169 driver in -/etc/modprobe.d/blacklist.conf: +To build the module for a kernel that isn't currently running on the +system, pass that kernel's "uname -r" output such as: -blacklist r8169 + KERNEL="4.4.0" ./r8168.SlackBuild -This will need to be rebuilt for every new kernel installed. +In order to avoid conflicts, /etc/modprobe.d/r8169_blacklist.conf +disables the r8169 driver. diff --git a/network/r8168/doinst.sh b/network/r8168/doinst.sh index 6a688ee74c..a020fc58d2 100644 --- a/network/r8168/doinst.sh +++ b/network/r8168/doinst.sh @@ -1,3 +1,19 @@ -if [ -x /sbin/depmod ]; then - /sbin/depmod -a 1> /dev/null 2> /dev/null +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/modprobe.d/r8169_blacklist.conf.new + +# A good idea whenever kernel modules are added or changed: +if [ -x sbin/depmod ]; then + chroot . /sbin/depmod -a @KERNEL@ 1> /dev/null 2> /dev/null fi diff --git a/network/r8168/r8168.SlackBuild b/network/r8168/r8168.SlackBuild index 6fbae1be99..1db7f31a43 100644 --- a/network/r8168/r8168.SlackBuild +++ b/network/r8168/r8168.SlackBuild @@ -24,7 +24,7 @@ PRGNAM=r8168 VERSION=${VERSION:-8.043.01} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -80,13 +80,16 @@ make -C /lib/modules/$KERNEL/build \ install -Dm0644 src/$PRGNAM.ko \ $PKG/lib/modules/$KERNEL/kernel/drivers/net/ethernet/realtek/$PRGNAM.ko +mkdir -p $PKG/etc/modprobe.d +echo "blacklist r8169" > $PKG/etc/modprobe.d/r8169_blacklist.conf.new + mkdir -p $PKG/usr/doc/$PRGNAM-$PKGVER cp -a README $PKG/usr/doc/$PRGNAM-$PKGVER cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKGVER/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc -cat $CWD/doinst.sh > $PKG/install/doinst.sh +sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVER-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} -- cgit v1.2.3