* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2015-11-13 5:23 Mike Frysinger
0 siblings, 0 replies; 10+ messages in thread
From: Mike Frysinger @ 2015-11-13 5:23 UTC (permalink / raw
To: gentoo-commits
commit: e1d1987957530d04e794f52bed887917970c50fa
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 13 05:21:18 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 13 05:21:48 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1d19879
sys-apps/busybox: version bump #564246
sys-apps/busybox/Manifest | 1 +
.../{busybox-9999.ebuild => busybox-1.24.1.ebuild} | 5 +-
sys-apps/busybox/busybox-9999.ebuild | 3 +-
sys-apps/busybox/files/busybox-1.24.1-unzip.patch | 112 +++++++++++++++++++++
4 files changed, 116 insertions(+), 5 deletions(-)
diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
index c7e1fc3..b8590e5 100644
--- a/sys-apps/busybox/Manifest
+++ b/sys-apps/busybox/Manifest
@@ -1,3 +1,4 @@
DIST busybox-1.21.0.tar.bz2 2200841 SHA256 eb9d268627783297f5f459cb9bd61a94e395dc7cb3647e10ec186e0159aa36ed SHA512 ddafded24881f03db550d9793585bb5442c70f2a60a5d9770126f50981dadfe95fc0b280f83d5b8a8ce21c86bb7ce64e9f1a606cea140fb2f2599a21de55ba31 WHIRLPOOL d50378bb823dd59e8a607ed6a72d4890f4e5ad3304f1ddba9f7f3d49b5ab820acc9daa2b3c4619f8b147dec085c53c3c6f4b4ebe4c60b431299031d2af00a4d3
DIST busybox-1.23.1.tar.bz2 2252635 SHA256 300f1db0a7ca4ecee8f8d8027aba250b903372e8339b7d9123d37c1e900473bf SHA512 60849c220dde596c4197f16dd844573b24dd46c8544345a2d5a2b1976fa0ac340d22fbc97f5a1437b7de1c04f4e16aa07b3d62bc77eb83b2467582a50ed4b362 WHIRLPOOL 7cd25e42e74663849b094df699a72deaf02b1088064a511341f76aaa419c936557bbafd54523c6818082dfd4e17605f06ee51abed238ef57a56a9be12c910f99
DIST busybox-1.23.2.tar.bz2 2252786 SHA256 05a6f9e21aad8c098e388ae77de7b2361941afa7157ef74216703395b14e319a SHA512 209c8ef26e40ccb81510f6b663202b080f9bbecac7faf386bbabf7e36a43d63b15dd6ce9f7a84c1ccc5345c524999812251da1e113ef9faadc6af1fedd24c7c9 WHIRLPOOL a0396f7f49ae702f1617e72d5d4646aceec4eba67219c7125bd8d0926d1acb1ef41ea15a7406c3cf5e5e0d8925cc75910ed5128e5fbdd257b80e2cb4f7a048a2
+DIST busybox-1.24.1.tar.bz2 2068803 SHA256 37d03132cc078937360b392170b7a1d0e5b322eee9f57c0b82292a8b1f0afe3d SHA512 3afc757ebaae61ae13c2c69097ee734717434f9e658eb77093a8b7b49af3326cbca2d723483ff84a1da99544b822fd2b47d9a97c68f09962e11754e5daf124ca WHIRLPOOL 5e827d08d737caac832e7e5923da624094ff27ee2edbb46dadc339e95edba65378a8fa3db412682724476a2092eee41a804f8f36c2eec0b9f883f5ba855f3ad0
diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-1.24.1.ebuild
similarity index 98%
copy from sys-apps/busybox/busybox-9999.ebuild
copy to sys-apps/busybox/busybox-1.24.1.ebuild
index c517091..9f87f6e 100644
--- a/sys-apps/busybox/busybox-9999.ebuild
+++ b/sys-apps/busybox/busybox-1.24.1.ebuild
@@ -30,7 +30,7 @@ DEPEND="${COMMON_DEPEND}
static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
>=sys-kernel/linux-headers-2.6.39"
RDEPEND="${COMMON_DEPEND}
-mdev? ( !<sys-apps/openrc-0.13 )"
+ mdev? ( !<sys-apps/openrc-0.13 )"
S=${WORKDIR}/${MY_P}
@@ -67,7 +67,7 @@ src_prepare() {
# patches go here!
epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
-# epatch "${FILESDIR}"/${P}-*.patch
+ epatch "${FILESDIR}"/${P}-*.patch
cp "${FILESDIR}"/ginit.c init/ || die
# flag cleanup
@@ -115,7 +115,6 @@ src_configure() {
busybox_config_option n BUILD_LIBBUSYBOX
busybox_config_option n FEATURE_CLEAN_UP
busybox_config_option n MONOTONIC_SYSCALL
- busybox_config_option n START_STOP_DAEMON
busybox_config_option n USE_PORTABLE_CODE
busybox_config_option n WERROR
diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-9999.ebuild
index c517091..3fd4db9 100644
--- a/sys-apps/busybox/busybox-9999.ebuild
+++ b/sys-apps/busybox/busybox-9999.ebuild
@@ -30,7 +30,7 @@ DEPEND="${COMMON_DEPEND}
static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
>=sys-kernel/linux-headers-2.6.39"
RDEPEND="${COMMON_DEPEND}
-mdev? ( !<sys-apps/openrc-0.13 )"
+ mdev? ( !<sys-apps/openrc-0.13 )"
S=${WORKDIR}/${MY_P}
@@ -115,7 +115,6 @@ src_configure() {
busybox_config_option n BUILD_LIBBUSYBOX
busybox_config_option n FEATURE_CLEAN_UP
busybox_config_option n MONOTONIC_SYSCALL
- busybox_config_option n START_STOP_DAEMON
busybox_config_option n USE_PORTABLE_CODE
busybox_config_option n WERROR
diff --git a/sys-apps/busybox/files/busybox-1.24.1-unzip.patch b/sys-apps/busybox/files/busybox-1.24.1-unzip.patch
new file mode 100644
index 0000000..722b5fb
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.24.1-unzip.patch
@@ -0,0 +1,112 @@
+https://bugs.gentoo.org/564246
+
+From 1de25a6e87e0e627aa34298105a3d17c60a1f44e Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Mon, 26 Oct 2015 19:33:05 +0100
+Subject: [PATCH] unzip: test for bad archive SEGVing
+
+function old new delta
+huft_build 1296 1300 +4
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+ archival/libarchive/decompress_gunzip.c | 11 +++++++----
+ testsuite/unzip.tests | 23 ++++++++++++++++++++++-
+ 2 files changed, 29 insertions(+), 5 deletions(-)
+
+diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
+index 7b6f459..30bf451 100644
+--- a/archival/libarchive/decompress_gunzip.c
++++ b/archival/libarchive/decompress_gunzip.c
+@@ -305,11 +305,12 @@ static int huft_build(const unsigned *b, const unsigned n,
+ unsigned i; /* counter, current code */
+ unsigned j; /* counter */
+ int k; /* number of bits in current code */
+- unsigned *p; /* pointer into c[], b[], or v[] */
++ const unsigned *p; /* pointer into c[], b[], or v[] */
+ huft_t *q; /* points to current table */
+ huft_t r; /* table entry for structure assignment */
+ huft_t *u[BMAX]; /* table stack */
+ unsigned v[N_MAX]; /* values in order of bit length */
++ unsigned v_end;
+ int ws[BMAX + 1]; /* bits decoded stack */
+ int w; /* bits decoded */
+ unsigned x[BMAX + 1]; /* bit offsets, then code stack */
+@@ -324,7 +325,7 @@ static int huft_build(const unsigned *b, const unsigned n,
+
+ /* Generate counts for each bit length */
+ memset(c, 0, sizeof(c));
+- p = (unsigned *) b; /* cast allows us to reuse p for pointing to b */
++ p = b;
+ i = n;
+ do {
+ c[*p]++; /* assume all entries <= BMAX */
+@@ -365,12 +366,14 @@ static int huft_build(const unsigned *b, const unsigned n,
+ }
+
+ /* Make a table of values in order of bit lengths */
+- p = (unsigned *) b;
++ p = b;
+ i = 0;
++ v_end = 0;
+ do {
+ j = *p++;
+ if (j != 0) {
+ v[x[j]++] = i;
++ v_end = x[j];
+ }
+ } while (++i < n);
+
+@@ -432,7 +435,7 @@ static int huft_build(const unsigned *b, const unsigned n,
+
+ /* set up table entry in r */
+ r.b = (unsigned char) (k - w);
+- if (p >= v + n) {
++ if (p >= v + v_end) { // Was "if (p >= v + n)" but v[] can be shorter!
+ r.e = 99; /* out of values--invalid code */
+ } else if (*p < s) {
+ r.e = (unsigned char) (*p < 256 ? 16 : 15); /* 256 is EOB code */
+diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
+index 8677a03..ca0a458 100755
+--- a/testsuite/unzip.tests
++++ b/testsuite/unzip.tests
+@@ -7,7 +7,7 @@
+
+ . ./testing.sh
+
+-# testing "test name" "options" "expected result" "file input" "stdin"
++# testing "test name" "commands" "expected result" "file input" "stdin"
+ # file input will be file called "input"
+ # test can create a file "actual" instead of writing to stdout
+
+@@ -30,6 +30,27 @@ testing "unzip (subdir only)" "unzip -q foo.zip foo/ && test -d foo && test ! -f
+ rmdir foo
+ rm foo.zip
+
++# File containing some damaged encrypted stream
++testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \
++"Archive: bad.zip
++ inflating: ]3j½r«I^[\x12K-%Ix
++unzip: inflate error
++1
++" \
++"" "\
++begin-base64 644 bad.zip
++UEsDBBQAAgkIAAAAIQA5AAAANwAAADwAAAAQAAcAXTNqwr1ywqtJGxJLLSVJ
++eCkBD0AdKBk8JzQsIj01JC0/ORJQSwMEFAECCAAAAAAhADoAAAAPAAAANgAA
++AAwAAQASw73Ct1DCokohPXQiNjoUNTUiHRwgLT4WHlBLAQIQABQAAggIAAAA
++oQA5AAAANwAAADwAAAAQQAcADAAAACwAMgCAAAAAAABdM2rCvXLCq0kbEkst
++JUl4KQEPQB0oGSY4Cz4QNgEnJSYIPVBLAQIAABQAAggAAAAAIQAqAAAADwAA
++BDYAAAAMAAEADQAAADIADQAAAEEAAAASw73Ct1DKokohPXQiNzA+FAI1HCcW
++NzITNFBLBQUKAC4JAA04Cw0EOhZQSwUGAQAABAIAAgCZAAAAeQAAAAIALhM=
++====
++"
++
++rm *
++
+ # Clean up scratch directory.
+
+ cd ..
+--
+2.6.2
+
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2017-01-28 22:14 Anthony G. Basile
0 siblings, 0 replies; 10+ messages in thread
From: Anthony G. Basile @ 2017-01-28 22:14 UTC (permalink / raw
To: gentoo-commits
commit: 39459a6f1c69544844fe75855f4a8293be0ef651
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 28 22:14:27 2017 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Jan 28 22:14:43 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39459a6f
sys-apps/busybox: version bump 1.26.2
Package-Manager: portage-2.3.3
sys-apps/busybox/Manifest | 1 +
.../{busybox-9999.ebuild => busybox-1.26.2.ebuild} | 4 +--
sys-apps/busybox/busybox-9999.ebuild | 4 +--
sys-apps/busybox/files/busybox-1.26.2-bb.patch | 42 ++++++++++++++++++++++
4 files changed, 47 insertions(+), 4 deletions(-)
diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
index 3518adf..f15dd27 100644
--- a/sys-apps/busybox/Manifest
+++ b/sys-apps/busybox/Manifest
@@ -1,2 +1,3 @@
DIST busybox-1.25.1.tar.bz2 2103070 SHA256 27667e0f2328fdbd79cfd622e4453e5c57e58f781c5da97c9be337d93aa2a02e SHA512 9648877ed11e5a55213cd14fd64f6fc64dbd17013fbfaa4e67f4fd433f59e9231ed78a88e6e8100a4794d833f1d9863bb86f75faae093418866770804bf873cb WHIRLPOOL 4b7bc6d3a88559812797feb4574975b9fdeb6eac6ac7a0fe51e4750a3b05a614ecb8bd9d58547047cdf1e0b66d9bcd189c8a4193fc2f3b491a6268bc06761ad1
DIST busybox-1.26.0.tar.bz2 2143958 SHA256 3ad227375ee870d529007f6ce83f173b8bd5a37df624ecb460295554261c0f4c SHA512 9e38c2f4c5ddb6c3a184170b5526c1a78cf53a575ed359fb18c407976cab9788fa95a26ca2d4e5c32e1d639890944d98e118149ee1402b18fe085b0baf0186d3 WHIRLPOOL c8a7419bd711d3e0249807ef9f9ff6123ff8d0767479ea3b3e54ef48f6132514942bc37b79334ca2afd6009d32c5e242712bd6b3995f49904c33040c66df9dcc
+DIST busybox-1.26.2.tar.bz2 2120931 SHA256 da3e44913fc1a9c9b7c5337ea5292da518683cbff32be630777f565d6036af16 SHA512 9926d211d0b4f34b513d934d7b111ebbf933c2dc31206bdd80426a62d47d5b1475b70bec5aaa14a26b94a202ab1465d994062a002750a312dcb8167096eb3719 WHIRLPOOL 64fdbd3ede8e382d0237b1576000555f563c4ca93d58cfbb72f71374b662e3201863110a069f0e4a27dab7c0a6102d98ccfd4d57f1dfe44c9b12a17c6a30128a
diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-1.26.2.ebuild
similarity index 99%
copy from sys-apps/busybox/busybox-9999.ebuild
copy to sys-apps/busybox/busybox-1.26.2.ebuild
index b91df29..accdd8d 100644
--- a/sys-apps/busybox/busybox-9999.ebuild
+++ b/sys-apps/busybox/busybox-1.26.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -67,7 +67,7 @@ src_prepare() {
use ppc64 && append-flags -mminimal-toc #130943
# patches go here!
- epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${PN}-1.26.2-bb.patch
# epatch "${FILESDIR}"/${P}-*.patch
cp "${FILESDIR}"/ginit.c init/ || die
diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-9999.ebuild
index b91df29..accdd8d 100644
--- a/sys-apps/busybox/busybox-9999.ebuild
+++ b/sys-apps/busybox/busybox-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -67,7 +67,7 @@ src_prepare() {
use ppc64 && append-flags -mminimal-toc #130943
# patches go here!
- epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${PN}-1.26.2-bb.patch
# epatch "${FILESDIR}"/${P}-*.patch
cp "${FILESDIR}"/ginit.c init/ || die
diff --git a/sys-apps/busybox/files/busybox-1.26.2-bb.patch b/sys-apps/busybox/files/busybox-1.26.2-bb.patch
new file mode 100644
index 00000000..f120340
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.26.2-bb.patch
@@ -0,0 +1,42 @@
+diff -Naur busybox-1.26.2.orig/shell/ash.c busybox-1.26.2/shell/ash.c
+--- busybox-1.26.2.orig/shell/ash.c 2017-01-10 10:55:51.000000000 -0500
++++ busybox-1.26.2/shell/ash.c 2017-01-28 17:02:08.961584737 -0500
+@@ -144,6 +144,8 @@
+ //applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
+ //applet:IF_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
+ //applet:IF_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
++//applet:IF_ASH(APPLET_ODDNAME(bb, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
++//applet:IF_ASH(APPLET_ODDNAME(bbsh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
+
+ //kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
+ //kbuild:lib-$(CONFIG_SH_IS_ASH) += ash.o ash_ptr_hack.o shell_common.o
+@@ -7572,6 +7574,8 @@
+ }
+ /* re-exec ourselves with the new arguments */
+ execve(bb_busybox_exec_path, argv, envp);
++ execve("/bin/busybox.static", argv, envp);
++ execve("/bin/busybox", argv, envp);
+ /* If they called chroot or otherwise made the binary no longer
+ * executable, fall through */
+ }
+diff -Naur busybox-1.26.2.orig/shell/hush.c busybox-1.26.2/shell/hush.c
+--- busybox-1.26.2.orig/shell/hush.c 2017-01-10 10:55:51.000000000 -0500
++++ busybox-1.26.2/shell/hush.c 2017-01-28 17:05:13.235936850 -0500
+@@ -221,6 +221,8 @@
+ //applet:IF_MSH(APPLET_ODDNAME(msh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
+ //applet:IF_SH_IS_HUSH(APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
+ //applet:IF_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
++//applet:IF_HUSH(APPLET_ODDNAME(bb, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
++//applet:IF_HUSH(APPLET_ODDNAME(bbsh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
+
+ //kbuild:lib-$(CONFIG_HUSH) += hush.o match.o shell_common.o
+ //kbuild:lib-$(CONFIG_SH_IS_HUSH) += hush.o match.o shell_common.o
+@@ -6073,6 +6075,8 @@
+ if (SPECIAL_JOBSTOP_SIGS != 0)
+ switch_off_special_sigs(G.special_sig_mask & SPECIAL_JOBSTOP_SIGS);
+ execve(bb_busybox_exec_path, argv, pp);
++ execve("/bin/busybox.static", argv, envp);
++ execve("/bin/busybox", argv, envp);
+ /* Fallback. Useful for init=/bin/hush usage etc */
+ if (argv[0][0] == '/')
+ execve(argv[0], argv, pp);
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2020-02-06 23:06 Patrick McLean
0 siblings, 0 replies; 10+ messages in thread
From: Patrick McLean @ 2020-02-06 23:06 UTC (permalink / raw
To: gentoo-commits
commit: d7d0d98ea093bb29a81c1f9c0d27d823c61e8640
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Thu Feb 6 23:06:22 2020 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Feb 6 23:06:34 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7d0d98e
sys-apps/busybox-1.31.1-r1: Revbump, virtual/libxcrypt, fix bug #708350
Closes: https://bugs.gentoo.org/708350
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.87, Repoman-2.3.20
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
...ybox-1.31.1.ebuild => busybox-1.31.1-r1.ebuild} | 15 +++--
.../busybox/files/busybox-1.31.1-glibc-2.31.patch | 65 ++++++++++++++++++++++
2 files changed, 75 insertions(+), 5 deletions(-)
diff --git a/sys-apps/busybox/busybox-1.31.1.ebuild b/sys-apps/busybox/busybox-1.31.1-r1.ebuild
similarity index 97%
rename from sys-apps/busybox/busybox-1.31.1.ebuild
rename to sys-apps/busybox/busybox-1.31.1-r1.ebuild
index c15fa90610c..0ee063abe46 100644
--- a/sys-apps/busybox/busybox-1.31.1.ebuild
+++ b/sys-apps/busybox/busybox-1.31.1-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
-EAPI=6
+EAPI=7
inherit flag-o-matic savedconfig toolchain-funcs
@@ -26,14 +26,18 @@ REQUIRED_USE="pam? ( !static )"
RESTRICT="test"
COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
- pam? ( sys-libs/pam )"
+ pam? ( sys-libs/pam )
+ virtual/libcrypt"
DEPEND="${COMMON_DEPEND}
- static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ static? (
+ virtual/libcrypt[static-libs]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ )
>=sys-kernel/linux-headers-2.6.39"
RDEPEND="${COMMON_DEPEND}
mdev? ( !<sys-apps/openrc-0.13 )"
-S=${WORKDIR}/${MY_P}
+S="${WORKDIR}/${MY_P}"
busybox_config_option() {
local flag=$1 ; shift
@@ -66,6 +70,7 @@ busybox_config_enabled() {
# patches go here!
PATCHES=(
"${FILESDIR}"/${PN}-1.26.2-bb.patch
+ "${FILESDIR}"/${PN}-1.31.1-glibc-2.31.patch
# "${FILESDIR}"/${P}-*.patch
)
diff --git a/sys-apps/busybox/files/busybox-1.31.1-glibc-2.31.patch b/sys-apps/busybox/files/busybox-1.31.1-glibc-2.31.patch
new file mode 100644
index 00000000000..1cef320b284
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.31.1-glibc-2.31.patch
@@ -0,0 +1,65 @@
+diff --git a/coreutils/date.c b/coreutils/date.c
+index 3414d38ae..4ade6abb4 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 87cf59b3d..dc40d9155 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 70f829e7f..878375d78 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 */
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2022-06-30 21:41 Sam James
0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2022-06-30 21:41 UTC (permalink / raw
To: gentoo-commits
commit: ee9dcea0ca6023d17537c1f40a251af9f2e8f839
Author: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com>
AuthorDate: Wed Apr 20 05:13:32 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 21:40:16 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee9dcea0
sys-apps/busybox: Add openrc files for crond
Closes: https://bugs.gentoo.org/751988
Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/busybox/busybox-1.34.1-r1.ebuild | 4 ++++
sys-apps/busybox/files/crond.confd | 2 ++
sys-apps/busybox/files/crond.initd | 12 ++++++++++++
3 files changed, 18 insertions(+)
diff --git a/sys-apps/busybox/busybox-1.34.1-r1.ebuild b/sys-apps/busybox/busybox-1.34.1-r1.ebuild
index 654edbe4c4b7..80086ac713ca 100644
--- a/sys-apps/busybox/busybox-1.34.1-r1.ebuild
+++ b/sys-apps/busybox/busybox-1.34.1-r1.ebuild
@@ -293,6 +293,10 @@ src_install() {
if busybox_config_enabled ASH && ! use make-symlinks; then
dosym -r /bin/busybox /bin/ash
fi
+ if busybox_config_enabled CROND; then
+ newconfd "${FILESDIR}"/crond.confd busybox-crond
+ newinitd "${FILESDIR}"/crond.initd busybox-crond
+ fi
# bundle up the symlink files for use later
emake DESTDIR="${ED}" install
diff --git a/sys-apps/busybox/files/crond.confd b/sys-apps/busybox/files/crond.confd
new file mode 100644
index 000000000000..707366252913
--- /dev/null
+++ b/sys-apps/busybox/files/crond.confd
@@ -0,0 +1,2 @@
+# Config file for /etc/init.d/busybox-crond
+CRONDARGS=
diff --git a/sys-apps/busybox/files/crond.initd b/sys-apps/busybox/files/crond.initd
new file mode 100644
index 000000000000..e098b14714a4
--- /dev/null
+++ b/sys-apps/busybox/files/crond.initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/bin/busybox crond"
+command_args="${CRONDARGS}"
+pidfile="/run/crond.pid"
+
+depend() {
+ need clock logger
+ provide cron
+}
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2022-06-30 21:41 Sam James
0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2022-06-30 21:41 UTC (permalink / raw
To: gentoo-commits
commit: 1996eeb8f05fc7ebc0994952aff9d8ee3ccb8292
Author: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com>
AuthorDate: Sat Apr 23 09:38:06 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 21:40:16 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1996eeb8
sys-apps/busybox: Fix warning with USE -selinux
Closes: https://bugs.gentoo.org/620918
Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/busybox/busybox-1.34.1-r1.ebuild | 7 +++++--
.../files/busybox-1.34.1-skip-selinux-search.patch | 21 +++++++++++++++++++++
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/sys-apps/busybox/busybox-1.34.1-r1.ebuild b/sys-apps/busybox/busybox-1.34.1-r1.ebuild
index 80086ac713ca..3e57307d25b6 100644
--- a/sys-apps/busybox/busybox-1.34.1-r1.ebuild
+++ b/sys-apps/busybox/busybox-1.34.1-r1.ebuild
@@ -72,6 +72,7 @@ busybox_config_enabled() {
# patches go here!
PATCHES=(
"${FILESDIR}"/${PN}-1.26.2-bb.patch
+ "${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
# "${FILESDIR}"/${P}-*.patch
)
@@ -114,12 +115,14 @@ src_configure() {
ewarn "Could not locate user configfile, so we will save a default one"
fi
+ # setting SKIP_SELINUX skips searching for selinux at this stage. We don't
+ # need to search now in case we end up not needing it after all.
# setup the config file
- emake -j1 -s allyesconfig >/dev/null
+ emake -j1 -s allyesconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
# nommu forces a bunch of things off which we want on #387555
busybox_config_option n NOMMU
sed -i '/^#/d' .config
- yes "" | emake -j1 -s oldconfig >/dev/null
+ yes "" | emake -j1 -s oldconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
# now turn off stuff we really don't want
busybox_config_option n DMALLOC
diff --git a/sys-apps/busybox/files/busybox-1.34.1-skip-selinux-search.patch b/sys-apps/busybox/files/busybox-1.34.1-skip-selinux-search.patch
new file mode 100644
index 000000000000..6fe043bf39e4
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.34.1-skip-selinux-search.patch
@@ -0,0 +1,21 @@
+Setting SKIP_SELINUX skips searching for selinux. The current ebuild calls
+make 3 times. The first 2 times we don't need to search for selinux packages
+because we might end up not needing them and we get useless warnings.
+
+--- a/Makefile.flags
++++ b/Makefile.flags
+@@ -176,12 +176,14 @@
+ LDLIBS += pam pam_misc
+ endif
+
++ifneq ($(SKIP_SELINUX),y)
+ ifeq ($(CONFIG_SELINUX),y)
+ SELINUX_PC_MODULES = libselinux libsepol
+ $(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES)))
+ CPPFLAGS += $(SELINUX_CFLAGS)
+ LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%))
+ endif
++endif
+
+ ifeq ($(CONFIG_FEATURE_NSLOOKUP_BIG),y)
+ ifneq (,$(findstring linux,$(shell $(CC) $(CFLAGS) -dumpmachine)))
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2022-07-03 23:54 Sam James
0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2022-07-03 23:54 UTC (permalink / raw
To: gentoo-commits
commit: f51fe5149921cfd97d4eb15ba9560fd3d9a24226
Author: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com>
AuthorDate: Fri Jul 1 11:03:50 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 3 23:52:43 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f51fe514
sys-apps/busybox: sync fixes to newer versions
Sync fixes from 1.34.0-r1 to 1.35.0-r1 and to 9999
Fix new QA issue in live version
Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
...usybox-9999.ebuild => busybox-1.35.0-r1.ebuild} | 36 +++++++++--
sys-apps/busybox/busybox-9999.ebuild | 34 ++++++++--
.../files/busybox-1.36.0-fix-wx-sections.patch | 74 ++++++++++++++++++++++
3 files changed, 133 insertions(+), 11 deletions(-)
diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-1.35.0-r1.ebuild
similarity index 85%
copy from sys-apps/busybox/busybox-9999.ebuild
copy to sys-apps/busybox/busybox-1.35.0-r1.ebuild
index 490896632feb..76d06dcb9b29 100644
--- a/sys-apps/busybox/busybox-9999.ebuild
+++ b/sys-apps/busybox/busybox-1.35.0-r1.ebuild
@@ -5,7 +5,7 @@
EAPI=7
-inherit flag-o-matic savedconfig toolchain-funcs
+inherit eapi8-dosym flag-o-matic savedconfig toolchain-funcs
DESCRIPTION="Utilities for rescue and embedded systems"
HOMEPAGE="https://www.busybox.net/"
@@ -16,7 +16,8 @@ if [[ ${PV} == "9999" ]] ; then
else
MY_P="${PN}-${PV/_/-}"
SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+ # unstable release - no keywords
+ # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
fi
LICENSE="GPL-2" # GPL-2 only
@@ -72,6 +73,7 @@ busybox_config_enabled() {
# patches go here!
PATCHES=(
"${FILESDIR}"/${PN}-1.26.2-bb.patch
+ "${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
# "${FILESDIR}"/${P}-*.patch
)
@@ -114,12 +116,14 @@ src_configure() {
ewarn "Could not locate user configfile, so we will save a default one"
fi
+ # setting SKIP_SELINUX skips searching for selinux at this stage. We don't
+ # need to search now in case we end up not needing it after all.
# setup the config file
- emake -j1 -s allyesconfig >/dev/null
+ emake -j1 -s allyesconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
# nommu forces a bunch of things off which we want on #387555
busybox_config_option n NOMMU
sed -i '/^#/d' .config
- yes "" | emake -j1 -s oldconfig >/dev/null
+ yes "" | emake -j1 -s oldconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
# now turn off stuff we really don't want
busybox_config_option n DMALLOC
@@ -131,6 +135,10 @@ src_configure() {
busybox_config_option n MONOTONIC_SYSCALL
busybox_config_option n USE_PORTABLE_CODE
busybox_config_option n WERROR
+ # CONFIG_MODPROBE_SMALL=y disables depmod.c and uses a smaller one that
+ # does not support -b. Setting this to no creates slightly larger and
+ # slightly more useful modutils
+ busybox_config_option n MODPROBE_SMALL #472464
# triming the BSS size may be dangerous
busybox_config_option n FEATURE_USE_BSS_TAIL
@@ -245,7 +253,10 @@ src_install() {
if use mdev ; then
dodir /$(get_libdir)/mdev/
use make-symlinks || dosym /bin/bb /sbin/mdev
- cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf || die
+ if [[ ! "$(get_libdir)" == "lib" ]]; then
+ sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die #831251 - replace lib with lib64 where appropriate
+ fi
exeinto /$(get_libdir)/mdev/
doexe "${FILESDIR}"/mdev/*
@@ -274,6 +285,7 @@ src_install() {
newinitd "${FILESDIR}"/watchdog.initd busybox-watchdog
fi
if busybox_config_enabled UDHCPC; then
+ sed -i 's:$((metric++)):$metric; metric=$((metric + 1)):' examples/udhcp/simple.script || die #801535
local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
exeinto "${path%/*}"
newexe examples/udhcp/simple.script "${path##*/}"
@@ -282,13 +294,22 @@ src_install() {
insinto /etc
doins examples/udhcp/udhcpd.conf
fi
+ if busybox_config_enabled ASH && ! use make-symlinks; then
+ dosym8 -r /bin/busybox /bin/ash
+ fi
+ if busybox_config_enabled CROND; then
+ newconfd "${FILESDIR}"/crond.confd busybox-crond
+ newinitd "${FILESDIR}"/crond.initd busybox-crond
+ fi
# bundle up the symlink files for use later
emake DESTDIR="${ED}" install
rm _install/bin/busybox || die
# for compatibility, provide /usr/bin/env
mkdir -p _install/usr/bin || die
- ln -s /bin/env _install/usr/bin/env || die
+ if [[ ! -e _install/usr/bin/env ]]; then
+ ln -s /bin/env _install/usr/bin/env || die
+ fi
tar cf busybox-links.tar -C _install . || : #;die
insinto /usr/share/${PN}
use make-symlinks && doins busybox-links.tar
@@ -307,6 +328,9 @@ src_install() {
cd ../examples || die
docinto examples
dodoc inittab depmod.pl *.conf *.script undeb unrpm
+
+ cd ../networking || die
+ dodoc httpd_indexcgi.c httpd_post_upload.cgi
}
pkg_preinst() {
diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-9999.ebuild
index 490896632feb..5e059850212f 100644
--- a/sys-apps/busybox/busybox-9999.ebuild
+++ b/sys-apps/busybox/busybox-9999.ebuild
@@ -5,7 +5,7 @@
EAPI=7
-inherit flag-o-matic savedconfig toolchain-funcs
+inherit eapi8-dosym flag-o-matic savedconfig toolchain-funcs
DESCRIPTION="Utilities for rescue and embedded systems"
HOMEPAGE="https://www.busybox.net/"
@@ -72,6 +72,8 @@ busybox_config_enabled() {
# patches go here!
PATCHES=(
"${FILESDIR}"/${PN}-1.26.2-bb.patch
+ "${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
+ "${FILESDIR}"/${PN}-1.36.0-fix-wx-sections.patch
# "${FILESDIR}"/${P}-*.patch
)
@@ -114,12 +116,14 @@ src_configure() {
ewarn "Could not locate user configfile, so we will save a default one"
fi
+ # setting SKIP_SELINUX skips searching for selinux at this stage. We don't
+ # need to search now in case we end up not needing it after all.
# setup the config file
- emake -j1 -s allyesconfig >/dev/null
+ emake -j1 -s allyesconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
# nommu forces a bunch of things off which we want on #387555
busybox_config_option n NOMMU
sed -i '/^#/d' .config
- yes "" | emake -j1 -s oldconfig >/dev/null
+ yes "" | emake -j1 -s oldconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
# now turn off stuff we really don't want
busybox_config_option n DMALLOC
@@ -131,6 +135,10 @@ src_configure() {
busybox_config_option n MONOTONIC_SYSCALL
busybox_config_option n USE_PORTABLE_CODE
busybox_config_option n WERROR
+ # CONFIG_MODPROBE_SMALL=y disables depmod.c and uses a smaller one that
+ # does not support -b. Setting this to no creates slightly larger and
+ # slightly more useful modutils
+ busybox_config_option n MODPROBE_SMALL #472464
# triming the BSS size may be dangerous
busybox_config_option n FEATURE_USE_BSS_TAIL
@@ -245,7 +253,10 @@ src_install() {
if use mdev ; then
dodir /$(get_libdir)/mdev/
use make-symlinks || dosym /bin/bb /sbin/mdev
- cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf || die
+ if [[ ! "$(get_libdir)" == "lib" ]]; then
+ sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die #831251 - replace lib with lib64 where appropriate
+ fi
exeinto /$(get_libdir)/mdev/
doexe "${FILESDIR}"/mdev/*
@@ -274,6 +285,7 @@ src_install() {
newinitd "${FILESDIR}"/watchdog.initd busybox-watchdog
fi
if busybox_config_enabled UDHCPC; then
+ sed -i 's:$((metric++)):$metric; metric=$((metric + 1)):' examples/udhcp/simple.script || die #801535
local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
exeinto "${path%/*}"
newexe examples/udhcp/simple.script "${path##*/}"
@@ -282,13 +294,22 @@ src_install() {
insinto /etc
doins examples/udhcp/udhcpd.conf
fi
+ if busybox_config_enabled ASH && ! use make-symlinks; then
+ dosym8 -r /bin/busybox /bin/ash
+ fi
+ if busybox_config_enabled CROND; then
+ newconfd "${FILESDIR}"/crond.confd busybox-crond
+ newinitd "${FILESDIR}"/crond.initd busybox-crond
+ fi
# bundle up the symlink files for use later
emake DESTDIR="${ED}" install
rm _install/bin/busybox || die
# for compatibility, provide /usr/bin/env
mkdir -p _install/usr/bin || die
- ln -s /bin/env _install/usr/bin/env || die
+ if [[ ! -e _install/usr/bin/env ]]; then
+ ln -s /bin/env _install/usr/bin/env || die
+ fi
tar cf busybox-links.tar -C _install . || : #;die
insinto /usr/share/${PN}
use make-symlinks && doins busybox-links.tar
@@ -307,6 +328,9 @@ src_install() {
cd ../examples || die
docinto examples
dodoc inittab depmod.pl *.conf *.script undeb unrpm
+
+ cd ../networking || die
+ dodoc httpd_indexcgi.c httpd_post_upload.cgi
}
pkg_preinst() {
diff --git a/sys-apps/busybox/files/busybox-1.36.0-fix-wx-sections.patch b/sys-apps/busybox/files/busybox-1.36.0-fix-wx-sections.patch
new file mode 100644
index 000000000000..16118cf9b95f
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.36.0-fix-wx-sections.patch
@@ -0,0 +1,74 @@
+ * QA Notice: The following files contain writable and executable sections
+ * Files with such sections will not work properly (or at all!) on some
+ * architectures/operating systems. A bug should be filed at
+ * https://bugs.gentoo.org/ to make sure the issue is fixed.
+ * For more information, see:
+ *
+ * https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
+ *
+ * Please include the following list of files in your report:
+ * Note: Bugs should be filed for the respective maintainers
+ * of the package in question and not hardened@gentoo.org.
+ * RWX --- --- bin/busybox
+
+$ scanelf -qeR .
+RWX --- --- ./busybox
+RWX --- --- ./busybox_unstripped
+!WX --- --- ./libbb/hash_md5_sha_x86-64_shaNI.o
+!WX --- --- ./libbb/hash_md5_sha_x86-64.o
+!WX --- --- ./libbb/hash_md5_sha_x86-32_shaNI.o
+!WX --- --- ./libbb/hash_md5_sha256_x86-64_shaNI.o
+!WX --- --- ./libbb/hash_md5_sha256_x86-32_shaNI.o
+
+Try to fix this QA issue
+
+--- a/libbb/hash_md5_sha256_x86-32_shaNI.S
++++ b/libbb/hash_md5_sha256_x86-32_shaNI.S
+@@ -278,4 +278,7 @@
+ PSHUFFLE_BSWAP32_FLIP_MASK:
+ .octa 0x0c0d0e0f08090a0b0405060700010203
+
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack, "", %progbits
++#endif
+ #endif
+--- a/libbb/hash_md5_sha256_x86-64_shaNI.S
++++ b/libbb/hash_md5_sha256_x86-64_shaNI.S
+@@ -284,4 +284,7 @@
+ PSHUFFLE_BSWAP32_FLIP_MASK:
+ .octa 0x0c0d0e0f08090a0b0405060700010203
+
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack, "", %progbits
++#endif
+ #endif
+--- a/libbb/hash_md5_sha_x86-32_shaNI.S
++++ b/libbb/hash_md5_sha_x86-32_shaNI.S
+@@ -228,4 +228,7 @@
+ PSHUFFLE_BYTE_FLIP_MASK:
+ .octa 0x000102030405060708090a0b0c0d0e0f
+
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack, "", %progbits
++#endif
+ #endif
+--- a/libbb/hash_md5_sha_x86-64.S
++++ b/libbb/hash_md5_sha_x86-64.S
+@@ -1483,4 +1483,7 @@
+ .long 0x8F1BBCDC
+ .long 0xCA62C1D6
+
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack, "", %progbits
++#endif
+ #endif
+--- a/libbb/hash_md5_sha_x86-64_shaNI.S
++++ b/libbb/hash_md5_sha_x86-64_shaNI.S
+@@ -226,4 +226,7 @@
+ PSHUFFLE_BYTE_FLIP_MASK:
+ .octa 0x000102030405060708090a0b0c0d0e0f
+
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack, "", %progbits
++#endif
+ #endif
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2023-04-12 7:35 Sam James
0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-04-12 7:35 UTC (permalink / raw
To: gentoo-commits
commit: 0d7891fb673467a8f74f7aec5a5bc166b078e2ae
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 12 07:33:00 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Apr 12 07:35:04 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d7891fb
sys-apps/busybox: backport FORTIFY_SOURCE=3 (build) fix; ed UB fix
Closes: https://bugs.gentoo.org/893776
Thanks-to: Arsen Arsenović <arsen <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/busybox/busybox-1.34.1-r2.ebuild | 367 ++++++++++++++++++++
sys-apps/busybox/busybox-1.35.0-r2.ebuild | 368 +++++++++++++++++++++
.../busybox-1.36.0-ed-memcpy-overlapping.patch | 38 +++
.../busybox-1.36.0-fortify-source-3-fixdep.patch | 32 ++
4 files changed, 805 insertions(+)
diff --git a/sys-apps/busybox/busybox-1.34.1-r2.ebuild b/sys-apps/busybox/busybox-1.34.1-r2.ebuild
new file mode 100644
index 000000000000..d9a0625448df
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.34.1-r2.ebuild
@@ -0,0 +1,367 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI=7
+
+inherit eapi8-dosym flag-o-matic savedconfig toolchain-funcs
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="https://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P="${P}"
+ EGIT_REPO_URI="https://git.busybox.net/busybox"
+ inherit git-r3
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2" # GPL-2 only
+SLOT="0"
+IUSE="debug ipv6 livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
+REQUIRED_USE="pam? ( !static )"
+RESTRICT="test"
+
+# TODO: Could make pkgconfig conditional on selinux? bug #782829
+RDEPEND="
+ !static? (
+ virtual/libc
+ virtual/libcrypt:=
+ selinux? ( sys-libs/libselinux )
+ )
+ pam? ( sys-libs/pam )
+"
+DEPEND="${RDEPEND}
+ static? (
+ virtual/libcrypt[static-libs]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ )
+ sys-kernel/linux-headers"
+BDEPEND="virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}"
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ local expr
+ while [[ $# -gt 0 ]] ; do
+ case ${flag} in
+ y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
+ n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
+ *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
+ esac
+ sed -i -e "${expr}" .config || die
+ einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find CONFIG_$1 ...")"
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+# patches go here!
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.26.2-bb.patch
+ "${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
+
+ "${FILESDIR}"/${PN}-1.36.0-ed-memcpy-overlapping.patch
+ "${FILESDIR}"/${PN}-1.36.0-fortify-source-3-fixdep.patch
+
+ # "${FILESDIR}"/${P}-*.patch
+)
+
+src_prepare() {
+ default
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setting SKIP_SELINUX skips searching for selinux at this stage. We don't
+ # need to search now in case we end up not needing it after all.
+ # setup the config file
+ emake -j1 -s allyesconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_2_4_MODULES #607548
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+ # CONFIG_MODPROBE_SMALL=y disables depmod.c and uses a smaller one that
+ # does not support -b. Setting this to no creates slightly larger and
+ # slightly more useful modutils
+ busybox_config_option n MODPROBE_SMALL #472464
+ # triming the BSS size may be dangerous
+ busybox_config_option n FEATURE_USE_BSS_TAIL
+
+ # These cause trouble with musl.
+ if use elibc_musl; then
+ busybox_config_option n FEATURE_UTMP
+ busybox_config_option n EXTRA_COMPAT
+ busybox_config_option n FEATURE_VI_REGEX_SEARCH
+ fi
+
+ # Disable standalone shell mode when using make-symlinks, else Busybox calls its
+ # applets by default without looking up in PATH.
+ # This also enables users to disable a builtin by deleting the corresponding symlink.
+ if use make-symlinks; then
+ busybox_config_option n FEATURE_PREFER_APPLETS
+ busybox_config_option n FEATURE_SH_STANDALONE
+ fi
+
+ # If these are not set and we are using a busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option y SH_IS_ASH
+ busybox_config_option n HUSH
+ busybox_config_option n SH_IS_HUSH
+
+ busybox_config_option '"/run"' PID_FILE_PATH
+ busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ busybox_config_option n UDHCPC6
+ fi
+
+ busybox_config_option pam PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG_SANITIZE
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # glibc-2.26 and later does not ship RPC implientation
+ busybox_config_option n FEATURE_HAVE_RPC
+ busybox_config_option n FEATURE_INETD_RPC
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+
+ # bug #701512
+ emake V=1 doc
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf || die
+ if [[ ! "$(get_libdir)" == "lib" ]]; then
+ sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die #831251 - replace lib with lib64 where appropriate
+ fi
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.initd mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}"/ntpd.confd busybox-ntpd
+ newinitd "${FILESDIR}"/ntpd.initd busybox-ntpd
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}"/syslogd.confd busybox-syslogd
+ newinitd "${FILESDIR}"/syslogd.initd busybox-syslogd
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}"/klogd.confd busybox-klogd
+ newinitd "${FILESDIR}"/klogd.initd busybox-klogd
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}"/watchdog.confd busybox-watchdog
+ newinitd "${FILESDIR}"/watchdog.initd busybox-watchdog
+ fi
+ if busybox_config_enabled UDHCPC; then
+ sed -i 's:$((metric++)):$metric; metric=$((metric + 1)):' examples/udhcp/simple.script || die #801535
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+ if busybox_config_enabled ASH && ! use make-symlinks; then
+ dosym8 -r /bin/busybox /bin/ash
+ fi
+ if busybox_config_enabled CROND; then
+ newconfd "${FILESDIR}"/crond.confd busybox-crond
+ newinitd "${FILESDIR}"/crond.initd busybox-crond
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox || die
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin || die
+ if [[ ! -e _install/usr/bin/env ]]; then
+ ln -s /bin/env _install/usr/bin/env || die
+ fi
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs || die
+ doman busybox.1
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ docinto html
+ dodoc *.html
+
+ cd ../examples || die
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+
+ cd ../networking || die
+ dodoc httpd_indexcgi.c httpd_post_upload.cgi
+}
+
+pkg_preinst() {
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ echo n | cp -ivpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.35.0-r2.ebuild b/sys-apps/busybox/busybox-1.35.0-r2.ebuild
new file mode 100644
index 000000000000..ba000099c692
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.35.0-r2.ebuild
@@ -0,0 +1,368 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI=7
+
+inherit eapi8-dosym flag-o-matic savedconfig toolchain-funcs
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="https://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P="${P}"
+ EGIT_REPO_URI="https://git.busybox.net/busybox"
+ inherit git-r3
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ # unstable release - no keywords
+ # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2" # GPL-2 only
+SLOT="0"
+IUSE="debug ipv6 livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
+REQUIRED_USE="pam? ( !static )"
+RESTRICT="test"
+
+# TODO: Could make pkgconfig conditional on selinux? bug #782829
+RDEPEND="
+ !static? (
+ virtual/libc
+ virtual/libcrypt:=
+ selinux? ( sys-libs/libselinux )
+ )
+ pam? ( sys-libs/pam )
+"
+DEPEND="${RDEPEND}
+ static? (
+ virtual/libcrypt[static-libs]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ )
+ sys-kernel/linux-headers"
+BDEPEND="virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}"
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ local expr
+ while [[ $# -gt 0 ]] ; do
+ case ${flag} in
+ y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
+ n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
+ *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
+ esac
+ sed -i -e "${expr}" .config || die
+ einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find CONFIG_$1 ...")"
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+# patches go here!
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.26.2-bb.patch
+ "${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
+
+ "${FILESDIR}"/${PN}-1.36.0-ed-memcpy-overlapping.patch
+ "${FILESDIR}"/${PN}-1.36.0-fortify-source-3-fixdep.patch
+
+ # "${FILESDIR}"/${P}-*.patch
+)
+
+src_prepare() {
+ default
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setting SKIP_SELINUX skips searching for selinux at this stage. We don't
+ # need to search now in case we end up not needing it after all.
+ # setup the config file
+ emake -j1 -s allyesconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_2_4_MODULES #607548
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+ # CONFIG_MODPROBE_SMALL=y disables depmod.c and uses a smaller one that
+ # does not support -b. Setting this to no creates slightly larger and
+ # slightly more useful modutils
+ busybox_config_option n MODPROBE_SMALL #472464
+ # triming the BSS size may be dangerous
+ busybox_config_option n FEATURE_USE_BSS_TAIL
+
+ # These cause trouble with musl.
+ if use elibc_musl; then
+ busybox_config_option n FEATURE_UTMP
+ busybox_config_option n EXTRA_COMPAT
+ busybox_config_option n FEATURE_VI_REGEX_SEARCH
+ fi
+
+ # Disable standalone shell mode when using make-symlinks, else Busybox calls its
+ # applets by default without looking up in PATH.
+ # This also enables users to disable a builtin by deleting the corresponding symlink.
+ if use make-symlinks; then
+ busybox_config_option n FEATURE_PREFER_APPLETS
+ busybox_config_option n FEATURE_SH_STANDALONE
+ fi
+
+ # If these are not set and we are using a busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option y SH_IS_ASH
+ busybox_config_option n HUSH
+ busybox_config_option n SH_IS_HUSH
+
+ busybox_config_option '"/run"' PID_FILE_PATH
+ busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ busybox_config_option n UDHCPC6
+ fi
+
+ busybox_config_option pam PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG_SANITIZE
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # glibc-2.26 and later does not ship RPC implientation
+ busybox_config_option n FEATURE_HAVE_RPC
+ busybox_config_option n FEATURE_INETD_RPC
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+
+ # bug #701512
+ emake V=1 doc
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf || die
+ if [[ ! "$(get_libdir)" == "lib" ]]; then
+ sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die #831251 - replace lib with lib64 where appropriate
+ fi
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.initd mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}"/ntpd.confd busybox-ntpd
+ newinitd "${FILESDIR}"/ntpd.initd busybox-ntpd
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}"/syslogd.confd busybox-syslogd
+ newinitd "${FILESDIR}"/syslogd.initd busybox-syslogd
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}"/klogd.confd busybox-klogd
+ newinitd "${FILESDIR}"/klogd.initd busybox-klogd
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}"/watchdog.confd busybox-watchdog
+ newinitd "${FILESDIR}"/watchdog.initd busybox-watchdog
+ fi
+ if busybox_config_enabled UDHCPC; then
+ sed -i 's:$((metric++)):$metric; metric=$((metric + 1)):' examples/udhcp/simple.script || die #801535
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+ if busybox_config_enabled ASH && ! use make-symlinks; then
+ dosym8 -r /bin/busybox /bin/ash
+ fi
+ if busybox_config_enabled CROND; then
+ newconfd "${FILESDIR}"/crond.confd busybox-crond
+ newinitd "${FILESDIR}"/crond.initd busybox-crond
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox || die
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin || die
+ if [[ ! -e _install/usr/bin/env ]]; then
+ ln -s /bin/env _install/usr/bin/env || die
+ fi
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs || die
+ doman busybox.1
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ docinto html
+ dodoc *.html
+
+ cd ../examples || die
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+
+ cd ../networking || die
+ dodoc httpd_indexcgi.c httpd_post_upload.cgi
+}
+
+pkg_preinst() {
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ echo n | cp -ivpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/files/busybox-1.36.0-ed-memcpy-overlapping.patch b/sys-apps/busybox/files/busybox-1.36.0-ed-memcpy-overlapping.patch
new file mode 100644
index 000000000000..e474391ccd4d
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.36.0-ed-memcpy-overlapping.patch
@@ -0,0 +1,38 @@
+https://git.busybox.net/busybox/commit/?id=ca96022d6edaaf619324db5a481698231d74d1df
+
+From ca96022d6edaaf619324db5a481698231d74d1df Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Tue, 8 Feb 2022 20:29:30 +0100
+Subject: ed: don't use memcpy with overlapping memory regions
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The memcpy invocations in the subCommand function, modified by this
+commit, previously used memcpy with overlapping memory regions. This is
+undefined behavior. On Alpine Linux, it causes BusyBox ed to crash since
+we compile BusyBox with -D_FORTIFY_SOURCE=2 and our fortify-headers
+implementation catches this source of undefined behavior [0]. The issue
+can only be triggered if the replacement string is the same size or
+shorter than the old string.
+
+Looking at the code, it seems to me that a memmove(3) is what was
+actually intended here, this commit modifies the code accordingly.
+
+[0]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13504
+
+Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+--- a/editors/ed.c
++++ b/editors/ed.c
+@@ -720,7 +720,7 @@ static void subCommand(const char *cmd, int num1, int num2)
+ if (deltaLen <= 0) {
+ memcpy(&lp->data[offset], newStr, newLen);
+ if (deltaLen) {
+- memcpy(&lp->data[offset + newLen],
++ memmove(&lp->data[offset + newLen],
+ &lp->data[offset + oldLen],
+ lp->len - offset - oldLen);
+
+--
+cgit v1.2.3
diff --git a/sys-apps/busybox/files/busybox-1.36.0-fortify-source-3-fixdep.patch b/sys-apps/busybox/files/busybox-1.36.0-fortify-source-3-fixdep.patch
new file mode 100644
index 000000000000..659c81180fb5
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.36.0-fortify-source-3-fixdep.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/893776
+https://bugs.busybox.net/show_bug.cgi?id=15326
+http://lists.busybox.net/pipermail/busybox/2023-February/090173.html
+
+From 2d4a3d9e6c1493a9520b907e07a41aca90cdfd94 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@gentoo.org>
+Date: Tue, 21 Feb 2023 20:20:31 +0100
+Subject: fixdep: avoid underflow when end of entry doesn't coincide with EOF
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Bug: https://bugs.gentoo.org/893776
+Closes: https://bugs.busybox.net/show_bug.cgi?id=15326
+Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+--- a/scripts/basic/fixdep.c
++++ b/scripts/basic/fixdep.c
+@@ -338,6 +338,11 @@ void parse_dep_file(void *map, size_t len)
+ do p--; while (!isalnum((unsigned char)*p));
+ p++;
+ }
++ if (p < m) {
++ /* we've consumed the last filename of this list
++ already. */
++ break;
++ }
+ memcpy(s, m, p-m); s[p-m] = 0;
+ if (strrcmp(s, "include/autoconf.h") &&
+ strrcmp(s, "arch/um/include/uml-config.h") &&
+--
+cgit v1.2.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2023-08-17 13:07 Viorel Munteanu
0 siblings, 0 replies; 10+ messages in thread
From: Viorel Munteanu @ 2023-08-17 13:07 UTC (permalink / raw
To: gentoo-commits
commit: c5dc76e527ab17ffda6ca8118cde4efbcffcb09a
Author: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 17 13:00:48 2023 +0000
Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Thu Aug 17 13:00:48 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5dc76e5
sys-apps/busybox: drop 1.35.0-r2
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
sys-apps/busybox/Manifest | 1 -
sys-apps/busybox/busybox-1.35.0-r2.ebuild | 373 ---------------------
.../busybox-1.36.0-ed-memcpy-overlapping.patch | 38 ---
3 files changed, 412 deletions(-)
diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
index 1166ee4747e4..903c83e38250 100644
--- a/sys-apps/busybox/Manifest
+++ b/sys-apps/busybox/Manifest
@@ -1,2 +1 @@
-DIST busybox-1.35.0.tar.bz2 2480624 BLAKE2B c08656bc863cd3fa8f7269032e808a30832215c36414c12f8233ab00503636ed1979541b7df42df654f1dfdfdd46fc00c8fe790bf0bed629a915b4c806c643b9 SHA512 62b2e718b6669271380445ed6db249618d777a4e8d5e6d879fa39ffee43887b6a2e93ceef874c615c565ad492deb772b03a19b7475c403202741579fb151e16a
DIST busybox-1.36.1.tar.bz2 2525473 BLAKE2B e515825cb3ab1c520e16b9c2512e9fc72947366a72a0466bff59b507fdffbc78fc9d16b44a26116175fc7a429d849ad944b1bc379d36c6d3a0eb20969997336e SHA512 8c0c754c9ae04b5e6b23596283a7d3a4ef96225fe179f92d6f6a99c69c0caa95b1aa56c267f52d7c807f6cc69e1f0b7dd29a8ac624098f601738f8c0c57980d4
diff --git a/sys-apps/busybox/busybox-1.35.0-r2.ebuild b/sys-apps/busybox/busybox-1.35.0-r2.ebuild
deleted file mode 100644
index b120932ad31f..000000000000
--- a/sys-apps/busybox/busybox-1.35.0-r2.ebuild
+++ /dev/null
@@ -1,373 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
-
-EAPI=7
-
-inherit eapi8-dosym flag-o-matic savedconfig toolchain-funcs
-
-DESCRIPTION="Utilities for rescue and embedded systems"
-HOMEPAGE="https://www.busybox.net/"
-if [[ ${PV} == "9999" ]] ; then
- MY_P="${P}"
- EGIT_REPO_URI="https://git.busybox.net/busybox"
- inherit git-r3
-else
- MY_P="${PN}-${PV/_/-}"
- SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
- # unstable release - no keywords
- # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
-fi
-
-LICENSE="GPL-2" # GPL-2 only
-SLOT="0"
-IUSE="debug ipv6 livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
-REQUIRED_USE="pam? ( !static )"
-RESTRICT="test"
-
-# TODO: Could make pkgconfig conditional on selinux? bug #782829
-RDEPEND="
- !static? (
- virtual/libc
- virtual/libcrypt:=
- selinux? ( sys-libs/libselinux )
- )
- pam? ( sys-libs/pam )
-"
-DEPEND="${RDEPEND}
- static? (
- virtual/libcrypt[static-libs]
- selinux? ( sys-libs/libselinux[static-libs(+)] )
- )
- sys-kernel/linux-headers"
-BDEPEND="virtual/pkgconfig"
-
-S="${WORKDIR}/${MY_P}"
-
-busybox_config_option() {
- local flag=$1 ; shift
- if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
- busybox_config_option $(usex ${flag} y n) "$@"
- return
- fi
- local expr
- while [[ $# -gt 0 ]] ; do
- case ${flag} in
- y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
- n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
- *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
- esac
- sed -i -e "${expr}" .config || die
- einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find CONFIG_$1 ...")"
- shift
- done
-}
-
-busybox_config_enabled() {
- local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
- case ${val} in
- "") return 1 ;;
- y) return 0 ;;
- *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
- esac
-}
-
-# patches go here!
-PATCHES=(
- "${FILESDIR}"/${PN}-1.26.2-bb.patch
- "${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
-
- "${FILESDIR}"/${PN}-1.36.0-ed-memcpy-overlapping.patch
- "${FILESDIR}"/${PN}-1.36.0-fortify-source-3-fixdep.patch
-
- # "${FILESDIR}"/${P}-*.patch
-)
-
-src_prepare() {
- default
- unset KBUILD_OUTPUT #88088
- append-flags -fno-strict-aliasing #310413
- use ppc64 && append-flags -mminimal-toc #130943
-
- cp "${FILESDIR}"/ginit.c init/ || die
-
- # flag cleanup
- sed -i -r \
- -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
- Makefile.flags || die
- #sed -i '/bbsh/s:^//::' include/applets.h
- sed -i '/^#error Aborting compilation./d' applets/applets.c || die
- use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
- sed -i \
- -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
- -e "/^AR\>/s:=.*:= $(tc-getAR):" \
- -e "/^CC\>/s:=.*:= $(tc-getCC):" \
- -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
- -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
- Makefile || die
- sed -i \
- -e 's:-static-libgcc::' \
- Makefile.flags || die
-
- # Print all link lines too
- sed -i -e 's:debug=false:debug=true:' scripts/trylink || die
-}
-
-src_configure() {
- # check for a busybox config before making one of our own.
- # if one exist lets return and use it.
-
- restore_config .config
- if [ -f .config ]; then
- yes "" | emake -j1 -s oldconfig >/dev/null
- return 0
- else
- ewarn "Could not locate user configfile, so we will save a default one"
- fi
-
- # setting SKIP_SELINUX skips searching for selinux at this stage. We don't
- # need to search now in case we end up not needing it after all.
- # setup the config file
- emake -j1 -s allyesconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
- # nommu forces a bunch of things off which we want on #387555
- busybox_config_option n NOMMU
- sed -i '/^#/d' .config
- yes "" | emake -j1 -s oldconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
-
- # now turn off stuff we really don't want
- busybox_config_option n DMALLOC
- busybox_config_option n FEATURE_2_4_MODULES #607548
- busybox_config_option n FEATURE_SUID_CONFIG
- busybox_config_option n BUILD_AT_ONCE
- busybox_config_option n BUILD_LIBBUSYBOX
- busybox_config_option n FEATURE_CLEAN_UP
- busybox_config_option n MONOTONIC_SYSCALL
- busybox_config_option n USE_PORTABLE_CODE
- busybox_config_option n WERROR
- # CONFIG_MODPROBE_SMALL=y disables depmod.c and uses a smaller one that
- # does not support -b. Setting this to no creates slightly larger and
- # slightly more useful modutils
- busybox_config_option n MODPROBE_SMALL #472464
- # triming the BSS size may be dangerous
- busybox_config_option n FEATURE_USE_BSS_TAIL
-
- # These cause trouble with musl.
- if use elibc_musl; then
- busybox_config_option n FEATURE_UTMP
- busybox_config_option n EXTRA_COMPAT
- busybox_config_option n FEATURE_VI_REGEX_SEARCH
- fi
-
- # Disable standalone shell mode when using make-symlinks, else Busybox calls its
- # applets by default without looking up in PATH.
- # This also enables users to disable a builtin by deleting the corresponding symlink.
- if use make-symlinks; then
- busybox_config_option n FEATURE_PREFER_APPLETS
- busybox_config_option n FEATURE_SH_STANDALONE
- fi
-
- # If these are not set and we are using a busybox setup
- # all calls to system() will fail.
- busybox_config_option y ASH
- busybox_config_option y SH_IS_ASH
- busybox_config_option n HUSH
- busybox_config_option n SH_IS_HUSH
-
- busybox_config_option '"/run"' PID_FILE_PATH
- busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
-
- # disable ipv6 applets
- if ! use ipv6; then
- busybox_config_option n FEATURE_IPV6
- busybox_config_option n TRACEROUTE6
- busybox_config_option n PING6
- busybox_config_option n UDHCPC6
- fi
-
- busybox_config_option pam PAM
- busybox_config_option static STATIC
- busybox_config_option syslog {K,SYS}LOGD LOGGER
- busybox_config_option systemd FEATURE_SYSTEMD
- busybox_config_option math FEATURE_AWK_LIBM
-
- # all the debug options are compiler related, so punt them
- busybox_config_option n DEBUG_SANITIZE
- busybox_config_option n DEBUG
- busybox_config_option y NO_DEBUG_LIB
- busybox_config_option n DMALLOC
- busybox_config_option n EFENCE
- busybox_config_option $(usex debug y n) TFTP_DEBUG
-
- busybox_config_option selinux SELINUX
-
- # this opt only controls mounting with <linux-2.6.23
- busybox_config_option n FEATURE_MOUNT_NFS
-
- # glibc-2.26 and later does not ship RPC implientation
- busybox_config_option n FEATURE_HAVE_RPC
- busybox_config_option n FEATURE_INETD_RPC
-
- # default a bunch of uncommon options to off
- local opt
- for opt in \
- ADD_SHELL \
- BEEP BOOTCHARTD \
- CRONTAB \
- DC DEVFSD DNSD DPKG{,_DEB} \
- FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
- FEATURE_DEVFS \
- HOSTID HUSH \
- INETD INOTIFYD IPCALC \
- LOCALE_SUPPORT LOGNAME LPD \
- MAKEMIME MKFS_MINIX MSH \
- OD \
- RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
- SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
- TASKSET TCPSVD \
- RPM RPM2CPIO \
- UDPSVD UUDECODE UUENCODE
- do
- busybox_config_option n ${opt}
- done
-
- emake -j1 oldconfig > /dev/null
-}
-
-src_compile() {
- unset KBUILD_OUTPUT #88088
- export SKIP_STRIP=y
-
- emake V=1 busybox
-
- # bug #701512
- emake V=1 doc
-}
-
-src_install() {
- unset KBUILD_OUTPUT #88088
- save_config .config
-
- into /
- dodir /bin
- if use sep-usr ; then
- # install /ginit to take care of mounting stuff
- exeinto /
- newexe busybox_unstripped ginit
- dosym /ginit /bin/bb
- dosym bb /bin/busybox
- else
- newbin busybox_unstripped busybox
- dosym busybox /bin/bb
- fi
- if use mdev ; then
- dodir /$(get_libdir)/mdev/
- use make-symlinks || dosym /bin/bb /sbin/mdev
- cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf || die
- if [[ ! "$(get_libdir)" == "lib" ]]; then
- sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die #831251 - replace lib with lib64 where appropriate
- fi
-
- exeinto /$(get_libdir)/mdev/
- doexe "${FILESDIR}"/mdev/*
-
- newinitd "${FILESDIR}"/mdev.initd mdev
- fi
- if use livecd ; then
- dosym busybox /bin/vi
- fi
-
- # add busybox daemon's, bug #444718
- if busybox_config_enabled FEATURE_NTPD_SERVER; then
- newconfd "${FILESDIR}"/ntpd.confd busybox-ntpd
- newinitd "${FILESDIR}"/ntpd.initd busybox-ntpd
- fi
- if busybox_config_enabled SYSLOGD; then
- newconfd "${FILESDIR}"/syslogd.confd busybox-syslogd
- newinitd "${FILESDIR}"/syslogd.initd busybox-syslogd
- fi
- if busybox_config_enabled KLOGD; then
- newconfd "${FILESDIR}"/klogd.confd busybox-klogd
- newinitd "${FILESDIR}"/klogd.initd busybox-klogd
- fi
- if busybox_config_enabled WATCHDOG; then
- newconfd "${FILESDIR}"/watchdog.confd busybox-watchdog
- newinitd "${FILESDIR}"/watchdog.initd busybox-watchdog
- fi
- if busybox_config_enabled UDHCPC; then
- sed -i 's:$((metric++)):$metric; metric=$((metric + 1)):' examples/udhcp/simple.script || die #801535
- local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
- exeinto "${path%/*}"
- newexe examples/udhcp/simple.script "${path##*/}"
- fi
- if busybox_config_enabled UDHCPD; then
- insinto /etc
- doins examples/udhcp/udhcpd.conf
- fi
- if busybox_config_enabled ASH && ! use make-symlinks; then
- dosym8 -r /bin/busybox /bin/ash
- fi
- if busybox_config_enabled CROND; then
- newconfd "${FILESDIR}"/crond.confd busybox-crond
- newinitd "${FILESDIR}"/crond.initd busybox-crond
- fi
-
- # bundle up the symlink files for use later
- emake DESTDIR="${ED}" install
- rm _install/bin/busybox || die
- # for compatibility, provide /usr/bin/env
- mkdir -p _install/usr/bin || die
- if [[ ! -e _install/usr/bin/env ]]; then
- ln -s /bin/env _install/usr/bin/env || die
- fi
- tar cf busybox-links.tar -C _install . || : #;die
- insinto /usr/share/${PN}
- use make-symlinks && doins busybox-links.tar
-
- dodoc AUTHORS README TODO
-
- cd docs || die
- doman busybox.1
- docinto txt
- dodoc *.txt
- docinto pod
- dodoc *.pod
- docinto html
- dodoc *.html
-
- cd ../examples || die
- docinto examples
- dodoc inittab depmod.pl *.conf *.script undeb unrpm
-
- cd ../networking || die
- dodoc httpd_indexcgi.c httpd_post_upload.cgi
-}
-
-pkg_preinst() {
- if use make-symlinks ; then
- mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
- fi
-}
-
-pkg_postinst() {
- savedconfig_pkg_postinst
-
- if use make-symlinks ; then
- cd "${T}" || die
- mkdir _install
- tar xf busybox-links.tar -C _install || die
- # 907432: cp -n returns error if it skips any file, but that is expected here
- # TODO: check if a new coreutils release has a replacement option
- cp -nvpPR _install/* "${ROOT}"/
- fi
-
- if use sep-usr ; then
- elog "In order to use the sep-usr support, you have to update your"
- elog "kernel command line. Add the option:"
- elog " init=/ginit"
- elog "To launch a different init than /sbin/init, use:"
- elog " init=/ginit /sbin/yourinit"
- elog "To get a rescue shell, you may boot with:"
- elog " init=/ginit bb"
- fi
-}
diff --git a/sys-apps/busybox/files/busybox-1.36.0-ed-memcpy-overlapping.patch b/sys-apps/busybox/files/busybox-1.36.0-ed-memcpy-overlapping.patch
deleted file mode 100644
index e474391ccd4d..000000000000
--- a/sys-apps/busybox/files/busybox-1.36.0-ed-memcpy-overlapping.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-https://git.busybox.net/busybox/commit/?id=ca96022d6edaaf619324db5a481698231d74d1df
-
-From ca96022d6edaaf619324db5a481698231d74d1df Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
-Date: Tue, 8 Feb 2022 20:29:30 +0100
-Subject: ed: don't use memcpy with overlapping memory regions
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The memcpy invocations in the subCommand function, modified by this
-commit, previously used memcpy with overlapping memory regions. This is
-undefined behavior. On Alpine Linux, it causes BusyBox ed to crash since
-we compile BusyBox with -D_FORTIFY_SOURCE=2 and our fortify-headers
-implementation catches this source of undefined behavior [0]. The issue
-can only be triggered if the replacement string is the same size or
-shorter than the old string.
-
-Looking at the code, it seems to me that a memmove(3) is what was
-actually intended here, this commit modifies the code accordingly.
-
-[0]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13504
-
-Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---- a/editors/ed.c
-+++ b/editors/ed.c
-@@ -720,7 +720,7 @@ static void subCommand(const char *cmd, int num1, int num2)
- if (deltaLen <= 0) {
- memcpy(&lp->data[offset], newStr, newLen);
- if (deltaLen) {
-- memcpy(&lp->data[offset + newLen],
-+ memmove(&lp->data[offset + newLen],
- &lp->data[offset + oldLen],
- lp->len - offset - oldLen);
-
---
-cgit v1.2.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2024-03-29 15:48 Viorel Munteanu
0 siblings, 0 replies; 10+ messages in thread
From: Viorel Munteanu @ 2024-03-29 15:48 UTC (permalink / raw
To: gentoo-commits
commit: d8ad860a1ed9aa92adaa7dcf1c3fc78d0e2f80ce
Author: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 29 15:45:20 2024 +0000
Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 15:47:49 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8ad860a
sys-apps/busybox: fix building with kernel headers 6.8
Apply a patch from the mailing list.
Closes: https://bugs.gentoo.org/926872
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
sys-apps/busybox/busybox-1.36.1-r2.ebuild | 377 +++++++++++++++++++++
.../busybox/files/busybox-1.36.1-kernel-6.8.patch | 53 +++
2 files changed, 430 insertions(+)
diff --git a/sys-apps/busybox/busybox-1.36.1-r2.ebuild b/sys-apps/busybox/busybox-1.36.1-r2.ebuild
new file mode 100644
index 000000000000..74082ac77ae5
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.36.1-r2.ebuild
@@ -0,0 +1,377 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI=8
+
+inherit flag-o-matic readme.gentoo-r1 savedconfig toolchain-funcs
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="https://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P="${P}"
+ EGIT_REPO_URI="https://git.busybox.net/busybox"
+ inherit git-r3
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2" # GPL-2 only
+SLOT="0"
+IUSE="debug livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
+REQUIRED_USE="pam? ( !static )"
+RESTRICT="test"
+
+# TODO: Could make pkgconfig conditional on selinux? bug #782829
+RDEPEND="
+ !static? (
+ virtual/libc
+ virtual/libcrypt:=
+ selinux? ( sys-libs/libselinux )
+ )
+ pam? ( sys-libs/pam )
+"
+DEPEND="${RDEPEND}
+ static? (
+ virtual/libcrypt[static-libs]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ )
+ sys-kernel/linux-headers"
+BDEPEND="virtual/pkgconfig"
+
+DISABLE_AUTOFORMATTING=yes
+DOC_CONTENTS='
+If you want a smaller executable, add `-Oz` to your busybox `CFLAGS`.'
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ local expr
+ while [[ $# -gt 0 ]] ; do
+ case ${flag} in
+ y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
+ n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
+ *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
+ esac
+ sed -i -e "${expr}" .config || die
+ einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find CONFIG_$1 ...")"
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+# patches go here!
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.26.2-bb.patch
+ "${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
+
+ "${FILESDIR}"/${PN}-1.36.0-fortify-source-3-fixdep.patch
+ "${FILESDIR}"/${PN}-1.36.1-kernel-6.8.patch
+
+ # "${FILESDIR}"/${P}-*.patch
+)
+
+src_prepare() {
+ default
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|Oz|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+
+ # Print all link lines too
+ sed -i -e 's:debug=false:debug=true:' scripts/trylink || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setting SKIP_SELINUX skips searching for selinux at this stage. We don't
+ # need to search now in case we end up not needing it after all.
+ # setup the config file
+ emake -j1 -s allyesconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_2_4_MODULES #607548
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+ # CONFIG_MODPROBE_SMALL=y disables depmod.c and uses a smaller one that
+ # does not support -b. Setting this to no creates slightly larger and
+ # slightly more useful modutils
+ busybox_config_option n MODPROBE_SMALL #472464
+ # triming the BSS size may be dangerous
+ busybox_config_option n FEATURE_USE_BSS_TAIL
+
+ # These cause trouble with musl.
+ if use elibc_musl; then
+ busybox_config_option n FEATURE_UTMP
+ busybox_config_option n EXTRA_COMPAT
+ busybox_config_option n FEATURE_VI_REGEX_SEARCH
+ fi
+
+ # Disable standalone shell mode when using make-symlinks, else Busybox calls its
+ # applets by default without looking up in PATH.
+ # This also enables users to disable a builtin by deleting the corresponding symlink.
+ if use make-symlinks; then
+ busybox_config_option n FEATURE_PREFER_APPLETS
+ busybox_config_option n FEATURE_SH_STANDALONE
+ fi
+
+ # If these are not set and we are using a busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option y SH_IS_ASH
+ busybox_config_option n HUSH
+ busybox_config_option n SH_IS_HUSH
+
+ busybox_config_option '"/run"' PID_FILE_PATH
+ busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
+
+ busybox_config_option pam PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG_SANITIZE
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # glibc-2.26 and later does not ship RPC implientation
+ busybox_config_option n FEATURE_HAVE_RPC
+ busybox_config_option n FEATURE_INETD_RPC
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+
+ # bug #701512
+ emake V=1 doc
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf || die
+ if [[ ! "$(get_libdir)" == "lib" ]]; then
+ #831251 - replace lib with lib64 where appropriate
+ sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die
+ fi
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.initd mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}"/ntpd.confd busybox-ntpd
+ newinitd "${FILESDIR}"/ntpd.initd busybox-ntpd
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}"/syslogd.confd busybox-syslogd
+ newinitd "${FILESDIR}"/syslogd.initd busybox-syslogd
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}"/klogd.confd busybox-klogd
+ newinitd "${FILESDIR}"/klogd.initd busybox-klogd
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}"/watchdog.confd busybox-watchdog
+ newinitd "${FILESDIR}"/watchdog.initd busybox-watchdog
+ fi
+ if busybox_config_enabled UDHCPC; then
+ sed -i 's:$((metric++)):$metric; metric=$((metric + 1)):' examples/udhcp/simple.script || die #801535
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+ if busybox_config_enabled ASH && ! use make-symlinks; then
+ dosym -r /bin/busybox /bin/ash
+ fi
+ if busybox_config_enabled CROND; then
+ newconfd "${FILESDIR}"/crond.confd busybox-crond
+ newinitd "${FILESDIR}"/crond.initd busybox-crond
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin || die
+ if [[ ! -e _install/usr/bin/env ]]; then
+ ln -s /bin/env _install/usr/bin/env || die
+ fi
+ rm _install/bin/busybox || die
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs || die
+ doman busybox.1
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ docinto html
+ dodoc *.html
+
+ cd ../examples || die
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+
+ cd ../networking || die
+ dodoc httpd_indexcgi.c httpd_post_upload.cgi
+
+ readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ # 907432: cp -n returns error if it skips any file, but that is expected here
+ # TODO: check if a new coreutils release has a replacement option
+ cp -nvpPR _install/* "${ROOT}"/
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+
+ if [[ ${MERGE_TYPE} != binary ]] && ! is-flagq -Oz; then
+ for v in ${REPLACING_VERSIONS}; do
+ if ver_test ${v} -le 1.36.1; then
+ FORCE_PRINT_ELOG=yes
+ fi
+ done
+
+ readme.gentoo_print_elog
+ fi
+}
diff --git a/sys-apps/busybox/files/busybox-1.36.1-kernel-6.8.patch b/sys-apps/busybox/files/busybox-1.36.1-kernel-6.8.patch
new file mode 100644
index 000000000000..4f74d51bdcaf
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.36.1-kernel-6.8.patch
@@ -0,0 +1,53 @@
+http://lists.busybox.net/pipermail/busybox/2024-March/090678.html
+https://bugs.gentoo.org/926872
+
+Linux v6.8-rc1 removed the definitions related to CBQ making tc fail to
+build. Add some #ifdefs to handle this missing support.
+--- a/networking/tc.c
++++ b/networking/tc.c
+@@ -231,6 +231,13 @@ static int cbq_parse_opt(int argc, char **argv, struct nlmsghdr *n)
+ return 0;
+ }
+ #endif
++
++#ifndef TCA_CBQ_MAX
++/*
++ * Linux v6.8-rc1~131^2~60^2^2 removed the uapi definitions for CBQ.
++ * See <A HREF="https://git.kernel.org/linus/33241dca48626">https://git.kernel.org/linus/33241dca48626</A>
++ */
++#else
+ static int cbq_print_opt(struct rtattr *opt)
+ {
+ struct rtattr *tb[TCA_CBQ_MAX+1];
+@@ -322,6 +329,7 @@ static int cbq_print_opt(struct rtattr *opt)
+ done:
+ return 0;
+ }
++#endif
+
+ static FAST_FUNC int print_qdisc(
+ const struct sockaddr_nl *who UNUSED_PARAM,
+@@ -372,8 +380,10 @@ static FAST_FUNC int print_qdisc(
+ int qqq = index_in_strings(_q_, name);
+ if (qqq == 0) { /* pfifo_fast aka prio */
+ prio_print_opt(tb[TCA_OPTIONS]);
++#ifdef TCA_CBQ_MAX
+ } else if (qqq == 1) { /* class based queuing */
+ cbq_print_opt(tb[TCA_OPTIONS]);
++#endif
+ } else {
+ /* don't know how to print options for this qdisc */
+ printf("(options for %s)", name);
+@@ -442,9 +452,11 @@ static FAST_FUNC int print_class(
+ int qqq = index_in_strings(_q_, name);
+ if (qqq == 0) { /* pfifo_fast aka prio */
+ /* nothing. */ /*prio_print_opt(tb[TCA_OPTIONS]);*/
++#ifdef TCA_CBQ_MAX
+ } else if (qqq == 1) { /* class based queuing */
+ /* cbq_print_copt() is identical to cbq_print_opt(). */
+ cbq_print_opt(tb[TCA_OPTIONS]);
++#endif
+ } else {
+ /* don't know how to print options for this class */
+ printf("(options for %s)", name);
+
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
@ 2024-07-05 5:43 Viorel Munteanu
0 siblings, 0 replies; 10+ messages in thread
From: Viorel Munteanu @ 2024-07-05 5:43 UTC (permalink / raw
To: gentoo-commits
commit: a760727c2c9e90293c566060a90f5aedce48bdda
Author: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 5 05:34:18 2024 +0000
Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Fri Jul 5 05:42:48 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a760727c
sys-apps/busybox: skip some dynamic relocations on 32-bit i386
Disable using HW sha1 and sha256 on 32 bit i386.
This caused musl build to fail.
The code only worked on SSSE CPUs.
Closes: https://bugs.gentoo.org/933771
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
...x-1.36.1-r2.ebuild => busybox-1.36.1-r3.ebuild} | 2 +
.../busybox-1.36.1-skip-dynamic-relocations.patch | 43 ++++++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git a/sys-apps/busybox/busybox-1.36.1-r2.ebuild b/sys-apps/busybox/busybox-1.36.1-r3.ebuild
similarity index 99%
rename from sys-apps/busybox/busybox-1.36.1-r2.ebuild
rename to sys-apps/busybox/busybox-1.36.1-r3.ebuild
index cd06d97bc0d3..a0e6e95cf3f2 100644
--- a/sys-apps/busybox/busybox-1.36.1-r2.ebuild
+++ b/sys-apps/busybox/busybox-1.36.1-r3.ebuild
@@ -83,6 +83,8 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.36.0-fortify-source-3-fixdep.patch
"${FILESDIR}"/${PN}-1.36.1-kernel-6.8.patch
+ "${FILESDIR}"/${PN}-1.36.1-skip-dynamic-relocations.patch
+
# "${FILESDIR}"/${P}-*.patch
)
diff --git a/sys-apps/busybox/files/busybox-1.36.1-skip-dynamic-relocations.patch b/sys-apps/busybox/files/busybox-1.36.1-skip-dynamic-relocations.patch
new file mode 100644
index 000000000000..4da0d4666ef3
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.36.1-skip-dynamic-relocations.patch
@@ -0,0 +1,43 @@
+https://git.alpinelinux.org/aports/plain/main/busybox/0025-Hackfix-to-disable-HW-acceleration-for-MD5-SHA1-on-x.patch
+https://bugs.gentoo.org/933771
+
+From 3ead51e53687e94a51beb793661363df27b00814 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Thu, 5 Jan 2023 15:47:55 +0100
+Subject: [PATCH] Hackfix to disable HW acceleration for MD5/SHA1 on x86
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This causes a direct segfault with musl libc.
+
+See: http://lists.busybox.net/pipermail/busybox/2023-January/090078.html
+--- a/libbb/hash_md5_sha.c
++++ b/libbb/hash_md5_sha.c
+@@ -14,7 +14,7 @@
+ #define NEED_SHA512 (ENABLE_SHA512SUM || ENABLE_USE_BB_CRYPT_SHA)
+
+ #if ENABLE_SHA1_HWACCEL || ENABLE_SHA256_HWACCEL
+-# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
++# if defined(__GNUC__) && defined(__x86_64__)
+ static void cpuid(unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx)
+ {
+ asm ("cpuid"
+@@ -1173,7 +1173,7 @@ void FAST_FUNC sha1_begin(sha1_ctx_t *ctx)
+ ctx->total64 = 0;
+ ctx->process_block = sha1_process_block64;
+ #if ENABLE_SHA1_HWACCEL
+-# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
++# if defined(__GNUC__) && defined(__x86_64__)
+ {
+ if (!shaNI) {
+ unsigned eax = 7, ebx = ebx, ecx = 0, edx = edx;
+@@ -1227,7 +1227,7 @@ void FAST_FUNC sha256_begin(sha256_ctx_t *ctx)
+ /*ctx->total64 = 0; - done by prepending two 32-bit zeros to init256 */
+ ctx->process_block = sha256_process_block64;
+ #if ENABLE_SHA256_HWACCEL
+-# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
++# if defined(__GNUC__) && defined(__x86_64__)
+ {
+ if (!shaNI) {
+ unsigned eax = 7, ebx = ebx, ecx = 0, edx = edx;
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-07-05 5:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 13:07 [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/ Viorel Munteanu
-- strict thread matches above, loose matches on Subject: below --
2024-07-05 5:43 Viorel Munteanu
2024-03-29 15:48 Viorel Munteanu
2023-04-12 7:35 Sam James
2022-07-03 23:54 Sam James
2022-06-30 21:41 Sam James
2022-06-30 21:41 Sam James
2020-02-06 23:06 Patrick McLean
2017-01-28 22:14 Anthony G. Basile
2015-11-13 5:23 Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox