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/
Date: Thu, 16 Sep 2021 01:18:48
Message-Id: 1631755052.a2a5a50a29c6b6474c11b6ee1607d20c54ba5595.sam@gentoo
1 commit: a2a5a50a29c6b6474c11b6ee1607d20c54ba5595
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 16 01:00:18 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 16 01:17:32 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2a5a50a
7
8 sys-apps/busybox: add 1.34.0
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-apps/busybox/Manifest | 1 +
13 sys-apps/busybox/busybox-1.34.0.ebuild | 352 +++++++++++++++++++++++++++++++++
14 2 files changed, 353 insertions(+)
15
16 diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
17 index a8d2e045151..ce18d576c22 100644
18 --- a/sys-apps/busybox/Manifest
19 +++ b/sys-apps/busybox/Manifest
20 @@ -1,2 +1,3 @@
21 DIST busybox-1.32.1.tar.bz2 2444679 BLAKE2B b0258345d40628d8c12b4cc5c3efdb318cfb469e029242942cdad22aeec5142963291a746fbac450b43a4a1f2f7e9204442456691fa98f18eeaa58c70d714caf SHA512 3a33e99adaf7cbd51dcbeb31b5361123bf61ac040c0a032656c654ddb69c4074af75fb4335ba63f283067f61a22d7d7cbca8e1ed265c9522982c453ce48ea2fd
22 DIST busybox-1.33.1.tar.bz2 2453694 BLAKE2B 2dce3427ab7703c56cbb3bdc0c93c1fe1c6dc24c5b467b6213b8f9cf55223ec63136b3837970e41293cc3d55d320599945d29a69a4ef8b4b3ab9fb5e2a527632 SHA512 d24931432f65e4e79cf54a6c2b91c9cafba817b637d337f456ce8f505434fc06c4345c65cde4fe2a019650a8a089a6f5336bfafb5ef64a4f14659a9d0b3ddb1a
23 +DIST busybox-1.34.0.tar.bz2 2476120 BLAKE2B ea8b06c08ce0abf0fc2742a3231417d169aa0ad7024bb3672816c8ab410d8df11836f68e5e1ac0c7358e2c50a796a114ee4a67bacb1022b2c48daafa98cfc8e5 SHA512 c57231e6d5dea8f2f5429673e9ea392a0f4b752731ec1f4903da8ca786914cda3065d80deeb28fb27d77848c892d587adf3b3150218d27cd87c5ece43de1b35a
24
25 diff --git a/sys-apps/busybox/busybox-1.34.0.ebuild b/sys-apps/busybox/busybox-1.34.0.ebuild
26 new file mode 100644
27 index 00000000000..7b556bbba97
28 --- /dev/null
29 +++ b/sys-apps/busybox/busybox-1.34.0.ebuild
30 @@ -0,0 +1,352 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
35 +
36 +EAPI=7
37 +
38 +inherit flag-o-matic savedconfig toolchain-funcs
39 +
40 +DESCRIPTION="Utilities for rescue and embedded systems"
41 +HOMEPAGE="https://www.busybox.net/"
42 +if [[ ${PV} == "9999" ]] ; then
43 + MY_P=${P}
44 + EGIT_REPO_URI="https://git.busybox.net/busybox"
45 + inherit git-r3
46 +else
47 + MY_P=${PN}-${PV/_/-}
48 + SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
49 + # Unkeyworded for now for testing as 'unstable' upstream
50 + #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
51 +fi
52 +
53 +LICENSE="GPL-2" # GPL-2 only
54 +SLOT="0"
55 +IUSE="debug ipv6 livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
56 +REQUIRED_USE="pam? ( !static )"
57 +RESTRICT="test"
58 +
59 +# TODO: Could make pkgconfig conditional on selinux? bug #782829
60 +COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
61 + pam? ( sys-libs/pam )
62 + virtual/libcrypt:="
63 +DEPEND="${COMMON_DEPEND}
64 + static? (
65 + virtual/libcrypt[static-libs]
66 + selinux? ( sys-libs/libselinux[static-libs(+)] )
67 + )
68 + >=sys-kernel/linux-headers-2.6.39"
69 +BDEPEND="virtual/pkgconfig"
70 +RDEPEND="${COMMON_DEPEND}
71 + mdev? ( !<sys-apps/openrc-0.13 )"
72 +
73 +S="${WORKDIR}/${MY_P}"
74 +
75 +busybox_config_option() {
76 + local flag=$1 ; shift
77 + if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
78 + busybox_config_option $(usex ${flag} y n) "$@"
79 + return
80 + fi
81 + local expr
82 + while [[ $# -gt 0 ]] ; do
83 + case ${flag} in
84 + y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
85 + n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
86 + *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
87 + esac
88 + sed -i -e "${expr}" .config || die
89 + einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find CONFIG_$1 ...")"
90 + shift
91 + done
92 +}
93 +
94 +busybox_config_enabled() {
95 + local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
96 + case ${val} in
97 + "") return 1 ;;
98 + y) return 0 ;;
99 + *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
100 + esac
101 +}
102 +
103 +# patches go here!
104 +PATCHES=(
105 + "${FILESDIR}"/${PN}-1.26.2-bb.patch
106 + # "${FILESDIR}"/${P}-*.patch
107 +)
108 +
109 +src_prepare() {
110 + default
111 + unset KBUILD_OUTPUT #88088
112 + append-flags -fno-strict-aliasing #310413
113 + use ppc64 && append-flags -mminimal-toc #130943
114 +
115 + cp "${FILESDIR}"/ginit.c init/ || die
116 +
117 + # flag cleanup
118 + sed -i -r \
119 + -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
120 + Makefile.flags || die
121 + #sed -i '/bbsh/s:^//::' include/applets.h
122 + sed -i '/^#error Aborting compilation./d' applets/applets.c || die
123 + use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
124 + sed -i \
125 + -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
126 + -e "/^AR\>/s:=.*:= $(tc-getAR):" \
127 + -e "/^CC\>/s:=.*:= $(tc-getCC):" \
128 + -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
129 + -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
130 + Makefile || die
131 + sed -i \
132 + -e 's:-static-libgcc::' \
133 + Makefile.flags || die
134 +}
135 +
136 +src_configure() {
137 + # check for a busybox config before making one of our own.
138 + # if one exist lets return and use it.
139 +
140 + restore_config .config
141 + if [ -f .config ]; then
142 + yes "" | emake -j1 -s oldconfig >/dev/null
143 + return 0
144 + else
145 + ewarn "Could not locate user configfile, so we will save a default one"
146 + fi
147 +
148 + # setup the config file
149 + emake -j1 -s allyesconfig >/dev/null
150 + # nommu forces a bunch of things off which we want on #387555
151 + busybox_config_option n NOMMU
152 + sed -i '/^#/d' .config
153 + yes "" | emake -j1 -s oldconfig >/dev/null
154 +
155 + # now turn off stuff we really don't want
156 + busybox_config_option n DMALLOC
157 + busybox_config_option n FEATURE_2_4_MODULES #607548
158 + busybox_config_option n FEATURE_SUID_CONFIG
159 + busybox_config_option n BUILD_AT_ONCE
160 + busybox_config_option n BUILD_LIBBUSYBOX
161 + busybox_config_option n FEATURE_CLEAN_UP
162 + busybox_config_option n MONOTONIC_SYSCALL
163 + busybox_config_option n USE_PORTABLE_CODE
164 + busybox_config_option n WERROR
165 + # triming the BSS size may be dangerous
166 + busybox_config_option n FEATURE_USE_BSS_TAIL
167 +
168 + # These cause trouble with musl.
169 + if use elibc_musl; then
170 + busybox_config_option n FEATURE_UTMP
171 + busybox_config_option n EXTRA_COMPAT
172 + busybox_config_option n FEATURE_VI_REGEX_SEARCH
173 + fi
174 +
175 + # Disable standalone shell mode when using make-symlinks, else Busybox calls its
176 + # applets by default without looking up in PATH.
177 + # This also enables users to disable a builtin by deleting the corresponding symlink.
178 + if use make-symlinks; then
179 + busybox_config_option n FEATURE_PREFER_APPLETS
180 + busybox_config_option n FEATURE_SH_STANDALONE
181 + fi
182 +
183 + # If these are not set and we are using a uclibc/busybox setup
184 + # all calls to system() will fail.
185 + busybox_config_option y ASH
186 + busybox_config_option y SH_IS_ASH
187 + busybox_config_option n HUSH
188 + busybox_config_option n SH_IS_HUSH
189 +
190 + busybox_config_option '"/run"' PID_FILE_PATH
191 + busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
192 +
193 + # disable ipv6 applets
194 + if ! use ipv6; then
195 + busybox_config_option n FEATURE_IPV6
196 + busybox_config_option n TRACEROUTE6
197 + busybox_config_option n PING6
198 + busybox_config_option n UDHCPC6
199 + fi
200 +
201 + busybox_config_option pam PAM
202 + busybox_config_option static STATIC
203 + busybox_config_option syslog {K,SYS}LOGD LOGGER
204 + busybox_config_option systemd FEATURE_SYSTEMD
205 + busybox_config_option math FEATURE_AWK_LIBM
206 +
207 + # disable features that uClibc doesn't (yet?) provide.
208 + if use elibc_uclibc; then
209 + busybox_config_option n FEATURE_SYNC_FANCY #567598
210 + busybox_config_option n NSENTER
211 + fi
212 +
213 + # all the debug options are compiler related, so punt them
214 + busybox_config_option n DEBUG_SANITIZE
215 + busybox_config_option n DEBUG
216 + busybox_config_option y NO_DEBUG_LIB
217 + busybox_config_option n DMALLOC
218 + busybox_config_option n EFENCE
219 + busybox_config_option $(usex debug y n) TFTP_DEBUG
220 +
221 + busybox_config_option selinux SELINUX
222 +
223 + # this opt only controls mounting with <linux-2.6.23
224 + busybox_config_option n FEATURE_MOUNT_NFS
225 +
226 + # glibc-2.26 and later does not ship RPC implientation
227 + busybox_config_option n FEATURE_HAVE_RPC
228 + busybox_config_option n FEATURE_INETD_RPC
229 +
230 + # default a bunch of uncommon options to off
231 + local opt
232 + for opt in \
233 + ADD_SHELL \
234 + BEEP BOOTCHARTD \
235 + CRONTAB \
236 + DC DEVFSD DNSD DPKG{,_DEB} \
237 + FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
238 + FEATURE_DEVFS \
239 + HOSTID HUSH \
240 + INETD INOTIFYD IPCALC \
241 + LOCALE_SUPPORT LOGNAME LPD \
242 + MAKEMIME MKFS_MINIX MSH \
243 + OD \
244 + RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
245 + SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
246 + TASKSET TCPSVD \
247 + RPM RPM2CPIO \
248 + UDPSVD UUDECODE UUENCODE
249 + do
250 + busybox_config_option n ${opt}
251 + done
252 +
253 + emake -j1 oldconfig > /dev/null
254 +}
255 +
256 +src_compile() {
257 + unset KBUILD_OUTPUT #88088
258 + export SKIP_STRIP=y
259 +
260 + emake V=1 busybox
261 +
262 + # bug #701512
263 + emake V=1 doc
264 +}
265 +
266 +src_install() {
267 + unset KBUILD_OUTPUT #88088
268 + save_config .config
269 +
270 + into /
271 + dodir /bin
272 + if use sep-usr ; then
273 + # install /ginit to take care of mounting stuff
274 + exeinto /
275 + newexe busybox_unstripped ginit
276 + dosym /ginit /bin/bb
277 + dosym bb /bin/busybox
278 + else
279 + newbin busybox_unstripped busybox
280 + dosym busybox /bin/bb
281 + fi
282 + if use mdev ; then
283 + dodir /$(get_libdir)/mdev/
284 + use make-symlinks || dosym /bin/bb /sbin/mdev
285 + cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
286 +
287 + exeinto /$(get_libdir)/mdev/
288 + doexe "${FILESDIR}"/mdev/*
289 +
290 + newinitd "${FILESDIR}"/mdev.initd mdev
291 + fi
292 + if use livecd ; then
293 + dosym busybox /bin/vi
294 + fi
295 +
296 + # add busybox daemon's, bug #444718
297 + if busybox_config_enabled FEATURE_NTPD_SERVER; then
298 + newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
299 + newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
300 + fi
301 + if busybox_config_enabled SYSLOGD; then
302 + newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
303 + newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
304 + fi
305 + if busybox_config_enabled KLOGD; then
306 + newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
307 + newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
308 + fi
309 + if busybox_config_enabled WATCHDOG; then
310 + newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
311 + newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
312 + fi
313 + if busybox_config_enabled UDHCPC; then
314 + local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
315 + exeinto "${path%/*}"
316 + newexe examples/udhcp/simple.script "${path##*/}"
317 + fi
318 + if busybox_config_enabled UDHCPD; then
319 + insinto /etc
320 + doins examples/udhcp/udhcpd.conf
321 + fi
322 +
323 + # bundle up the symlink files for use later
324 + emake DESTDIR="${ED}" install
325 + rm _install/bin/busybox
326 + # for compatibility, provide /usr/bin/env
327 + mkdir -p _install/usr/bin
328 + ln -s /bin/env _install/usr/bin/env
329 + tar cf busybox-links.tar -C _install . || : #;die
330 + insinto /usr/share/${PN}
331 + use make-symlinks && doins busybox-links.tar
332 +
333 + dodoc AUTHORS README TODO
334 +
335 + cd docs || die
336 + doman busybox.1
337 + docinto txt
338 + dodoc *.txt
339 + docinto pod
340 + dodoc *.pod
341 + docinto html
342 + dodoc *.html
343 +
344 + cd ../examples || die
345 + docinto examples
346 + dodoc inittab depmod.pl *.conf *.script undeb unrpm
347 +}
348 +
349 +pkg_preinst() {
350 + if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ -z "${ROOT}" ]] ; then
351 + ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
352 + ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
353 + ewarn "If you are creating a binary only and not merging this is probably ok."
354 + ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
355 + die "silly options will destroy your system"
356 + fi
357 +
358 + if use make-symlinks ; then
359 + mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
360 + fi
361 +}
362 +
363 +pkg_postinst() {
364 + savedconfig_pkg_postinst
365 +
366 + if use make-symlinks ; then
367 + cd "${T}" || die
368 + mkdir _install
369 + tar xf busybox-links.tar -C _install || die
370 + false | cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
371 + fi
372 +
373 + if use sep-usr ; then
374 + elog "In order to use the sep-usr support, you have to update your"
375 + elog "kernel command line. Add the option:"
376 + elog " init=/ginit"
377 + elog "To launch a different init than /sbin/init, use:"
378 + elog " init=/ginit /sbin/yourinit"
379 + elog "To get a rescue shell, you may boot with:"
380 + elog " init=/ginit bb"
381 + fi
382 +}