aboutsummaryrefslogtreecommitdiff
path: root/system/atop
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-04-04 15:17:16 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-04-04 15:17:16 +0700
commitb7147018a2964d84f1c95f7ee85c052c1df95951 (patch)
tree66cf5ea376c47057dbdf41a85b73d3be403568b3 /system/atop
parent7b05f175be417e6d6792f4d267ee632da5005dd8 (diff)
system/atop: Fix build.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/atop')
-rw-r--r--system/atop/142.patch47
-rw-r--r--system/atop/atop.SlackBuild4
2 files changed, 50 insertions, 1 deletions
diff --git a/system/atop/142.patch b/system/atop/142.patch
new file mode 100644
index 0000000000000..b17fe2d6ca7ed
--- /dev/null
+++ b/system/atop/142.patch
@@ -0,0 +1,47 @@
+From aff473ee28903775e1bb35793b9c4c50ee0c7270 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 22 Dec 2020 12:23:33 +0100
+Subject: [PATCH] ifprop.c: fix build with kernel < 4.6
+
+Build fails with kernel headers < 4.6 since version 2.6.0 and
+https://github.com/Atoptool/atop/commit/08c622ecaa5bb0bb260984ceaddc4730d1b312a7
+
+Indeed, ethtool_link_settings and ETHTOOL_GLINKSETTINGS are only
+available since
+https://github.com/torvalds/linux/commit/3f1ac7a700d039c61d8d8b99f28d605d489a60cf
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ ifprop.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ifprop.c b/ifprop.c
+index 60fa3fa..63fce5a 100644
+--- a/ifprop.c
++++ b/ifprop.c
+@@ -104,7 +104,9 @@ initifprop(void)
+ char *cp, linebuf[2048];
+ int i=0, sockfd;
+
++#ifdef ETHTOOL_GLINKSETTINGS
+ struct ethtool_link_settings ethlink; // preferred!
++#endif
+ struct ethtool_cmd ethcmd; // deprecated
+
+ struct ifreq ifreq;
+@@ -153,6 +155,7 @@ initifprop(void)
+ strncpy((void *)&ifreq.ifr_ifrn.ifrn_name, ifprops[i].name,
+ sizeof ifreq.ifr_ifrn.ifrn_name-1);
+
++#ifdef ETHTOOL_GLINKSETTINGS
+ ethlink.cmd = ETHTOOL_GLINKSETTINGS;
+ ifreq.ifr_ifru.ifru_data = (void *)&ethlink;
+
+@@ -164,6 +167,7 @@ initifprop(void)
+ phy_addr = ethlink.phy_address;
+ }
+ else
++#endif
+ {
+ ethcmd.cmd = ETHTOOL_GSET;
+ ifreq.ifr_ifru.ifru_data = (void *)&ethcmd;
diff --git a/system/atop/atop.SlackBuild b/system/atop/atop.SlackBuild
index 82a3fa555f5bf..a8302f34976c5 100644
--- a/system/atop/atop.SlackBuild
+++ b/system/atop/atop.SlackBuild
@@ -13,7 +13,7 @@
PRGNAM=atop
VERSION=${VERSION:-2.6.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -58,6 +58,8 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+patch -p1 < $CWD/142.patch
+
make CFLAGS="$SLKCFLAGS"
# Install the binary sgid utmp in order to allow accounting