Skip to content

Commit

Permalink
package/busybox: bump to 1.37.0
Browse files Browse the repository at this point in the history
Notes: https://www.busybox.net/

The patches are rebased, and one patch has been added:
  0007-libbb-sha-add-missing-sha-NI-guard.patch.

Signed-off-by: Thomas Devoogdt <[email protected]>
  • Loading branch information
ThomasDevoogdt committed Oct 4, 2024
1 parent 31f170c commit 9de97e3
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 262 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 60da1d0763224698008d847eb8ad8d4d8c6f54ff Mon Sep 17 00:00:00 2001
From d4a7311078cd5509d48ba13ead1abb885a6a6744 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <[email protected]>
Date: Sat, 5 Oct 2013 15:55:06 +0200
Subject: [PATCH] networking/libiproute: use <linux/if_packet.h> instead of
Expand All @@ -20,7 +20,7 @@ Signed-off-by: Petr Vorel <[email protected]>
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index 1a1064bdc..a4c3ad307 100644
index 37ed114bc..bc526d89c 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -7,7 +7,7 @@
Expand All @@ -30,8 +30,8 @@ index 1a1064bdc..a4c3ad307 100644
-#include <netpacket/packet.h>
+#include <linux/if_packet.h>
#include <netinet/if_ether.h>

#include <linux/if_vlan.h>
--
2.33.0
--
2.43.0

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
From 59daea82e7b5abcdb42a4f97a0109f14d5a774ea Mon Sep 17 00:00:00 2001
From cb080be5d14b2f240d964678315c292cbd936496 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <[email protected]>
Date: Mon, 25 Nov 2013 22:51:53 +0100
Subject: [PATCH] Makefile.flags: strip non -l arguments returned by
pkg-config
Subject: [PATCH] Makefile.flags: strip non -l arguments returned by pkg-config

Signed-off-by: Thomas Petazzoni <[email protected]>
[[email protected]: refresh for 1.29.0]
Expand All @@ -14,10 +13,10 @@ Signed-off-by: Petr Vorel <[email protected]>
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile.flags b/Makefile.flags
index 667481983..88d76efec 100644
index 97cb4dca2..92a9063d9 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -180,7 +180,9 @@ ifeq ($(CONFIG_SELINUX),y)
@@ -181,7 +181,9 @@ ifeq ($(CONFIG_SELINUX),y)
SELINUX_PC_MODULES = libselinux libsepol
$(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES)))
CPPFLAGS += $(SELINUX_CFLAGS)
Expand All @@ -26,8 +25,8 @@ index 667481983..88d76efec 100644
+ $(patsubst -l%,%,$(filter -l%,$(SELINUX_LIBS))),\
+ $(SELINUX_PC_MODULES:lib%=%))
endif

ifeq ($(CONFIG_FEATURE_NSLOOKUP_BIG),y)
--
2.33.0
--
2.43.0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 9d825e854ef53ebbe0aea2f1a69f52b763104daf Mon Sep 17 00:00:00 2001
From 444bb9dded67070756995c0704c4638ee5af61a0 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <[email protected]>
Date: Mon, 19 Sep 2022 14:15:12 +0200
Subject: [PATCH] libbb: sockaddr2str: ensure only printable characters are
Expand Down Expand Up @@ -38,5 +38,5 @@ index 0e0b247b8..02c061e67 100644
}

--
2.37.3
2.43.0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From bd463a5564a2c0618317448c3f965d389534c3df Mon Sep 17 00:00:00 2001
From 25a36f28f0a9207586ca9690238d760581db6452 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <[email protected]>
Date: Mon, 19 Sep 2022 14:15:12 +0200
Subject: [PATCH] nslookup: sanitize all printed strings with printable_string
Expand All @@ -16,10 +16,10 @@ Signed-off-by: Quentin Schulz <[email protected]>
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/networking/nslookup.c b/networking/nslookup.c
index 6da97baf4..4bdcde1b8 100644
index b67d354f7..79412477c 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -407,7 +407,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
@@ -784,7 +784,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
//printf("Unable to uncompress domain: %s\n", strerror(errno));
return -1;
}
Expand All @@ -28,7 +28,7 @@ index 6da97baf4..4bdcde1b8 100644
break;

