Skip to content

Commit

Permalink
add cross/lm-sensors (#5443) (#6084)
Browse files Browse the repository at this point in the history
* add cross/lm-sensors (#5443)

* add lm-sensors to synocli-monitor

* add cross/ionice
- add cross/ionice from util-linux
- use cross/ionice for synocli-monitor and drop ionice of busybox

* update build of net-snmp
- fix net-snmp version number
- configure to use sysctl
  • Loading branch information
hgy59 committed Jun 23, 2024
1 parent 88d4dea commit 6694c06
Show file tree
Hide file tree
Showing 12 changed files with 301 additions and 8 deletions.
35 changes: 35 additions & 0 deletions cross/ionice/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
PKG_NAME = ionice
PKG_REAL_NAME = util-linux
PKG_VERS = 2.40.1
PKG_VERS_MAJOR = $(word 1,$(subst ., ,$(PKG_VERS))).$(word 2,$(subst ., ,$(PKG_VERS)))
PKG_EXT = tar.xz
PKG_DIST_NAME = $(PKG_REAL_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://www.kernel.org/pub/linux/utils/$(PKG_REAL_NAME)/v$(PKG_VERS_MAJOR)
# use dedicated folder to build independent of other libraries built from util-linux (i.e. libuuid, libmount, libblkid, ionice, misc-util-linux)
PKG_DIR = $(PKG_NAME)/$(PKG_REAL_NAME)-$(PKG_VERS)
EXTRACT_PATH = $(WORK_DIR)/$(PKG_NAME)

DEPENDS =

HOMEPAGE = https://github.com/karelzak/util-linux
COMMENT = Random collection of Linux utilities. We use this only to build ionice out of util-linux.
LICENSE = GPLv2

GNU_CONFIGURE = 1
CONFIGURE_ARGS = --disable-static
CONFIGURE_ARGS += --without-ncurses
CONFIGURE_ARGS += --without-python
CONFIGURE_ARGS += --disable-asciidoc

include ../../mk/spksrc.archs.mk
ifneq ($(findstring $(ARCH),$(64bit_ARCHS)),$(ARCH))
CONFIGURE_ARGS += --disable-year2038
endif

# build ionice only (schedutils = ionice, chrt, taskset)
# chrt, taskset and uclampset are disabled by patch to avoid configure error
CONFIGURE_ARGS += --disable-all-programs --enable-schedutils

ADDITIONAL_CFLAGS = -O

include ../../mk/spksrc.cross-cc.mk
1 change: 1 addition & 0 deletions cross/ionice/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin:bin/ionice
3 changes: 3 additions & 0 deletions cross/ionice/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
util-linux-2.40.1.tar.xz SHA1 531be0897df5a347c0185e5c1c047fa6a9a7da26
util-linux-2.40.1.tar.xz SHA256 59e676aa53ccb44b6c39f0ffe01a8fa274891c91bef1474752fad92461def24f
util-linux-2.40.1.tar.xz MD5 42ca7b92a3d77087de362f43ac29a3df
32 changes: 32 additions & 0 deletions cross/ionice/patches/001-configure-enable-ionice-only.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# enable ionice only for enable-schedutils
#
#
--- configure.orig 2024-05-06 08:20:58.337712600 +0000
+++ configure 2024-06-21 19:41:48.828192227 +0000
@@ -41220,7 +41220,7 @@



- enable_taskset=$enable_schedutils
+ enable_taskset=no



@@ -41376,7 +41376,7 @@



- enable_chrt=$enable_schedutils
+ enable_chrt=no



@@ -41505,7 +41505,7 @@



- enable_uclampset=$enable_schedutils
+ enable_uclampset=no



21 changes: 21 additions & 0 deletions cross/lm-sensors/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PKG_NAME = lm-sensors
PKG_VERS = 3.6.0
PKG_DIST_VERS = $(subst .,-,$(PKG_VERS))
PKG_EXT = tar.gz
PKG_DIST_NAME = V$(PKG_DIST_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/lm-sensors/lm-sensors/archive
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_DIST_VERS)

DEPENDS =

HOMEPAGE = https://hwmon.wiki.kernel.org/
COMMENT = lm-sensors provides user-space support for the hardware monitoring drivers in Linux 2.6.5 and later.
LICENSE = GPLv2

# run make install only
CONFIGURE_TARGET = nop
COMPILE_TARGET = nop
INSTALL_MAKE_OPTIONS = install DESTDIR=$(INSTALL_DIR) PREFIX=$(INSTALL_PREFIX) ETCDIR=$(INSTALL_PREFIX_VAR) BUILD_STATIC_LIB=0

include ../../mk/spksrc.cross-cc.mk
8 changes: 8 additions & 0 deletions cross/lm-sensors/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bin:bin/sensors
rsc:bin/sensors-conf-convert
lnk:lib/libsensors.so
lnk:lib/libsensors.so.5
lib:lib/libsensors.so.5.0.0
rsc:sbin/fancontrol
rsc:sbin/sensors-detect
rsc:var/sensors3.conf
3 changes: 3 additions & 0 deletions cross/lm-sensors/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lm-sensors-3.6.0.tar.gz SHA1 2ef03242b62d70523919d06859503f12feb9f7d4
lm-sensors-3.6.0.tar.gz SHA256 0591f9fa0339f0d15e75326d0365871c2d4e2ed8aa1ff759b3a55d3734b7d197
lm-sensors-3.6.0.tar.gz MD5 f60e47b5eb50bbeed48a9f43bb08dd5e
56 changes: 56 additions & 0 deletions cross/lm-sensors/patches/001-make-makefile-configurable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#
# Enable overwrite of some hard coded variables.
#
--- Makefile.orig 2019-10-17 15:43:18.000000000 +0000
+++ Makefile 2024-04-27 08:47:02.186270689 +0000
@@ -39,17 +39,17 @@

# If you want to install at some other place then at from which you will run
# everything, set DESTDIR to the extra prefix.
-DESTDIR :=
+DESTDIR ?=

# This is the prefix that will be used for almost all directories below.
-PREFIX := /usr/local
+PREFIX ?= /usr/local

# Your C compiler
-CC := gcc
+CC ?= gcc

# This is the directory where sensors3.conf will be installed, if no other
# configuration file is found
-ETCDIR := /etc
+ETCDIR ?= /etc

# You should not need to change this. It is the directory into which the
# library files (both static and shared) will be installed.
@@ -77,13 +77,13 @@
# manual pages will be installed.
MANDIR := $(PREFIX)/man

-ARCH := $(firstword $(subst -, ,$(shell $(CC) -dumpmachine)))
+ARCH ?= $(firstword $(subst -, ,$(shell $(CC) -dumpmachine)))

# Extra non-default programs to build; e.g., sensord
#PROG_EXTRA := sensord

# Build and install static library
-BUILD_STATIC_LIB := 1
+BUILD_STATIC_LIB ?= 1

# Set these to add preprocessor or compiler flags, or use
# environment variables
@@ -119,9 +119,9 @@
RMDIR := rmdir
RM := rm -f
MV := mv -f
-BISON := bison
-FLEX := flex
-AR := ar
+BISON ?= bison
+FLEX ?= flex
+AR ?= ar
INSTALL := install
LN := ln -sf
GREP := grep
6 changes: 5 additions & 1 deletion cross/net-snmp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ CONFIGURE_ARGS += --without-sys-location
CONFIGURE_ARGS += --disable-embedded-perl
CONFIGURE_ARGS += --without-perl-modules

ADDITIONAL_CFLAGS = -O2
# enable use of sysctl (with patched configure file)
CONFIGURE_ARGS += ac_cv_NETSNMP_CAN_USE_SYSCTL=yes
ADDITIONAL_CFLAGS = -DNETSNMP_CAN_USE_SYSCTL

ADDITIONAL_CFLAGS += -O2

include ../../mk/spksrc.cross-cc.mk
110 changes: 110 additions & 0 deletions cross/net-snmp/patches/001-configure-fix-version-enable-sysctl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# 1. remove ".pre2" from version
# configure.ac and configure still defined version "5.9.4.pre2" instead of "5.9.4"
# 2. remove cross_compile check to use sysctl
# allow NETSNMP_CAN_USE_SYSCTL with ac_cv_NETSNMP_CAN_USE_SYSCTL=yes
#
--- configure.orig 2023-08-15 20:32:24.000000000 +0000
+++ configure 2024-06-22 08:21:11.991222691 +0000
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Revision.
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for Net-SNMP 5.9.4.pre2.
+# Generated by GNU Autoconf 2.71 for Net-SNMP 5.9.4.
#
# Report bugs to <[email protected]>.
#
@@ -622,8 +622,8 @@
# Identity of this package.
PACKAGE_NAME='Net-SNMP'
PACKAGE_TARNAME='net-snmp'
-PACKAGE_VERSION='5.9.4.pre2'
-PACKAGE_STRING='Net-SNMP 5.9.4.pre2'
+PACKAGE_VERSION='5.9.4'
+PACKAGE_STRING='Net-SNMP 5.9.4'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

@@ -1673,7 +1673,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures Net-SNMP 5.9.4.pre2 to adapt to many kinds of systems.
+\`configure' configures Net-SNMP 5.9.4 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

@@ -1740,7 +1740,7 @@

if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Net-SNMP 5.9.4.pre2:";;
+ short | recursive ) echo "Configuration of Net-SNMP 5.9.4:";;
esac
cat <<\_ACEOF

@@ -1859,7 +1859,7 @@
libraries (eg, HPUX)
--with-features-of=version
Compile in MIB modules and other features as if this
- was release "version" (default is 5.9.4.pre2).
+ was release "version" (default is 5.9.4).

Miscellaneous:
--with-defaults Use defaults for prompted values.
@@ -2184,7 +2184,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Net-SNMP configure 5.9.4.pre2
+Net-SNMP configure 5.9.4
generated by GNU Autoconf 2.71

Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2978,7 +2978,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

-It was created by Net-SNMP $as_me 5.9.4.pre2, which was
+It was created by Net-SNMP $as_me 5.9.4, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ $0$ac_configure_args_raw
@@ -36555,10 +36555,6 @@
# Check whether sysctl() is usable
# used in library/agent
#
-if test $cross_compiling = yes; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Can't check sysctl, manually define NETSNMP_CAN_USE_SYSCTL if platform support available" >&5
-printf "%s\n" "$as_me: WARNING: Can't check sysctl, manually define NETSNMP_CAN_USE_SYSCTL if platform support available" >&2;}
-else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sysctl can read kernel information" >&5
printf %s "checking if sysctl can read kernel information... " >&6; }
if test ${ac_cv_NETSNMP_CAN_USE_SYSCTL+y}
@@ -36619,7 +36615,7 @@
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_NETSNMP_CAN_USE_SYSCTL" >&5
printf "%s\n" "$ac_cv_NETSNMP_CAN_USE_SYSCTL" >&6; }
-fi
+

if test "x$ac_cv_NETSNMP_CAN_USE_SYSCTL" = "xyes"; then

@@ -37648,7 +37644,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by Net-SNMP $as_me 5.9.4.pre2, which was
+This file was extended by Net-SNMP $as_me 5.9.4, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
@@ -37716,7 +37712,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-Net-SNMP config.status 5.9.4.pre2
+Net-SNMP config.status 5.9.4
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

19 changes: 19 additions & 0 deletions diyspk/lm-sensors/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SPK_NAME = lm-sensors
SPK_VERS = 3.6.0
SPK_REV = 1

DEPENDS = cross/lm-sensors

SPK_DEPENDS = Perl

MAINTAINER = hgy59
DESCRIPTION = lm-sensors provides user-space support for the hardware monitoring drivers in Linux 2.6.5 and later.
DISPLAY_NAME = lm-sensors
STARTABLE = no

HOMEPAGE = https://hwmon.wiki.kernel.org/
LICENSE = GPLv2

SPK_COMMANDS = bin/sensors bin/sensors-conf-convert sbin/fancontrol sbin/sensors-detect

include ../../mk/spksrc.spk.mk
15 changes: 8 additions & 7 deletions spk/synocli-monitor/Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
SPK_NAME = synocli-monitor
SPK_VERS = 1.6
SPK_REV = 8
SPK_VERS = 1.7
SPK_REV = 9
SPK_ICON = src/synocli-monitor.png

DEPENDS = cross/nmon cross/njmon
DEPENDS += cross/iperf2 cross/iperf3
DEPENDS += cross/busybox
DEPENDS += cross/ionice
DEPENDS += cross/lsof
DEPENDS += cross/htop
DEPENDS += cross/cpulimit
DEPENDS += cross/net-snmp
DEPENDS += cross/lm-sensors

OPTIONAL_DEPENDS = cross/bandwhich cross/bottom cross/procs

BUSYBOX_CONFIG = ionice

include ../../mk/spksrc.common.mk
ifeq ($(call version_lt,${TCVERSION},6.0)$(call version_gt,${TCVERSION},2.0),11)
# include process utilities including pstree for DSM<6 and DSM>2
BUSYBOX_CONFIG += procutils.dsm5
BUSYBOX_CONFIG = procutils.dsm5
OPTIONAL_DESC = ", and process utilities \(lsof, iostat, pgrep, pmap, pstree, watch\)"
else
BUSYBOX_CONFIG += procutils
BUSYBOX_CONFIG = procutils
OPTIONAL_DESC = ", and process utilities \(lsof, iostat, pgrep, pmap, watch\)"
endif

Expand All @@ -34,7 +34,7 @@ MAINTAINER = hgy59
DESCRIPTION = SynoCli Monitor Tools provides a set of command-line utilities for system monitoring: nmon, njmon, iperf2, iperf3, htop, ionice, cpulimit, net-snmp tools$(OPTIONAL_DESC).
DISPLAY_NAME = SynoCli Monitor Tools
STARTABLE = no
CHANGELOG = "1. Add actual lsof and drop lsof of busybox.<br/>2. Update bandwhich to v0.22.2.<br/>3. Update bottom to v0.9.6.<br/>4. Update htop to v3.3.0.<br/>5. Update iperf2 to v2.3.0 and iperf3 to v3.17.1 (some models are limited to older iperf3 version).<br/>6. Update net-snmp v5.9.4.<br/>7. Update procs to v0.14.5.<br/>8. Update openssl to v3.1."
CHANGELOG = "1. Add lm-sensors<br/>2. Add ionice (util-linux) and drop ionice of busybox.<br/>3. Fix net-snmp version number."

HOMEPAGE = https://github.com/SynoCommunity/spksrc/wiki/FAQ-SynoCliMonitor
LICENSE = Each tool is licensed under it\'s respective license.
Expand All @@ -55,5 +55,6 @@ SPK_COMMANDS += bin/btm
SPK_COMMANDS += bin/procs
SPK_COMMANDS += bin/snmpget bin/snmpgetnext bin/snmpbulkget bin/snmpwalk bin/snmpbulkwalk bin/snmpdelta bin/snmpdf
SPK_COMMANDS += bin/snmpinform bin/snmpnetstat bin/snmpps bin/snmpstatus bin/snmptable bin/snmptest bin/snmptranslate
SPK_COMMANDS += bin/sensors bin/sensors-conf-convert sbin/fancontrol sbin/sensors-detect

include ../../mk/spksrc.spk.mk

0 comments on commit 6694c06

Please sign in to comment.