From 08a9a9979d8684796babca8c495079f15acf4ed2 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Tue, 5 May 2020 16:31:11 +0200 Subject: busybox: version bump 1.29.3 -> 1.31.1 The old version fails to build with glibc >= 2.31. Signed-off-by: Michael Olbrich --- .../0200-reactivate-check-for-tty.patch | 28 ------- ...mat-warning-when-building-applets-usage_p.patch | 30 -------- ...ystem-only-pass-real-libs-to-SELINUX_LIBS.patch | 23 ------ ...link-honour-SKIP_STRIP-and-don-t-strip-if.patch | 52 ------------- patches/busybox-1.29.3/series | 10 --- .../0100-Remove-stime-function-calls.patch | 89 ++++++++++++++++++++++ .../0200-reactivate-check-for-tty.patch | 28 +++++++ ...mat-warning-when-building-applets-usage_p.patch | 30 ++++++++ ...ystem-only-pass-real-libs-to-SELINUX_LIBS.patch | 23 ++++++ ...link-honour-SKIP_STRIP-and-don-t-strip-if.patch | 52 +++++++++++++ patches/busybox-1.31.1/series | 11 +++ 11 files changed, 233 insertions(+), 143 deletions(-) delete mode 100644 patches/busybox-1.29.3/0200-reactivate-check-for-tty.patch delete mode 100644 patches/busybox-1.29.3/0201-Fix-the-format-warning-when-building-applets-usage_p.patch delete mode 100644 patches/busybox-1.29.3/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch delete mode 100644 patches/busybox-1.29.3/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch delete mode 100644 patches/busybox-1.29.3/series create mode 100644 patches/busybox-1.31.1/0100-Remove-stime-function-calls.patch create mode 100644 patches/busybox-1.31.1/0200-reactivate-check-for-tty.patch create mode 100644 patches/busybox-1.31.1/0201-Fix-the-format-warning-when-building-applets-usage_p.patch create mode 100644 patches/busybox-1.31.1/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch create mode 100644 patches/busybox-1.31.1/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch create mode 100644 patches/busybox-1.31.1/series (limited to 'patches') diff --git a/patches/busybox-1.29.3/0200-reactivate-check-for-tty.patch b/patches/busybox-1.29.3/0200-reactivate-check-for-tty.patch deleted file mode 100644 index 077b84efa..000000000 --- a/patches/busybox-1.29.3/0200-reactivate-check-for-tty.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Marc Kleine-Budde -Date: Fri, 6 Nov 2009 09:19:58 +0100 -Subject: [PATCH] reactivate check for tty - -The busybox crew switched of the test for a tty in silentoldconfig, -we use this feature to break when oldconfig needs interaction -in automated build. - -This patch reactivates this feature. - -Signed-off-by: Marc Kleine-Budde ---- - scripts/kconfig/conf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c -index 57734b590ace..b9cf03d76f55 100644 ---- a/scripts/kconfig/conf.c -+++ b/scripts/kconfig/conf.c -@@ -537,7 +537,7 @@ int main(int ac, char **av) - break; - case 's': - input_mode = ask_silent; -- valid_stdin = isatty(0); //bbox: && isatty(1) && isatty(2); -+ valid_stdin = isatty(0) && isatty(1) && isatty(2); - break; - case 'd': - input_mode = set_default; diff --git a/patches/busybox-1.29.3/0201-Fix-the-format-warning-when-building-applets-usage_p.patch b/patches/busybox-1.29.3/0201-Fix-the-format-warning-when-building-applets-usage_p.patch deleted file mode 100644 index 5a21793d8..000000000 --- a/patches/busybox-1.29.3/0201-Fix-the-format-warning-when-building-applets-usage_p.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Dinny Wu -Date: Thu, 26 Jul 2012 14:12:51 +0000 -Subject: [PATCH] Fix the format warning when building applets/usage_pod.c -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When compiling busybox with gcc 4.6.3, it shows below warning: - -applets/usage_pod.c: In function ‘main’: -applets/usage_pod.c:74:3: warning: format not a string literal and no format arguments [-Wformat-security] - -Signed-off-by: Dinny Wu ---- - applets/usage_pod.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/applets/usage_pod.c b/applets/usage_pod.c -index ccc166aed708..9e6d3f0ee5b1 100644 ---- a/applets/usage_pod.c -+++ b/applets/usage_pod.c -@@ -71,7 +71,7 @@ int main(void) - } else { - printf(", "); - } -- printf(usage_array[i].aname); -+ printf("%s", usage_array[i].aname); - col += len2; - } - printf("\n\n"); diff --git a/patches/busybox-1.29.3/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch b/patches/busybox-1.29.3/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch deleted file mode 100644 index 4e9dca9dc..000000000 --- a/patches/busybox-1.29.3/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Marc Kleine-Budde -Date: Mon, 28 Jan 2013 14:21:07 +0100 -Subject: [PATCH] build system: only pass real libs to SELINUX_LIBS - -The busybox make system will fail otherwise. - -Signed-off-by: Marc Kleine-Budde ---- - Makefile.flags | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Makefile.flags b/Makefile.flags -index f3c897b0687f..72e0a13a6388 100644 ---- a/Makefile.flags -+++ b/Makefile.flags -@@ -153,6 +153,7 @@ ifeq ($(CONFIG_SELINUX),y) - SELINUX_PC_MODULES = libselinux libsepol - $(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES))) - CPPFLAGS += $(SELINUX_CFLAGS) -+SELINUX_LIBS := $(filter -l%,$(SELINUX_LIBS)) - LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%)) - endif - diff --git a/patches/busybox-1.29.3/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch b/patches/busybox-1.29.3/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch deleted file mode 100644 index 6f2106090..000000000 --- a/patches/busybox-1.29.3/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch +++ /dev/null @@ -1,52 +0,0 @@ -From: Marc Kleine-Budde -Date: Mon, 4 Feb 2013 14:39:00 +0100 -Subject: [PATCH] scripts/trylink: honour SKIP_STRIP and don't strip if - requested to - -Signed-off-by: Marc Kleine-Budde ---- - scripts/trylink | 17 ++++++++++++++--- - 1 file changed, 14 insertions(+), 3 deletions(-) - -diff --git a/scripts/trylink b/scripts/trylink -index ba2d265bc919..a3f3b5b8cc10 100755 ---- a/scripts/trylink -+++ b/scripts/trylink -@@ -268,7 +268,12 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then - cat $EXE.out - exit 1 - } -- $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/libbusybox.so.$BB_VER" -+ if test "$SKIP_STRIP" = "y"; then -+ cp $EXE "$sharedlib_dir/libbusybox.so.$BB_VER" -+ else -+ $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/libbusybox.so.$BB_VER" -+ fi -+ - chmod a+x "$sharedlib_dir/libbusybox.so.$BB_VER" - echo "libbusybox: $sharedlib_dir/libbusybox.so.$BB_VER" - fi -@@ -289,7 +294,11 @@ if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then - cat $EXE.out - exit 1 - } -- $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/busybox" -+ if test "$SKIP_STRIP" = "y"; then -+ cp $EXE "$sharedlib_dir/busybox" -+ else -+ $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/busybox" -+ fi - echo "busybox linked against libbusybox: $sharedlib_dir/busybox" - fi - -@@ -326,7 +335,9 @@ int main(int argc, char **argv) - exit 1 - } - rm -- "$sharedlib_dir/applet.c" $EXE.out -- $STRIP -s --remove-section=.note --remove-section=.comment $EXE -+ if test "$SKIP_STRIP" != "y"; then -+ $STRIP -s --remove-section=.note --remove-section=.comment $EXE -+ fi - # Let user see that we do something - list the names of created binaries: - echo "$EXE" - diff --git a/patches/busybox-1.29.3/series b/patches/busybox-1.29.3/series deleted file mode 100644 index 84c80aa6e..000000000 --- a/patches/busybox-1.29.3/series +++ /dev/null @@ -1,10 +0,0 @@ -# generated by git-ptx-patches -#tag:base --start-number 1 -#tag:upstream-stable --start-number 1 -#tag:upstream-master --start-number 100 -#tag:ptx --start-number 200 -0200-reactivate-check-for-tty.patch -0201-Fix-the-format-warning-when-building-applets-usage_p.patch -0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch -0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch -# 0036b420b1a49106a872780e90251289 - git-ptx-patches magic diff --git a/patches/busybox-1.31.1/0100-Remove-stime-function-calls.patch b/patches/busybox-1.31.1/0100-Remove-stime-function-calls.patch new file mode 100644 index 000000000..5e4c62ee1 --- /dev/null +++ b/patches/busybox-1.31.1/0100-Remove-stime-function-calls.patch @@ -0,0 +1,89 @@ +From: Alistair Francis +Date: Tue, 19 Nov 2019 13:06:40 +0100 +Subject: [PATCH] Remove stime() function calls + +stime() has been deprecated in glibc 2.31 and replaced with +clock_settime(). Let's replace the stime() function calls with +clock_settime() in preperation. + +function old new delta +rdate_main 197 224 +27 +clock_settime - 27 +27 +date_main 926 941 +15 +stime 37 - -37 +------------------------------------------------------------------------------ +(add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes + +Signed-off-by: Alistair Francis +Signed-off-by: Denys Vlasenko +--- + coreutils/date.c | 6 +++++- + libbb/missing_syscalls.c | 8 -------- + util-linux/rdate.c | 8 ++++++-- + 3 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/coreutils/date.c b/coreutils/date.c +index 3414d38aedd9..4ade6abb4249 100644 +--- a/coreutils/date.c ++++ b/coreutils/date.c +@@ -279,6 +279,9 @@ int date_main(int argc UNUSED_PARAM, char **argv) + time(&ts.tv_sec); + #endif + } ++#if !ENABLE_FEATURE_DATE_NANO ++ ts.tv_nsec = 0; ++#endif + localtime_r(&ts.tv_sec, &tm_time); + + /* If date string is given, update tm_time, and maybe set date */ +@@ -301,9 +304,10 @@ int date_main(int argc UNUSED_PARAM, char **argv) + if (date_str[0] != '@') + tm_time.tm_isdst = -1; + ts.tv_sec = validate_tm_time(date_str, &tm_time); ++ ts.tv_nsec = 0; + + /* if setting time, set it */ +- if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) { ++ if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) { + bb_perror_msg("can't set date"); + } + } +diff --git a/libbb/missing_syscalls.c b/libbb/missing_syscalls.c +index 87cf59b3d4cc..dc40d91552f1 100644 +--- a/libbb/missing_syscalls.c ++++ b/libbb/missing_syscalls.c +@@ -15,14 +15,6 @@ pid_t getsid(pid_t pid) + return syscall(__NR_getsid, pid); + } + +-int stime(const time_t *t) +-{ +- struct timeval tv; +- tv.tv_sec = *t; +- tv.tv_usec = 0; +- return settimeofday(&tv, NULL); +-} +- + int sethostname(const char *name, size_t len) + { + return syscall(__NR_sethostname, name, len); +diff --git a/util-linux/rdate.c b/util-linux/rdate.c +index 70f829e7fec7..878375d7868d 100644 +--- a/util-linux/rdate.c ++++ b/util-linux/rdate.c +@@ -95,9 +95,13 @@ int rdate_main(int argc UNUSED_PARAM, char **argv) + if (!(flags & 2)) { /* no -p (-s may be present) */ + if (time(NULL) == remote_time) + bb_error_msg("current time matches remote time"); +- else +- if (stime(&remote_time) < 0) ++ else { ++ struct timespec ts; ++ ts.tv_sec = remote_time; ++ ts.tv_nsec = 0; ++ if (clock_settime(CLOCK_REALTIME, &ts) < 0) + bb_perror_msg_and_die("can't set time of day"); ++ } + } + + if (flags != 1) /* not lone -s */ diff --git a/patches/busybox-1.31.1/0200-reactivate-check-for-tty.patch b/patches/busybox-1.31.1/0200-reactivate-check-for-tty.patch new file mode 100644 index 000000000..077b84efa --- /dev/null +++ b/patches/busybox-1.31.1/0200-reactivate-check-for-tty.patch @@ -0,0 +1,28 @@ +From: Marc Kleine-Budde +Date: Fri, 6 Nov 2009 09:19:58 +0100 +Subject: [PATCH] reactivate check for tty + +The busybox crew switched of the test for a tty in silentoldconfig, +we use this feature to break when oldconfig needs interaction +in automated build. + +This patch reactivates this feature. + +Signed-off-by: Marc Kleine-Budde +--- + scripts/kconfig/conf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c +index 57734b590ace..b9cf03d76f55 100644 +--- a/scripts/kconfig/conf.c ++++ b/scripts/kconfig/conf.c +@@ -537,7 +537,7 @@ int main(int ac, char **av) + break; + case 's': + input_mode = ask_silent; +- valid_stdin = isatty(0); //bbox: && isatty(1) && isatty(2); ++ valid_stdin = isatty(0) && isatty(1) && isatty(2); + break; + case 'd': + input_mode = set_default; diff --git a/patches/busybox-1.31.1/0201-Fix-the-format-warning-when-building-applets-usage_p.patch b/patches/busybox-1.31.1/0201-Fix-the-format-warning-when-building-applets-usage_p.patch new file mode 100644 index 000000000..5a21793d8 --- /dev/null +++ b/patches/busybox-1.31.1/0201-Fix-the-format-warning-when-building-applets-usage_p.patch @@ -0,0 +1,30 @@ +From: Dinny Wu +Date: Thu, 26 Jul 2012 14:12:51 +0000 +Subject: [PATCH] Fix the format warning when building applets/usage_pod.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When compiling busybox with gcc 4.6.3, it shows below warning: + +applets/usage_pod.c: In function ‘main’: +applets/usage_pod.c:74:3: warning: format not a string literal and no format arguments [-Wformat-security] + +Signed-off-by: Dinny Wu +--- + applets/usage_pod.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/applets/usage_pod.c b/applets/usage_pod.c +index ccc166aed708..9e6d3f0ee5b1 100644 +--- a/applets/usage_pod.c ++++ b/applets/usage_pod.c +@@ -71,7 +71,7 @@ int main(void) + } else { + printf(", "); + } +- printf(usage_array[i].aname); ++ printf("%s", usage_array[i].aname); + col += len2; + } + printf("\n\n"); diff --git a/patches/busybox-1.31.1/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch b/patches/busybox-1.31.1/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch new file mode 100644 index 000000000..4e9dca9dc --- /dev/null +++ b/patches/busybox-1.31.1/0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch @@ -0,0 +1,23 @@ +From: Marc Kleine-Budde +Date: Mon, 28 Jan 2013 14:21:07 +0100 +Subject: [PATCH] build system: only pass real libs to SELINUX_LIBS + +The busybox make system will fail otherwise. + +Signed-off-by: Marc Kleine-Budde +--- + Makefile.flags | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.flags b/Makefile.flags +index f3c897b0687f..72e0a13a6388 100644 +--- a/Makefile.flags ++++ b/Makefile.flags +@@ -153,6 +153,7 @@ ifeq ($(CONFIG_SELINUX),y) + SELINUX_PC_MODULES = libselinux libsepol + $(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES))) + CPPFLAGS += $(SELINUX_CFLAGS) ++SELINUX_LIBS := $(filter -l%,$(SELINUX_LIBS)) + LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%)) + endif + diff --git a/patches/busybox-1.31.1/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch b/patches/busybox-1.31.1/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch new file mode 100644 index 000000000..6f2106090 --- /dev/null +++ b/patches/busybox-1.31.1/0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch @@ -0,0 +1,52 @@ +From: Marc Kleine-Budde +Date: Mon, 4 Feb 2013 14:39:00 +0100 +Subject: [PATCH] scripts/trylink: honour SKIP_STRIP and don't strip if + requested to + +Signed-off-by: Marc Kleine-Budde +--- + scripts/trylink | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/scripts/trylink b/scripts/trylink +index ba2d265bc919..a3f3b5b8cc10 100755 +--- a/scripts/trylink ++++ b/scripts/trylink +@@ -268,7 +268,12 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then + cat $EXE.out + exit 1 + } +- $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/libbusybox.so.$BB_VER" ++ if test "$SKIP_STRIP" = "y"; then ++ cp $EXE "$sharedlib_dir/libbusybox.so.$BB_VER" ++ else ++ $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/libbusybox.so.$BB_VER" ++ fi ++ + chmod a+x "$sharedlib_dir/libbusybox.so.$BB_VER" + echo "libbusybox: $sharedlib_dir/libbusybox.so.$BB_VER" + fi +@@ -289,7 +294,11 @@ if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then + cat $EXE.out + exit 1 + } +- $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/busybox" ++ if test "$SKIP_STRIP" = "y"; then ++ cp $EXE "$sharedlib_dir/busybox" ++ else ++ $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/busybox" ++ fi + echo "busybox linked against libbusybox: $sharedlib_dir/busybox" + fi + +@@ -326,7 +335,9 @@ int main(int argc, char **argv) + exit 1 + } + rm -- "$sharedlib_dir/applet.c" $EXE.out +- $STRIP -s --remove-section=.note --remove-section=.comment $EXE ++ if test "$SKIP_STRIP" != "y"; then ++ $STRIP -s --remove-section=.note --remove-section=.comment $EXE ++ fi + # Let user see that we do something - list the names of created binaries: + echo "$EXE" + diff --git a/patches/busybox-1.31.1/series b/patches/busybox-1.31.1/series new file mode 100644 index 000000000..2e75917fa --- /dev/null +++ b/patches/busybox-1.31.1/series @@ -0,0 +1,11 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +#tag:upstream-stable --start-number 1 +#tag:upstream-master --start-number 100 +0100-Remove-stime-function-calls.patch +#tag:ptx --start-number 200 +0200-reactivate-check-for-tty.patch +0201-Fix-the-format-warning-when-building-applets-usage_p.patch +0202-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch +0203-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch +# df58d733972ae3ce861e84850c98ce86 - git-ptx-patches magic -- cgit v1.2.3