case ns_t_mx:
@@ -422,7 +422,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
@@ -799,7 +799,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
//printf("Cannot uncompress MX domain: %s\n", strerror(errno));
return -1;
}
Expand All @@ -37,7 +37,7 @@ index 6da97baf4..4bdcde1b8 100644
break;

case ns_t_txt:
@@ -434,7 +434,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
@@ -811,7 +811,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
if (n > 0) {
memset(dname, 0, sizeof(dname));
memcpy(dname, ns_rr_rdata(rr) + 1, n);
Expand All @@ -46,7 +46,7 @@ index 6da97baf4..4bdcde1b8 100644
}
break;

@@ -454,7 +454,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
@@ -831,7 +831,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
}

printf("%s\tservice = %u %u %u %s\n", ns_rr_name(rr),
Expand All @@ -55,7 +55,7 @@ index 6da97baf4..4bdcde1b8 100644
break;

case ns_t_soa:
@@ -483,7 +483,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
@@ -860,7 +860,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
return -1;
}

Expand All @@ -65,5 +65,5 @@ index 6da97baf4..4bdcde1b8 100644

printf("\tserial = %lu\n", ns_get32(cp));
--
2.37.3
2.43.0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From b2d26d449ec855602b9a88f58c2eb675de0224f2 Mon Sep 17 00:00:00 2001
From 933957dca6592f0b701151bdac72a651dbe8a54b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <[email protected]>
Date: Tue, 18 Apr 2023 15:54:43 +0200
Subject: [PATCH v4] seedrng: fix getrandom() detection for non-glibc libc
Subject: [PATCH] seedrng: fix getrandom() detection for non-glibc libc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Expand Down Expand Up @@ -48,33 +48,15 @@ This should fix compiling with many libc/kernel combinations.
Signed-off-by: Raphaël Mélotte <[email protected]>
Upstream: http://lists.busybox.net/pipermail/busybox/2023-May/090317.html
---
Changes v3 -> v4:
- use a variable for '#' for compatibility with GNU make 4.2.1 and earlier.

Changes v2 -> v3:
- fix _GNU_SOURCE define location

Changes v1 -> v2:
- move _GNU_SOURCE to bb_libtest.c
- remove GRND_NONBLOCK

Note that I was not able to test every single combination, but I could
confirm it builds successfully for:
uClibc 10.0.24, linux headers 3.10 (libc getrandom NOT used)
uClibc 1.0.36, linux headers 4.9 (libc getrandom used)
musl 1.1.16, linux headers 4.12 (libc getrandom NOT used)
musl 1.2.1, linux headers (libc getrandom used)
glibc 2.25, linux headers 4.10 (libc getrandom used)

Makefile.flags | 12 ++++++++++++
miscutils/seedrng.c | 8 ++++----
2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/Makefile.flags b/Makefile.flags
index 1cec5ba20..0d437303a 100644
index 92a9063d9..c8f601308 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -161,6 +161,18 @@ ifeq ($(RT_AVAILABLE),y)
@@ -162,6 +162,18 @@ ifeq ($(RT_AVAILABLE),y)
LDLIBS += rt
endif

Expand All @@ -94,7 +76,7 @@ index 1cec5ba20..0d437303a 100644
# On some platforms that requires an explicit -lpthread, -ldl, -laudit.
# However, on *other platforms* it fails when some of those flags
diff --git a/miscutils/seedrng.c b/miscutils/seedrng.c
index 3bf6e2ea7..2f1e18c32 100644
index 7a2331cb1..ba98f4d19 100644
--- a/miscutils/seedrng.c
+++ b/miscutils/seedrng.c
@@ -44,8 +44,10 @@
Expand All @@ -120,5 +102,5 @@ index 3bf6e2ea7..2f1e18c32 100644

