]> git.99rst.org Git - openwrt-packages.git/commitdiff
stress-ng: add config menu to select external libraries
authorAlexandru Ardelean <redacted>
Fri, 10 Jul 2026 06:41:16 +0000 (09:41 +0300)
committerAlexandru Ardelean <redacted>
Mon, 13 Jul 2026 11:24:42 +0000 (14:24 +0300)
Backport upstream e0c4d324a, which lets a LIB_* variable be emptied to skip
that library's check. Drop 001-disable-extra-stressors.patch, which hardcoded
the same choice, and drive it from a Config.in menu instead. Defaults keep the
previously built set of stressors: only crypt, aio, bsd, jpeg, kmod, sctp and
zlib are probed. apparmor, EGL, GBM, GLES2, IPSec_MB and Judy have no OpenWrt
package, so they are never probed. Drop the backport once it is in a release.

Signed-off-by: Alexandru Ardelean <redacted>
utils/stress-ng/Config.in [new file with mode: 0644]
utils/stress-ng/Makefile
utils/stress-ng/patches/001-allow-external-library-checks-to-be-disabled.patch [new file with mode: 0644]
utils/stress-ng/patches/001-disable-extra-stressors.patch [deleted file]

diff --git a/utils/stress-ng/Config.in b/utils/stress-ng/Config.in
new file mode 100644 (file)
index 0000000..8b7371d
--- /dev/null
@@ -0,0 +1,62 @@
+menu "Configuration"
+
+comment "Stressors that need an external library"
+
+config STRESS_NG_LIB_ACL
+       bool "libacl - POSIX access control list stressors"
+       default n
+
+config STRESS_NG_LIB_AIO
+       bool "libaio - asynchronous I/O stressors"
+       default y
+
+config STRESS_NG_LIB_APPARMOR
+       bool "libapparmor - AppArmor stressors"
+       default n
+
+config STRESS_NG_LIB_BSD
+       bool "libbsd - BSD compatibility stressors"
+       default y
+
+config STRESS_NG_LIB_CRYPT
+       bool "libcrypt - password hashing stressors"
+       default y
+
+config STRESS_NG_LIB_GMP
+       bool "libgmp - multiple-precision integer stressors"
+       default n
+
+config STRESS_NG_LIB_JPEG
+       bool "libjpeg - JPEG compression stressors"
+       default y
+
+config STRESS_NG_LIB_KMOD
+       bool "libkmod - kernel module stressors"
+       default y
+
+config STRESS_NG_LIB_LZMA
+       bool "liblzma - LZMA compression stressors"
+       default n
+
+config STRESS_NG_LIB_MD
+       bool "libmd - message digest stressors"
+       default n
+
+config STRESS_NG_LIB_MPFR
+       bool "libmpfr - multiple-precision float stressors"
+       select STRESS_NG_LIB_GMP
+       default n
+
+config STRESS_NG_LIB_SCTP
+       bool "libsctp - SCTP network stressors"
+       default y
+
+config STRESS_NG_LIB_XXHASH
+       bool "libxxhash - xxhash digest stressors"
+       default n
+
+config STRESS_NG_LIB_Z
+       bool "zlib - zlib compression stressors"
+       default y
+
+endmenu
index b55bdd6ad4d28c61bef04a513c1364da3b16e59f..e80b91c3178814cc23857382476cba6cb982312c 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=stress-ng
 PKG_VERSION:=0.21.03
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/ColinIanKing/stress-ng/tar.gz/refs/tags/V$(PKG_VERSION)?
@@ -29,20 +29,50 @@ define Package/stress-ng
   CATEGORY:=Utilities
   TITLE:=stress-ng is a stress test utility
   URL:=https://github.com/ColinIanKing/stress-ng
