tini: update to v0.19.0

We also switch to _git and add PV to the recipe as we don't need
to exactly track a tag.

We drop patches that have been merged upstream.

Bumping tini to version v0.19.0-15-g369448a, which comprises the following commits:

    369448a Document TINI_KILL_PROCESS_GROUP environment variable
    37ff361 Update README.md.in
    924c4bd Support POSIX basename() from musl libc
    7724cbe Update "ENV key value" format in README
    071c715 chore: allow CMake though to 3.10
    0b44d36 chore: bump minimum CMake to 2.8.12
    a49fdd3 tini.c: a function declaration without a prototype is deprecated in all versions of C
    378bbbc Update keyserver recommendation to Ubuntu
    b9f42a0 Indicate that -e can be repeated

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2025-07-20 22:25:45 -04:00
parent 3b773f4477
commit 69c32e6e65
3 changed files with 2 additions and 153 deletions

View File

@ -1,76 +0,0 @@
From 10479a6eef32f8e64fd5bf894dee9c7a6f21ce4c Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 14 Apr 2024 15:33:51 +0200
Subject: [PATCH] Support POSIX basename() from musl libc
Musl libc 1.2.5 removed the definition of the basename() function from
string.h and only provides it in libgen.h as the POSIX standard
defines it.
This change fixes compilation with musl libc 1.2.5.
````
build_dir/target-mips_24kc_musl/tini-0.19.0/src/tini.c:227:36: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]
227 | fprintf(file, "%s (%s)\n", basename(name), TINI_VERSION_STRING);
build_dir/target-mips_24kc_musl/tini-0.19.0/src/tini.c:227:25: error: format '%s' expects argument of type 'char *', but argument 3 has type 'int' [-Werror=format=]
227 | fprintf(file, "%s (%s)\n", basename(name), TINI_VERSION_STRING);
| ~^ ~~~~~~~~~~~~~~
| | |
| char * int
| %d
````
basename() modifies the input string, copy it first with strdup(), If
strdup() returns NULL the code will handle it.
Upstream-Status: Submitted [https://github.com/krallin/tini/pull/223]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
src/tini.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/tini.c b/src/tini.c
index 7914d3a..41d1506 100644
--- a/src/tini.c
+++ b/src/tini.c
@@ -14,6 +14,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
+#include <libgen.h>
#include "tiniConfig.h"
#include "tiniLicense.h"
@@ -224,14 +225,19 @@ int spawn(const signal_configuration_t* const sigconf_ptr, char* const argv[], i
}
void print_usage(char* const name, FILE* const file) {
- fprintf(file, "%s (%s)\n", basename(name), TINI_VERSION_STRING);
+ char *dirc, *bname;
+
+ dirc = strdup(name);
+ bname = basename(dirc);
+
+ fprintf(file, "%s (%s)\n", bname, TINI_VERSION_STRING);
#if TINI_MINIMAL
- fprintf(file, "Usage: %s PROGRAM [ARGS] | --version\n\n", basename(name));
+ fprintf(file, "Usage: %s PROGRAM [ARGS] | --version\n\n", bname);
#else
- fprintf(file, "Usage: %s [OPTIONS] PROGRAM -- [ARGS] | --version\n\n", basename(name));
+ fprintf(file, "Usage: %s [OPTIONS] PROGRAM -- [ARGS] | --version\n\n", bname);
#endif
- fprintf(file, "Execute a program under the supervision of a valid init process (%s)\n\n", basename(name));
+ fprintf(file, "Execute a program under the supervision of a valid init process (%s)\n\n", bname);
fprintf(file, "Command line options:\n\n");
@@ -261,6 +267,7 @@ void print_usage(char* const name, FILE* const file) {
fprintf(file, " %s: Send signals to the child's process group.\n", KILL_PROCESS_GROUP_GROUP_ENV_VAR);
fprintf(file, "\n");
+ free(dirc);
}
void print_license(FILE* const file) {

View File

@ -1,74 +0,0 @@
From 66d0b5fd94fafe1e15bf21a1b73618ca23de078f Mon Sep 17 00:00:00 2001
From: Jose Quaresma <jose.quaresma@foundries.io>
Date: Fri, 23 Sep 2022 16:31:33 +0000
Subject: [PATCH] tini.c: a function declaration without a prototype is
deprecated in all versions of C
| /srv/oe/build/tmp-lmp/work/corei7-64-lmp-linux/tini/0.19.0-r0/git/src/tini.c:150:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
| int isolate_child() {
| ^
| void
| /srv/oe/build/tmp-lmp/work/corei7-64-lmp-linux/tini/0.19.0-r0/git/src/tini.c:395:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
| int parse_env() {
| ^
| void
| /srv/oe/build/tmp-lmp/work/corei7-64-lmp-linux/tini/0.19.0-r0/git/src/tini.c:416:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
| int register_subreaper () {
| ^
| void
| /srv/oe/build/tmp-lmp/work/corei7-64-lmp-linux/tini/0.19.0-r0/git/src/tini.c:434:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
| void reaper_check () {
| ^
| void
| 4 errors generated.
Upstream-Status: Submitted [https://github.com/krallin/tini/pull/198]
Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
---
src/tini.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/tini.c b/src/tini.c
index 2c873f9..7914d3a 100644
--- a/src/tini.c
+++ b/src/tini.c
@@ -147,7 +147,7 @@ int restore_signals(const signal_configuration_t* const sigconf_ptr) {
return 0;
}
-int isolate_child() {
+int isolate_child(void) {
// Put the child into a new process group.
if (setpgid(0, 0) < 0) {
PRINT_FATAL("setpgid failed: %s", strerror(errno));
@@ -392,7 +392,7 @@ int parse_args(const int argc, char* const argv[], char* (**child_args_ptr_ptr)[
return 0;
}
-int parse_env() {
+int parse_env(void) {
#if HAS_SUBREAPER
if (getenv(SUBREAPER_ENV_VAR) != NULL) {
subreaper++;
@@ -413,7 +413,7 @@ int parse_env() {
#if HAS_SUBREAPER
-int register_subreaper () {
+int register_subreaper (void) {
if (subreaper > 0) {
if (prctl(PR_SET_CHILD_SUBREAPER, 1)) {
if (errno == EINVAL) {
@@ -431,7 +431,7 @@ int register_subreaper () {
#endif
-void reaper_check () {
+void reaper_check (void) {
/* Check that we can properly reap zombies */
#if HAS_SUBREAPER
int bit = 0;
--
2.34.1

View File

@ -4,12 +4,11 @@ DESCRIPTION = "Tini is the simplest init you could think of. All Tini does is \
spawn a single child (Tini is meant to be run in a container), and wait for \
it to exit all the while reaping zombies and performing signal forwarding. "
SRCREV = "b9f42a0e7bb46efea0c9e3d8610c96ab53b467f8"
PV = "v0.19.0+git"
SRCREV = "369448a167e8b3da4ca5bca0b3307500c3371828"
SRC_URI = " \
git://github.com/krallin/tini.git;branch=master;protocol=https \
file://0001-Do-not-strip-the-output-binary-allow-yocto-to-do-thi.patch \
file://0001-tini.c-a-function-declaration-without-a-prototype-is.patch \
file://0001-Support-POSIX-basename-from-musl-libc.patch \
"
LICENSE = "MIT"