/* Apparently some headers don't ship with this yet. */
--
2.39.1
2.43.0

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
From [email protected] Sun Jul 21 12:10:52 2024
From: [email protected] (Nop)
From e3bec255f30720e1541a97560361c706ccb91d6e Mon Sep 17 00:00:00 2001
From: Nop <[email protected]>
Date: Sun, 21 Jul 2024 14:10:52 +0200
Subject: [PATCH] menuconfig: GCC failing saying ncurses is not found

Expand All @@ -17,13 +17,12 @@ Signed-off-by: Fiona Klute (WIWA) <[email protected]>
scripts/kconfig/lxdialog/check-lxdialog.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 5075ebf2d..c644d1d48 100755
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 5075ebf2d..08e4da3de 100755
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -45,9 +45,9 @@ trap "rm -f $tmp" 0 1 2 3 15

# Check if we can link to ncurses
check() {
- $cc -x c - -o $tmp 2>/dev/null <<'EOF'
Expand All @@ -34,5 +33,6 @@ index 5075ebf2d..c644d1d48 100755
EOF
if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries or the" 1>&2
--
2.45.2
--
2.43.0

This file was deleted.

50 changes: 50 additions & 0 deletions package/busybox/0007-libbb-sha-add-missing-sha-NI-guard.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From c8a5d8872f72eeb1a42d3b036e5f7bd2f88ddc86 Mon Sep 17 00:00:00 2001
From: Andre Przywara <[email protected]>
Date: Tue, 10 Sep 2024 14:32:46 +0100
Subject: [PATCH] libbb/sha: add missing sha-NI guard

The ENABLE_SHA1_HWACCEL Kconfig symbol is meant to be archicture
agnostic, so can be enabled regardless of whether your build
architecture provides hardware acceleration or not. At the moment only
x86 implements this, so every piece of optimised code should be guarded
by both ENABLE_SHA1_HWACCEL and (__x86_64__ || __i386__). This is missing
at one place, so compiling for arm64 breaks when ENABLE_SHA1_HWACCEL is
enabled:
================================
libbb/hash_md5_sha.c: In function ?sha1_end?:
libbb/hash_md5_sha.c:1316:28: error: ?sha1_process_block64_shaNI? undeclared (first use in this function); did you mean ?sha1_process_block64??
1316 | || ctx->process_block == sha1_process_block64_shaNI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| sha1_process_block64
libbb/hash_md5_sha.c:1316:28: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [scripts/Makefile.build:197: libbb/hash_md5_sha.o] Error 1
make: *** [Makefile:744: libbb] Error 2
================================

Add the missing guards around the call to sha1_process_block64_shaNI to
fix the build on other architectures with ENABLE_SHA1_HWACCEL enabled.

Change-Id: I40bba388422625f4230abf15a5de23e1fdc654fc
Upstream: http://lists.busybox.net/pipermail/busybox/2024-September/090899.html
Signed-off-by: Andre Przywara <[email protected]>
---
libbb/hash_md5_sha.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/libbb/hash_md5_sha.c b/libbb/hash_md5_sha.c
index 57a801459..75a61c32c 100644
--- a/libbb/hash_md5_sha.c
+++ b/libbb/hash_md5_sha.c
@@ -1313,7 +1313,9 @@ unsigned FAST_FUNC sha1_end(sha1_ctx_t *ctx, void *resbuf)
hash_size = 8;
if (ctx->process_block == sha1_process_block64
#if ENABLE_SHA1_HWACCEL
+# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|| ctx->process_block == sha1_process_block64_shaNI
+# endif
#endif
) {
hash_size = 5;
--
2.43.0

Loading

0 comments on commit 9de97e3

Please sign in to comment.