diff options
| author | Portia <stephensportia@gmail.com> | 2022-05-01 13:45:33 +1000 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2022-05-02 00:48:27 -0700 |
| commit | bc4448f4619b436ee0f66e2bdd37d42d65f75656 (patch) | |
| tree | 1aa6f962e6ad5042f1f33f053247bde5073924cc | |
| parent | 00f18248b93e0377d5e8a56fa2f7c859a39f661f (diff) | |
| download | meta-openembedded-bc4448f4619b436ee0f66e2bdd37d42d65f75656.tar.gz | |
cpulimit: introduce support for this package
Now, cpulimit recipe is put under recipes-support. Binary will be
installed by the recipe under /usr/sbin
# cpulimit -h
Usage: cpulimit [OPTIONS...] TARGET
OPTIONS
-l, --limit=N percentage of cpu allowed from 0
to 100
(required)
-v, --verbose show control statistics
-z, --lazy exit if there is no target
process, or
if it dies
-i, --include-children limit also the children
processes
-h, --help display this help and exit
TARGET must be exactly one of these:
-p, --pid=N pid of the process (implies -z)
-e, --exe=FILE name of the executable program
file or
path name
COMMAND [ARGS] run this command and limit it
(implies
-z)
Report bugs to <marlon...@hotmail.com>.
Signed-off-by: Bassem Boubaker <bassem.boubaker@actia.fr>
[ Changes by Portia
- Fix build issue, deprecated and missing includes
- Add branch to git repo in SRC_URI
- Update LICENSE to GPL-2.0-or-later
]
Signed-off-by: Portia <stephensportia@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-support/cpulimit/cpulimit/0001-Remove-sys-sysctl.h-and-add-missing-libgen.h-include.patch | 41 | ||||
| -rw-r--r-- | meta-oe/recipes-support/cpulimit/cpulimit_0.2.bb | 22 |
2 files changed, 63 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/cpulimit/cpulimit/0001-Remove-sys-sysctl.h-and-add-missing-libgen.h-include.patch b/meta-oe/recipes-support/cpulimit/cpulimit/0001-Remove-sys-sysctl.h-and-add-missing-libgen.h-include.patch new file mode 100644 index 0000000000..50d0342ec7 --- /dev/null +++ b/meta-oe/recipes-support/cpulimit/cpulimit/0001-Remove-sys-sysctl.h-and-add-missing-libgen.h-include.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | From 41cfba0840f58555593fd4bee07db77221043e0b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Portia <stephensportia@gmail.com> | ||
| 3 | Date: Sun, 1 May 2022 12:43:35 +1000 | ||
| 4 | Subject: [PATCH] Remove sys/sysctl.h and add missing libgen.h include | ||
| 5 | |||
| 6 | - sys/sysctl.h has been deprecated and should be removed | ||
| 7 | - Adds missing libgen.h include when calling basename() | ||
| 8 | |||
| 9 | Upstream-Status: Inactive-Upstream [2015] | ||
| 10 | Signed-off-by: Portia <stephensportia@gmail.com> | ||
| 11 | --- | ||
| 12 | src/cpulimit.c | 1 - | ||
| 13 | src/process_group.c | 1 + | ||
| 14 | 2 files changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/src/cpulimit.c b/src/cpulimit.c | ||
| 17 | index 50eabea..5b0ec49 100644 | ||
| 18 | --- a/src/cpulimit.c | ||
| 19 | +++ b/src/cpulimit.c | ||
| 20 | @@ -38,7 +38,6 @@ | ||
| 21 | #include <string.h> | ||
| 22 | #include <sys/stat.h> | ||
| 23 | #include <sys/time.h> | ||
| 24 | -#include <sys/sysctl.h> | ||
| 25 | #include <sys/resource.h> | ||
| 26 | #include <sys/types.h> | ||
| 27 | #include <sys/wait.h> | ||
| 28 | diff --git a/src/process_group.c b/src/process_group.c | ||
| 29 | index 06d73a6..d4f6fab 100644 | ||
| 30 | --- a/src/process_group.c | ||
| 31 | +++ b/src/process_group.c | ||
| 32 | @@ -24,6 +24,7 @@ | ||
| 33 | #include <limits.h> | ||
| 34 | #include <sys/time.h> | ||
| 35 | #include <signal.h> | ||
| 36 | +#include <libgen.h> | ||
| 37 | |||
| 38 | #include <assert.h> | ||
| 39 | |||
| 40 | -- | ||
| 41 | 2.25.1 | ||
diff --git a/meta-oe/recipes-support/cpulimit/cpulimit_0.2.bb b/meta-oe/recipes-support/cpulimit/cpulimit_0.2.bb new file mode 100644 index 0000000000..3ee2b5c239 --- /dev/null +++ b/meta-oe/recipes-support/cpulimit/cpulimit_0.2.bb | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | SUMMARY = "cpulimit is a tool which limits the CPU usage of a process" | ||
| 2 | HOMEPAGE = "http://cpulimit.sourceforge.net" | ||
| 3 | LICENSE = "GPL-2.0-or-later" | ||
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86c1c0d961a437e529db93aa3bb32dc4" | ||
| 5 | SRCREV ?= "f4d2682804931e7aea02a869137344bb5452a3cd" | ||
| 6 | |||
| 7 | SRC_URI = "git://g...@github.com/opsengine/cpulimit.git;protocol=https;branch=master \ | ||
| 8 | file://0001-Remove-sys-sysctl.h-and-add-missing-libgen.h-include.patch \ | ||
| 9 | " | ||
| 10 | |||
| 11 | S = "${WORKDIR}/git" | ||
| 12 | |||
| 13 | do_compile() { | ||
| 14 | oe_runmake all | ||
| 15 | } | ||
| 16 | do_install() { | ||
| 17 | install -d ${D}${sbindir} | ||
| 18 | install -m 0755 ${B}/src/${PN} ${D}${sbindir}/ | ||
| 19 | } | ||
| 20 | |||
| 21 | CFLAGS += "${LDFLAGS}" | ||
| 22 | |||