-  DEPENDS:=+zlib +libbsd +libaio +libsctp +libkmod +libatomic +libjpeg +USE_GLIBC:libcrypt-compat
+  DEPENDS:=+libatomic \
+          +USE_GLIBC:libcrypt-compat \
+          +STRESS_NG_LIB_ACL:libacl \
+          +STRESS_NG_LIB_AIO:libaio \
+          +STRESS_NG_LIB_APPARMOR:libapparmor \
+          +STRESS_NG_LIB_BSD:libbsd \
+          +STRESS_NG_LIB_GMP:libgmp \
+          +STRESS_NG_LIB_JPEG:libjpeg \
+          +STRESS_NG_LIB_KMOD:libkmod \
+          +STRESS_NG_LIB_LZMA:liblzma \
+          +STRESS_NG_LIB_MD:libmd \
+          +STRESS_NG_LIB_MPFR:libmpfr \
+          +STRESS_NG_LIB_SCTP:libsctp \
+          +STRESS_NG_LIB_XXHASH:libxxhash \
+          +STRESS_NG_LIB_Z:zlib
   PROVIDES:=stress
 endef
 
+define Package/stress-ng/config
+       source "$(SOURCE)/Config.in"
+endef
+
 define Package/stress-ng/description
 stress-ng will stress test a computer system in various selectable ways. It
 was designed to exercise various physical subsystems of a computer as well as
 the various operating system kernel interfaces.
 endef
 
+STRESS_NG_LIBS:=ACL AIO APPARMOR BSD CRYPT GMP JPEG KMOD LZMA MD MPFR SCTP XXHASH Z
+
 MAKE_FLAGS += \
        KERNEL=Linux \
        LIB_ATOMIC=-latomic
 
+# No OpenWrt package provides these, so never probe for them
+MAKE_FLAGS += \
+       LIB_EGL= \
+       LIB_GBM= \
+       LIB_GLES2= \
+       LIB_IPSEC_MB= \
+       LIB_JUDY=
+
+MAKE_FLAGS += $(foreach l,$(STRESS_NG_LIBS),$(if $(CONFIG_STRESS_NG_LIB_$(l)),,LIB_$(l)=))
+
 define Package/stress-ng/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stress-ng $(1)/usr/bin/
