Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
From 924c4bd6028457188942ecbfdc75e6a343fa9395 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.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Upstream: https://github.com/krallin/tini/commit/924c4bd6028457188942ecbfdc75e6a343fa9395
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
---
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) {

17
package/tini/Config.in Normal file
View File

@@ -0,0 +1,17 @@
config BR2_PACKAGE_TINI
bool "tini"
depends on BR2_USE_MMU # fork()
help
tini is a simple but valid init binary to
act as PID 1 for containers.
https://github.com/krallin/tini
if BR2_PACKAGE_TINI
config BR2_PACKAGE_TINI_MINIMAL
bool "build minimal variant"
help
Disables argument parsing and verbose output.
endif

3
package/tini/tini.hash Normal file
View File

@@ -0,0 +1,3 @@
# Locally computed
sha256 e5f46bca81266bdd511cf08018d66866870531794569c04f9b45f50dd23c28b0 LICENSE
sha256 0fd35a7030052acd9f58948d1d900fe1e432ee37103c5561554408bdac6bbf0d tini-0.19.0.tar.gz

37
package/tini/tini.mk Normal file
View File

@@ -0,0 +1,37 @@
################################################################################
#
# tini
#
################################################################################
TINI_VERSION = 0.19.0
TINI_SITE = $(call github,krallin,tini,v$(TINI_VERSION))
TINI_LICENSE = MIT
TINI_LICENSE_FILES = LICENSE
TINI_CPE_ID_VALID = YES
TINI_CFLAGS = $(TARGET_CFLAGS) \
-static \
-DTINI_VERSION=\"$(TINI_VERSION)\" \
-DTINI_GIT=\"\"
ifeq ($(BR2_PACKAGE_TINI_MINIMAL),y)
TINI_CFLAGS += -DTINI_MINIMAL
endif
define TINI_CONFIGURE_CMDS
printf "#pragma once\n" > $(@D)/src/tiniConfig.h
endef
define TINI_BUILD_CMDS
mkdir -p $(@D)/bin
$(TARGET_CC) $(TINI_CFLAGS) \
-o $(@D)/bin/tini $(@D)/src/tini.c
endef
define TINI_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/bin/tini $(TARGET_DIR)/usr/bin/tini
endef
# Tini's CMakeLists.txt is not suitable for Buildroot.
$(eval $(generic-package))