[OE-core] [PATCH] stress-ng: add a recipe that replaces the original stress

Alexander Kanavin alex.kanavin at gmail.com
Tue Jul 30 16:47:42 UTC 2019


The original stress is no longer maintained and the homepage
went down. This commit replaces it with a maintained
re-implementation by Ubuntu.

Stress-ng preserves command line option compatibility
(for the options that are used in rt-tests), so adjustment
is simply changing the name of the executable. Rt-tests is the only
user of stress(-ng) in oe-core.

Signed-off-by: Alexander Kanavin <alex.kanavin at gmail.com>
---
 meta/conf/distro/include/maintainers.inc      |  2 +-
 ...ownership-when-installing-example-jo.patch | 23 ++++++
 .../stress-ng/stress-ng_0.10.00.bb            | 20 +++++
 .../stress/files/texinfo.patch                | 80 -------------------
 meta/recipes-extended/stress/stress_1.0.4.bb  | 15 ----
 meta/recipes-rt/rt-tests/files/rt_bmark.py    |  2 +-
 meta/recipes-rt/rt-tests/rt-tests_1.1.bb      |  2 +-
 7 files changed, 46 insertions(+), 98 deletions(-)
 create mode 100644 meta/recipes-extended/stress-ng/stress-ng/0001-Do-not-preserve-ownership-when-installing-example-jo.patch
 create mode 100644 meta/recipes-extended/stress-ng/stress-ng_0.10.00.bb
 delete mode 100644 meta/recipes-extended/stress/files/texinfo.patch
 delete mode 100644 meta/recipes-extended/stress/stress_1.0.4.bb

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 3d5ab9dcd6c..77af8b6dad8 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -661,7 +661,7 @@ RECIPE_MAINTAINER_pn-sqlite3 = "Anuj Mittal <anuj.mittal at intel.com>"
 RECIPE_MAINTAINER_pn-squashfs-tools = "Robert Yang <liezhi.yang at windriver.com>"
 RECIPE_MAINTAINER_pn-startup-notification = "Alexander Kanavin <alex.kanavin at gmail.com>"
 RECIPE_MAINTAINER_pn-strace = "Robert Yang <liezhi.yang at windriver.com>"
-RECIPE_MAINTAINER_pn-stress = "Anuj Mittal <anuj.mittal at intel.com>"
+RECIPE_MAINTAINER_pn-stress-ng = "Anuj Mittal <anuj.mittal at intel.com>"
 RECIPE_MAINTAINER_pn-subversion = "Richard Purdie <richard.purdie at linuxfoundation.org>"
 RECIPE_MAINTAINER_pn-sudo = "Chen Qi <Qi.Chen at windriver.com>"
 RECIPE_MAINTAINER_pn-swig = "Anuj Mittal <anuj.mittal at intel.com>"