diff --git a/utils/stress-ng/patches/001-allow-external-library-checks-to-be-disabled.patch b/utils/stress-ng/patches/001-allow-external-library-checks-to-be-disabled.patch
new file mode 100644 (file)
index 0000000..a4ff971
--- /dev/null
@@ -0,0 +1,141 @@
+From e0c4d324a0f0006fa090b8370989a03ecb28e334 Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <alex@shruggie.ro>
+Date: Thu, 9 Jul 2026 17:41:34 +0300
+Subject: [PATCH] Makefile.config: allow external library checks to be
+ disabled
+
+Emptying a LIB_* variable now skips the check, so builds can opt out of
+stressors that pull in external library dependencies.
+---
+--- a/Makefile.config
++++ b/Makefile.config
+@@ -161,6 +161,36 @@ define check
+ endef
+ #
++#  check_lib
++#     as check, but for an external library. If the library's LIB_* variable
++#     has been emptied, e.g. "make LIB_ACL=", the check is skipped and the
++#     library is reported as unused. This allows builds to opt out of
++#     stressors that pull in external library dependencies.
++#
++# $1 = test program
++# $2 = HAVE config name
++# $3 = "using" message
++# $4 = libraries required, empty if the library has been disabled
++# $5 = cflags required for test
++#
++define check_lib
++      $(if $(strip $(4)),$(call check,$1,$2,$3,$4,$5),@echo "using $(3) ... no")
++endef
++
++#
++#  check_lib_apparmor
++#     as check_lib, but for the apparmor library check
++#
++# $1 = test program
++# $2 = HAVE config name
++# $3 = "using" message
++# $4 = libraries required, empty if the library has been disabled
++#
++define check_lib_apparmor
++      $(if $(strip $(4)),$(call check_apparmor,$1,$2,$3,$4),@echo "using $(3) ... no")
++endef
++
++#
+ # $1 = test program
+ # $2 = HAVE config name
+ # $3 = "using" message
+@@ -378,56 +408,52 @@ libraries: \
+       LIB_RT LIB_SCTP LIB_XXHASH LIB_Z LIB_LZMA
+ LIB_ACL:
+-      $(call check,test-libacl,HAVE_LIB_ACL,$(LIB_ACL),$(LIB_ACL))
++      $(call check_lib,test-libacl,HAVE_LIB_ACL,-lacl,$(LIB_ACL))
+ LIB_AIO:
+-      $(call check,test-libaio,HAVE_LIB_AIO,$(LIB_AIO),$(LIB_AIO))
++      $(call check_lib,test-libaio,HAVE_LIB_AIO,-laio,$(LIB_AIO))
+ LIB_APPARMOR:
+-      $(call check_apparmor,test-apparmor,HAVE_APPARMOR,$(LIB_APPARMOR),$(LIB_APPARMOR))
++      $(call check_lib_apparmor,test-apparmor,HAVE_APPARMOR,-lapparmor,$(LIB_APPARMOR))
+ LIB_BSD:
+-ifeq ($(LIB_BSD),)
+-      @echo using -lbsd ... no
+-else
+-      $(call check,test-libbsd,HAVE_LIB_BSD,$(LIB_BSD),$(LIB_BSD))
+-endif
++      $(call check_lib,test-libbsd,HAVE_LIB_BSD,-lbsd,$(LIB_BSD))
+ LIB_CRYPT:
+-      $(call check,test-libcrypt,HAVE_LIB_CRYPT,$(LIB_CRYPT),$(LIB_CRYPT))
++      $(call check_lib,test-libcrypt,HAVE_LIB_CRYPT,-lcrypt,$(LIB_CRYPT))
+ LIB_DL:
+       $(call check,test-libdl,HAVE_LIB_DL,$(LIB_DL),$(LIB_DL))
+ LIB_EGL:
+-      $(call check,test-libegl,HAVE_LIB_EGL,$(LIB_EGL),$(LIB_EGL))
++      $(call check_lib,test-libegl,HAVE_LIB_EGL,-lEGL,$(LIB_EGL))
+ LIB_GBM:
+-      $(call check,test-libgbm,HAVE_LIB_GBM,$(LIB_GBM),$(LIB_GBM))
++      $(call check_lib,test-libgbm,HAVE_LIB_GBM,-lgbm,$(LIB_GBM))
+ LIB_GLES2:
+-      $(call check,test-libgles,HAVE_LIB_GLES2,$(LIB_GLES2),$(LIB_GLES2))
++      $(call check_lib,test-libgles,HAVE_LIB_GLES2,-lGLESv2,$(LIB_GLES2))
+ LIB_GMP:
+-      $(call check,test-libgmp,HAVE_LIB_GMP,$(LIB_GMP),$(LIB_GMP))
++      $(call check_lib,test-libgmp,HAVE_LIB_GMP,-lgmp,$(LIB_GMP))
+ LIB_IPSEC_MB:
+-      $(call check,test-libipsec-mb,HAVE_LIB_IPSEC_MB,$(LIB_IPSEC_MB),$(LIB_IPSEC_MB))
++      $(call check_lib,test-libipsec-mb,HAVE_LIB_IPSEC_MB,-lIPSec_MB,$(LIB_IPSEC_MB))
+ LIB_JPEG:
+-      $(call check,test-libjpeg,HAVE_LIB_JPEG,$(LIB_JPEG),$(LIB_JPEG))
++      $(call check_lib,test-libjpeg,HAVE_LIB_JPEG,-ljpeg,$(LIB_JPEG))
+ LIB_JUDY:
+-      $(call check,test-judy,HAVE_LIB_JUDY,$(LIB_JUDY),$(LIB_JUDY))
++      $(call check_lib,test-judy,HAVE_LIB_JUDY,-lJudy,$(LIB_JUDY))
+ LIB_KMOD:
+-      $(call check,test-libkmod,HAVE_LIB_KMOD,$(LIB_KMOD),$(LIB_KMOD))
++      $(call check_lib,test-libkmod,HAVE_LIB_KMOD,-lkmod,$(LIB_KMOD))
+ LIB_MD:
+-      $(call check,test-libmd,HAVE_LIB_MD,$(LIB_MD),$(LIB_MD))
++      $(call check_lib,test-libmd,HAVE_LIB_MD,-lmd,$(LIB_MD))
+ LIB_MPFR:
+-      $(call check,test-libmpfr,HAVE_LIB_MPFR,$(LIB_MPFR),$(LIB_MPFR) $(LIB_GMP))
++      $(call check_lib,test-libmpfr,HAVE_LIB_MPFR,-lmpfr,$(if $(LIB_MPFR),$(LIB_MPFR) $(LIB_GMP)))
+ LIB_PTHREAD:
+       $(call check,test-libpthread,HAVE_LIB_PTHREAD,$(LIB_PTHREAD),$(LIB_PTHREAD))
+@@ -439,16 +465,16 @@ LIB_RT:
+       $(call check,test-librt,HAVE_LIB_RT,$(LIB_RT),$(LIB_RT))
+ LIB_SCTP:
+-      $(call check,test-libsctp,HAVE_LIB_SCTP,$(LIB_SCTP),$(LIB_SCTP))
++      $(call check_lib,test-libsctp,HAVE_LIB_SCTP,-lsctp,$(LIB_SCTP))
+ LIB_XXHASH:
+-      $(call check,test-libxxhash,HAVE_LIB_XXHASH,$(LIB_XXHASH),$(LIB_XXHASH))
++      $(call check_lib,test-libxxhash,HAVE_LIB_XXHASH,-lxxhash,$(LIB_XXHASH))
+ LIB_Z:
+-      $(call check,test-libz,HAVE_LIB_Z,$(LIB_Z),$(LIB_Z))
++      $(call check_lib,test-libz,HAVE_LIB_Z,-lz,$(LIB_Z))
+ LIB_LZMA:
+-      $(call check,test-liblzma,HAVE_LIB_LZMA,$(LIB_LZMA),$(LIB_LZMA))
++      $(call check_lib,test-liblzma,HAVE_LIB_LZMA,-llzma,$(LIB_LZMA))
+ .PHONY: headers
+ headers: \
diff --git a/utils/stress-ng/patches/001-disable-extra-stressors.patch b/utils/stress-ng/patches/001-disable-extra-stressors.patch
deleted file mode 100644 (file)
index 5d8118a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/Makefile.config
-+++ b/Makefile.config
-@@ -372,10 +372,10 @@ clean:
- .PHONY: libraries
- libraries: \
-       configdir \
--      LIB_ACL LIB_AIO LIB_APPARMOR LIB_BSD LIB_CRYPT LIB_DL \
--      LIB_EGL LIB_GBM LIB_GLES2 LIB_GMP LIB_IPSEC_MB LIB_JPEG \
--      LIB_JUDY LIB_KMOD LIB_MD LIB_MPFR LIB_PTHREAD LIB_PTHREAD_SPINLOCK \
--      LIB_RT LIB_SCTP LIB_XXHASH LIB_Z LIB_LZMA
-+      LIB_AIO LIB_APPARMOR LIB_BSD LIB_CRYPT LIB_DL \
-+      LIB_IPSEC_MB LIB_JPEG \
-+      LIB_JUDY LIB_KMOD LIB_MD LIB_PTHREAD LIB_PTHREAD_SPINLOCK \
-+      LIB_RT LIB_SCTP LIB_Z
- LIB_ACL:
-       $(call check,test-libacl,HAVE_LIB_ACL,$(LIB_ACL),$(LIB_ACL))
git clone https://git.99rst.org/PROJECT