Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/, sys-apps/busybox/files/
Date: Sun, 03 Jul 2022 23:54:27
Message-Id: 1656892363.f51fe5149921cfd97d4eb15ba9560fd3d9a24226.sam@gentoo
1 commit: f51fe5149921cfd97d4eb15ba9560fd3d9a24226
2 Author: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com>
3 AuthorDate: Fri Jul 1 11:03:50 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 3 23:52:43 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f51fe514
7
8 sys-apps/busybox: sync fixes to newer versions
9
10 Sync fixes from 1.34.0-r1 to 1.35.0-r1 and to 9999
11 Fix new QA issue in live version
12
13 Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com>
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 ...usybox-9999.ebuild => busybox-1.35.0-r1.ebuild} | 36 +++++++++--
17 sys-apps/busybox/busybox-9999.ebuild | 34 ++++++++--
18 .../files/busybox-1.36.0-fix-wx-sections.patch | 74 ++++++++++++++++++++++
19 3 files changed, 133 insertions(+), 11 deletions(-)
20
21 diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-1.35.0-r1.ebuild
22 similarity index 85%
23 copy from sys-apps/busybox/busybox-9999.ebuild
24 copy to sys-apps/busybox/busybox-1.35.0-r1.ebuild
25 index 490896632feb..76d06dcb9b29 100644
26 --- a/sys-apps/busybox/busybox-9999.ebuild
27 +++ b/sys-apps/busybox/busybox-1.35.0-r1.ebuild
28 @@ -5,7 +5,7 @@
29
30 EAPI=7
31
32 -inherit flag-o-matic savedconfig toolchain-funcs
33 +inherit eapi8-dosym flag-o-matic savedconfig toolchain-funcs
34
35 DESCRIPTION="Utilities for rescue and embedded systems"
36 HOMEPAGE="https://www.busybox.net/"
37 @@ -16,7 +16,8 @@ if [[ ${PV} == "9999" ]] ; then
38 else
39 MY_P="${PN}-${PV/_/-}"
40 SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
41 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
42 + # unstable release - no keywords
43 + # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
44 fi
45
46 LICENSE="GPL-2" # GPL-2 only
47 @@ -72,6 +73,7 @@ busybox_config_enabled() {
48 # patches go here!
49 PATCHES=(
50 "${FILESDIR}"/${PN}-1.26.2-bb.patch
51 + "${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
52 # "${FILESDIR}"/${P}-*.patch
53 )
54
55 @@ -114,12 +116,14 @@ src_configure() {
56 ewarn "Could not locate user configfile, so we will save a default one"
57 fi
58
59 + # setting SKIP_SELINUX skips searching for selinux at this stage. We don't
60 + # need to search now in case we end up not needing it after all.
61 # setup the config file
62 - emake -j1 -s allyesconfig >/dev/null
63 + emake -j1 -s allyesconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
64 # nommu forces a bunch of things off which we want on #387555
65 busybox_config_option n NOMMU
66 sed -i '/^#/d' .config
67 - yes "" | emake -j1 -s oldconfig >/dev/null
68 + yes "" | emake -j1 -s oldconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
69
70 # now turn off stuff we really don't want
71 busybox_config_option n DMALLOC
72 @@ -131,6 +135,10 @@ src_configure() {
73 busybox_config_option n MONOTONIC_SYSCALL
74 busybox_config_option n USE_PORTABLE_CODE
75 busybox_config_option n WERROR
76 + # CONFIG_MODPROBE_SMALL=y disables depmod.c and uses a smaller one that
77 + # does not support -b. Setting this to no creates slightly larger and
78 + # slightly more useful modutils
79 + busybox_config_option n MODPROBE_SMALL #472464
80 # triming the BSS size may be dangerous
81 busybox_config_option n FEATURE_USE_BSS_TAIL
82
83 @@ -245,7 +253,10 @@ src_install() {
84 if use mdev ; then
85 dodir /$(get_libdir)/mdev/
86 use make-symlinks || dosym /bin/bb /sbin/mdev
87 - cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
88 + cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf || die
89 + if [[ ! "$(get_libdir)" == "lib" ]]; then
90 + sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die #831251 - replace lib with lib64 where appropriate
91 + fi
92
93 exeinto /$(get_libdir)/mdev/
94 doexe "${FILESDIR}"/mdev/*
95 @@ -274,6 +285,7 @@ src_install() {
96 newinitd "${FILESDIR}"/watchdog.initd busybox-watchdog
97 fi
98 if busybox_config_enabled UDHCPC; then
99 + sed -i 's:$((metric++)):$metric; metric=$((metric + 1)):' examples/udhcp/simple.script || die #801535
100 local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
101 exeinto "${path%/*}"
102 newexe examples/udhcp/simple.script "${path##*/}"
103 @@ -282,13 +294,22 @@ src_install() {
104 insinto /etc
105 doins examples/udhcp/udhcpd.conf
106 fi
107 + if busybox_config_enabled ASH && ! use make-symlinks; then
108 + dosym8 -r /bin/busybox /bin/ash
109 + fi
110 + if busybox_config_enabled CROND; then
111 + newconfd "${FILESDIR}"/crond.confd busybox-crond
112 + newinitd "${FILESDIR}"/crond.initd busybox-crond
113 + fi
114
115 # bundle up the symlink files for use later
116 emake DESTDIR="${ED}" install
117 rm _install/bin/busybox || die
118 # for compatibility, provide /usr/bin/env
119 mkdir -p _install/usr/bin || die
120 - ln -s /bin/env _install/usr/bin/env || die
121 + if [[ ! -e _install/usr/bin/env ]]; then
122 + ln -s /bin/env _install/usr/bin/env || die
123 + fi
124 tar cf busybox-links.tar -C _install . || : #;die
125 insinto /usr/share/${PN}
126 use make-symlinks && doins busybox-links.tar
127 @@ -307,6 +328,9 @@ src_install() {
128 cd ../examples || die
129 docinto examples
130 dodoc inittab depmod.pl *.conf *.script undeb unrpm
131 +
132 + cd ../networking || die
133 + dodoc httpd_indexcgi.c httpd_post_upload.cgi
134 }
135
136 pkg_preinst() {
137
138 diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-9999.ebuild
139 index 490896632feb..5e059850212f 100644
140 --- a/sys-apps/busybox/busybox-9999.ebuild
141 +++ b/sys-apps/busybox/busybox-9999.ebuild
142 @@ -5,7 +5,7 @@
143
144 EAPI=7
145
146 -inherit flag-o-matic savedconfig toolchain-funcs
147 +inherit eapi8-dosym flag-o-matic savedconfig toolchain-funcs
148
149 DESCRIPTION="Utilities for rescue and embedded systems"
150 HOMEPAGE="https://www.busybox.net/"
151 @@ -72,6 +72,8 @@ busybox_config_enabled() {
152 # patches go here!
153 PATCHES=(
154 "${FILESDIR}"/${PN}-1.26.2-bb.patch
155 + "${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
156 + "${FILESDIR}"/${PN}-1.36.0-fix-wx-sections.patch
157 # "${FILESDIR}"/${P}-*.patch
158 )
159
160 @@ -114,12 +116,14 @@ src_configure() {
161 ewarn "Could not locate user configfile, so we will save a default one"
162 fi
163
164 + # setting SKIP_SELINUX skips searching for selinux at this stage. We don't
165 + # need to search now in case we end up not needing it after all.
166 # setup the config file
167 - emake -j1 -s allyesconfig >/dev/null
168 + emake -j1 -s allyesconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
169 # nommu forces a bunch of things off which we want on #387555
170 busybox_config_option n NOMMU
171 sed -i '/^#/d' .config
172 - yes "" | emake -j1 -s oldconfig >/dev/null
173 + yes "" | emake -j1 -s oldconfig SKIP_SELINUX=$(usex selinux n y) >/dev/null #620918
174
175 # now turn off stuff we really don't want
176 busybox_config_option n DMALLOC
177 @@ -131,6 +135,10 @@ src_configure() {
178 busybox_config_option n MONOTONIC_SYSCALL
179 busybox_config_option n USE_PORTABLE_CODE
180 busybox_config_option n WERROR
181 + # CONFIG_MODPROBE_SMALL=y disables depmod.c and uses a smaller one that
182 + # does not support -b. Setting this to no creates slightly larger and
183 + # slightly more useful modutils
184 + busybox_config_option n MODPROBE_SMALL #472464
185 # triming the BSS size may be dangerous
186 busybox_config_option n FEATURE_USE_BSS_TAIL
187
188 @@ -245,7 +253,10 @@ src_install() {
189 if use mdev ; then
190 dodir /$(get_libdir)/mdev/
191 use make-symlinks || dosym /bin/bb /sbin/mdev
192 - cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
193 + cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf || die
194 + if [[ ! "$(get_libdir)" == "lib" ]]; then
195 + sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die #831251 - replace lib with lib64 where appropriate
196 + fi
197
198 exeinto /$(get_libdir)/mdev/
199 doexe "${FILESDIR}"/mdev/*
200 @@ -274,6 +285,7 @@ src_install() {
201 newinitd "${FILESDIR}"/watchdog.initd busybox-watchdog
202 fi
203 if busybox_config_enabled UDHCPC; then
204 + sed -i 's:$((metric++)):$metric; metric=$((metric + 1)):' examples/udhcp/simple.script || die #801535
205 local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
206 exeinto "${path%/*}"
207 newexe examples/udhcp/simple.script "${path##*/}"
208 @@ -282,13 +294,22 @@ src_install() {
209 insinto /etc
210 doins examples/udhcp/udhcpd.conf
211 fi
212 + if busybox_config_enabled ASH && ! use make-symlinks; then
213 + dosym8 -r /bin/busybox /bin/ash
214 + fi
215 + if busybox_config_enabled CROND; then
216 + newconfd "${FILESDIR}"/crond.confd busybox-crond
217 + newinitd "${FILESDIR}"/crond.initd busybox-crond
218 + fi
219
220 # bundle up the symlink files for use later
221 emake DESTDIR="${ED}" install
222 rm _install/bin/busybox || die
223 # for compatibility, provide /usr/bin/env
224 mkdir -p _install/usr/bin || die
225 - ln -s /bin/env _install/usr/bin/env || die
226 + if [[ ! -e _install/usr/bin/env ]]; then
227 + ln -s /bin/env _install/usr/bin/env || die
228 + fi
229 tar cf busybox-links.tar -C _install . || : #;die
230 insinto /usr/share/${PN}
231 use make-symlinks && doins busybox-links.tar
232 @@ -307,6 +328,9 @@ src_install() {
233 cd ../examples || die
234 docinto examples
235 dodoc inittab depmod.pl *.conf *.script undeb unrpm
236 +
237 + cd ../networking || die
238 + dodoc httpd_indexcgi.c httpd_post_upload.cgi
239 }
240
241 pkg_preinst() {
242
243 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
244 new file mode 100644
245 index 000000000000..16118cf9b95f
246 --- /dev/null
247 +++ b/sys-apps/busybox/files/busybox-1.36.0-fix-wx-sections.patch
248 @@ -0,0 +1,74 @@
249 + * QA Notice: The following files contain writable and executable sections
250 + * Files with such sections will not work properly (or at all!) on some
251 + * architectures/operating systems. A bug should be filed at
252 + * https://bugs.gentoo.org/ to make sure the issue is fixed.
253 + * For more information, see:
254 + *
255 + * https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
256 + *
257 + * Please include the following list of files in your report:
258 + * Note: Bugs should be filed for the respective maintainers
259 + * of the package in question and not hardened@g.o.
260 + * RWX --- --- bin/busybox
261 +
262 +$ scanelf -qeR .
263 +RWX --- --- ./busybox
264 +RWX --- --- ./busybox_unstripped
265 +!WX --- --- ./libbb/hash_md5_sha_x86-64_shaNI.o
266 +!WX --- --- ./libbb/hash_md5_sha_x86-64.o
267 +!WX --- --- ./libbb/hash_md5_sha_x86-32_shaNI.o
268 +!WX --- --- ./libbb/hash_md5_sha256_x86-64_shaNI.o
269 +!WX --- --- ./libbb/hash_md5_sha256_x86-32_shaNI.o
270 +
271 +Try to fix this QA issue
272 +
273 +--- a/libbb/hash_md5_sha256_x86-32_shaNI.S
274 ++++ b/libbb/hash_md5_sha256_x86-32_shaNI.S
275 +@@ -278,4 +278,7 @@
276 + PSHUFFLE_BSWAP32_FLIP_MASK:
277 + .octa 0x0c0d0e0f08090a0b0405060700010203
278 +
279 ++#if defined(__linux__) && defined(__ELF__)
280 ++ .section .note.GNU-stack, "", %progbits
281 ++#endif
282 + #endif
283 +--- a/libbb/hash_md5_sha256_x86-64_shaNI.S
284 ++++ b/libbb/hash_md5_sha256_x86-64_shaNI.S
285 +@@ -284,4 +284,7 @@
286 + PSHUFFLE_BSWAP32_FLIP_MASK:
287 + .octa 0x0c0d0e0f08090a0b0405060700010203
288 +
289 ++#if defined(__linux__) && defined(__ELF__)
290 ++ .section .note.GNU-stack, "", %progbits
291 ++#endif
292 + #endif
293 +--- a/libbb/hash_md5_sha_x86-32_shaNI.S
294 ++++ b/libbb/hash_md5_sha_x86-32_shaNI.S
295 +@@ -228,4 +228,7 @@
296 + PSHUFFLE_BYTE_FLIP_MASK:
297 + .octa 0x000102030405060708090a0b0c0d0e0f
298 +
299 ++#if defined(__linux__) && defined(__ELF__)
300 ++ .section .note.GNU-stack, "", %progbits
301 ++#endif
302 + #endif
303 +--- a/libbb/hash_md5_sha_x86-64.S
304 ++++ b/libbb/hash_md5_sha_x86-64.S
305 +@@ -1483,4 +1483,7 @@
306 + .long 0x8F1BBCDC
307 + .long 0xCA62C1D6
308 +
309 ++#if defined(__linux__) && defined(__ELF__)
310 ++ .section .note.GNU-stack, "", %progbits
311 ++#endif
312 + #endif
313 +--- a/libbb/hash_md5_sha_x86-64_shaNI.S
314 ++++ b/libbb/hash_md5_sha_x86-64_shaNI.S
315 +@@ -226,4 +226,7 @@
316 + PSHUFFLE_BYTE_FLIP_MASK:
317 + .octa 0x000102030405060708090a0b0c0d0e0f
318 +
319 ++#if defined(__linux__) && defined(__ELF__)
320 ++ .section .note.GNU-stack, "", %progbits
321 ++#endif
322 + #endif