diff --git a/meta/recipes-extended/stress-ng/stress-ng/0001-Do-not-preserve-ownership-when-installing-example-jo.patch b/meta/recipes-extended/stress-ng/stress-ng/0001-Do-not-preserve-ownership-when-installing-example-jo.patch
new file mode 100644
index 00000000000..c860c717ac4
--- /dev/null
+++ b/meta/recipes-extended/stress-ng/stress-ng/0001-Do-not-preserve-ownership-when-installing-example-jo.patch
@@ -0,0 +1,23 @@
+From bbc85a439672120fa1d36be79e959b28fe840919 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin at gmail.com>
+Date: Tue, 30 Jul 2019 18:38:03 +0200
+Subject: [PATCH] Do not preserve ownership when installing example jobs
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin at gmail.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index f36e57e..20488af 100644
+--- a/Makefile
++++ b/Makefile
+@@ -452,6 +452,6 @@ install: stress-ng stress-ng.1.gz
+ 	mkdir -p ${DESTDIR}${MANDIR}
+ 	cp stress-ng.1.gz ${DESTDIR}${MANDIR}
+ 	mkdir -p ${DESTDIR}${JOBDIR}
+-	cp -rp example-jobs/*.job ${DESTDIR}${JOBDIR}
++	cp -r example-jobs/*.job ${DESTDIR}${JOBDIR}
+ 	mkdir -p ${DESTDIR}${BASHDIR}
+ 	cp bash-completion/stress-ng ${DESTDIR}${BASHDIR}
diff --git a/meta/recipes-extended/stress-ng/stress-ng_0.10.00.bb b/meta/recipes-extended/stress-ng/stress-ng_0.10.00.bb
new file mode 100644
index 00000000000..f7faf97e681
--- /dev/null
+++ b/meta/recipes-extended/stress-ng/stress-ng_0.10.00.bb
@@ -0,0 +1,20 @@
+SUMMARY = "System load testing utility"
+DESCRIPTION = "Deliberately simple workload generator for POSIX systems. It \
+imposes a configurable amount of CPU, memory, I/O, and disk stress on the system."
+HOMEPAGE = "https://kernel.ubuntu.com/~cking/stress-ng/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "https://kernel.ubuntu.com/~cking/tarballs/${BPN}/${BP}.tar.xz \
+           file://0001-Do-not-preserve-ownership-when-installing-example-jo.patch \
+           "
+SRC_URI[md5sum] = "46aa41d37690324ceab4febfcc549018"
+SRC_URI[sha256sum] = "d09dd2a1aea549e478995bf9be90b38906a4cdf33ea7b245ef9d46aa5213c074"
+
+DEPENDS = "coreutils-native"
+
+inherit bash-completion
+
+do_install() {
+    oe_runmake DESTDIR=${D} install
+}
diff --git a/meta/recipes-extended/stress/files/texinfo.patch b/meta/recipes-extended/stress/files/texinfo.patch
deleted file mode 100644
index f23a1f69c40..00000000000
--- a/meta/recipes-extended/stress/files/texinfo.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-Upstream-Status: Pending
---- a/doc/stress.texi
-+++ b/doc/stress.texi
-@@ -62,47 +62,47 @@
- 
- @table @samp
- @item -?
-- at itemx --help
-+ at item --help
- Show help information.
- 
-- at itemx --version
-+ at item --version
- Show version information.
- 
- @item -v
-- at itemx --verbose
-+ at item --verbose
- Turn up verbosity.
- 
- @item -q
-- at itemx --quiet
-+ at item --quiet
- Turn down verbosity.
- 
- @item -n
-- at itemx --dry-run
-+ at item --dry-run
- Show what would have been done.
- 
- @item -t @var{secs}
-- at itemx --timeout @var{secs}
-+ at item --timeout @var{secs}
- Time out after @var{secs} seconds.
- 
-- at itemx --backoff @var{usecs}
-+ at item --backoff @var{usecs}
- Wait for factor of @var{usecs} microseconds before starting work.
- 
- @item -c @var{forks}
-- at itemx --cpu @var{forks}
-+ at item --cpu @var{forks}
- Spawn @var{forks} processes each spinning on @samp{sqrt()}.
- 
- @item -i @var{forks}
-- at itemx --io @var{forks}
-+ at item --io @var{forks}
- Spawn @var{forks} processes each spinning on @samp{sync()}.
- 
- @item -m @var{forks}
-- at itemx --vm @var{forks}
-+ at item --vm @var{forks}
- Spawn @var{forks} processes each spinning on @samp{malloc()}.
- 
-- at itemx --vm-bytes @var{bytes}
-+ at item --vm-bytes @var{bytes}
- Allocate @var{bytes} number of bytes.  The default is 1.
- 
-- at itemx --vm-hang
-+ at item --vm-hang
- Instruct each vm hog process to go to sleep after allocating memory.  This
- contrasts with their normal behavior, which is to free the memory and
- reallocate @emph{ad infinitum}.  This is useful for simulating low memory
-@@ -114,13 +114,13 @@
- @end example
- 
- @item -d @var{forks}
-- at itemx --hdd @var{forks}
-+ at item --hdd @var{forks}
- Spawn @var{forks} processes each spinning on @samp{write()}.
- 
-- at itemx --hdd-bytes @var{bytes}
-+ at item --hdd-bytes @var{bytes}
- Write @var{bytes} number of bytes.  The default is 1GB.
- 
-- at itemx --hdd-noclean
-+ at item --hdd-noclean
- Do not unlink file(s) to which random ASCII data is written.
- 
- @end table
diff --git a/meta/recipes-extended/stress/stress_1.0.4.bb b/meta/recipes-extended/stress/stress_1.0.4.bb
deleted file mode 100644
index e9179d3e19e..00000000000
--- a/meta/recipes-extended/stress/stress_1.0.4.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "System load testing utility"
-DESCRIPTION = "Deliberately simple workload generator for POSIX systems. It \
-imposes a configurable amount of CPU, memory, I/O, and disk stress on the system."
-HOMEPAGE = "http://people.seas.harvard.edu/~apw/stress/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-SRC_URI = "http://people.seas.harvard.edu/~apw/${BPN}/${BP}.tar.gz \
-           file://texinfo.patch \
-           "
-
-SRC_URI[md5sum] = "890a4236dd1656792f3ef9a190cf99ef"
-SRC_URI[sha256sum] = "057e4fc2a7706411e1014bf172e4f94b63a12f18412378fca8684ca92408825b"
-
-inherit autotools
diff --git a/meta/recipes-rt/rt-tests/files/rt_bmark.py b/meta/recipes-rt/rt-tests/files/rt_bmark.py
index 080a6558935..57b39b52a1e 100755
--- a/meta/recipes-rt/rt-tests/files/rt_bmark.py
+++ b/meta/recipes-rt/rt-tests/files/rt_bmark.py
@@ -130,7 +130,7 @@ def log_test_header(seq_no, nr_of_tests, name):
 #-------------------------------------------------------------------------------
 
 def start_stress(*args):
-        stress_cmd         = [ "stress" ]
+        stress_cmd         = [ "stress-ng" ]
         added_stress_types = []
         req_stress_types   = set(args)
         cpu_cnt            = str(multiprocessing.cpu_count())
diff --git a/meta/recipes-rt/rt-tests/rt-tests_1.1.bb b/meta/recipes-rt/rt-tests/rt-tests_1.1.bb
index 496f04fdbae..b673cd784ff 100644
--- a/meta/recipes-rt/rt-tests/rt-tests_1.1.bb
+++ b/meta/recipes-rt/rt-tests/rt-tests_1.1.bb
@@ -26,6 +26,6 @@ do_install_ptest() {
         cp ${WORKDIR}/rt_bmark.py ${D}${PTEST_PATH}
 }
 
-RDEPENDS_${PN}-ptest += " stress python3 python3-multiprocessing python3-datetime python3-misc"
+RDEPENDS_${PN}-ptest += " stress-ng python3 python3-multiprocessing python3-datetime python3-misc"
 
 FILES_${PN} += "${prefix}/src/backfire"
-- 
2.17.1



More information about the Openembedded-core mailing list