# Maintainer: Gabor Pali pkgname=busybox pkgver=1.35.0 pkgrel=1 # base: 15, -initscripts: 4.2-r0 pkgdesc="Size optimized toolbox of many common UNIX utilities" url="https://busybox.net/" arch="all" license="GPL-2.0-only" makedepends_build="perl" makedepends_host="linux-headers openssl-dev" # Only build with UTMPS support if we are not bootstrapping. # skalibs-static is needed for utmps-static [ -z "$BOOTSTRAP" ] && makedepends_host="$makedepends_host utmps-dev utmps-static skalibs-static" makedepends="$makedepends_build $makedepends_host" checkdepends= provides="/bin/sh" install= subpackages= options="!check" source="https://busybox.net/downloads/busybox-$pkgver.tar.bz2 0001-nologin-Install-applet-to-sbin-instead-of-usr-sbin.patch 0001-adduser-default-to-sbin-nologin-as-shell-for-system-.patch 0001-properly-fix-wget-https-support.patch 0001-modutils-check-ELF-header-before-calling-finit_module.patch 0002-fsck-resolve-LABEL-.-UUID-.-spec-to-device.patch 0003-ash-exec-busybox.static.patch 0004-app-location-for-cpio-vi-and-lspci.patch 0005-udhcpc-set-default-discover-retries-to-5.patch 0006-ping-make-ping-work-without-root-privileges.patch 0007-fbsplash-support-console-switching.patch 0008-fbsplash-support-image-and-bar-alignment-and-positio.patch 0009-depmod-support-generating-kmod-binary-index-files.patch 0010-Add-flag-for-not-following-symlinks-when-recursing.patch 0012-udhcpc-Don-t-background-if-n-is-given.patch 0013-ash-fix-unsafe-use-of-mempcpy.patch 0014-ash-fix-use-after-free-in-bash-pattern-substitution.patch 0015-ed-don-t-use-memcpy-with-overlapping-memory-regions.patch 0016-ash-don-t-read-past-end-of-var-in-subvareval-for-bas.patch 0017-ash-Fix-use-after-free-on-idx-variable.patch 0001-ash-add-built-in-BB_ASH_VERSION-variable.patch 0001-pgrep-add-support-for-matching-against-UID-and-RUID.patch 0001-avoid-redefined-warnings-when-building-with-utmps.patch 0001-libbb-sockaddr2str-ensure-only-printable-characters-.patch 0002-nslookup-sanitize-all-printed-strings-with-printable.patch 0001-modinfo-add-k-option-for-kernel-version.patch CVE-2022-30065.patch acpid.logrotate config default.script acpid.initd crond.initd mdev.initd syslog.initd udhcpd.initd crond.confd syslog.confd mdev.conf persistent-storage " # secfixes: # 1.35.0-r15: # - CVE-2022-30065 # 1.35.0-r7: # - ALPINE-13661 # - CVE-2022-28391 # 1.34.1-r5: # - ALPINE-13661 # - CVE-2022-28391 # 1.34.0-r0: # - CVE-2021-42374 # - CVE-2021-42375 # - CVE-2021-42378 # - CVE-2021-42379 # - CVE-2021-42380 # - CVE-2021-42381 # - CVE-2021-42382 # - CVE-2021-42383 # - CVE-2021-42384 # - CVE-2021-42385 # - CVE-2021-42386 # 1.33.0-r5: # - CVE-2021-28831 # 1.30.1-r2: # - CVE-2019-5747 # 1.29.3-r10: # - CVE-2018-20679 # 1.28.3-r2: # - CVE-2018-1000500 # 1.27.2-r4: # - CVE-2017-16544 # - CVE-2017-15873 # - CVE-2017-15874 # 0: # - CVE-2021-42373 # - CVE-2021-42376 # - CVE-2021-42377 prepare() { default_prepare mkdir -p "$srcdir"/build } build() { cd "$srcdir"/build echo "COPIED CONFIG to $(pwd)/.config" cp "$srcdir"/config .config [ "$CLIBC" = musl ] && sed -i \ -e "s/CONFIG_EXTRA_COMPAT=y/CONFIG_EXTRA_COMPAT=n/" \ .config make -C "$builddir" O="$PWD" silentoldconfig make } package() { local i cd "$srcdir"/build mkdir -p "$pkgdir"/usr/sbin "$pkgdir"/usr/bin "$pkgdir"/tmp \ "$pkgdir"/var/cache/misc "$pkgdir"/bin "$pkgdir"/sbin chmod 1777 "$pkgdir"/tmp install -m755 busybox "$pkgdir"/bin/busybox for target in $("$pkgdir"/bin/busybox --list-full | sort); do ln -s /bin/busybox "$pkgdir"/"$target" done #ifupdown needs those dirs to be present mkdir -p \ "$pkgdir"/etc/network/if-down.d \ "$pkgdir"/etc/network/if-post-down.d \ "$pkgdir"/etc/network/if-post-up.d \ "$pkgdir"/etc/network/if-pre-down.d \ "$pkgdir"/etc/network/if-pre-up.d \ "$pkgdir"/etc/network/if-up.d install -Dm644 "$srcdir"/acpid.logrotate \ "$pkgdir/etc/logrotate.d/acpid" mkdir -p \ "$pkgdir"/var/lib/udhcpd \ "$pkgdir"/etc/udhcpc ln -s /media/etc/udhcpd.conf "$pkgdir"/etc cat >"$pkgdir"/etc/securetty <"$pkgdir"/etc/udhcpc/udhcpc.conf <"$pkgdir"/etc/acpi/PWRF/00000080 <