From bcbf7c6c9fc7d8a96b1d5c4cc9247b85fe3da2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=81LI=20G=C3=A1bor=20J=C3=A1nos?= Date: Sun, 10 Apr 2022 18:17:21 +0200 Subject: Move towards custom packages. Change the build image process in a way that custom-built packages can be utilized. This means a simpler `Makefile` since every modification is implemented on the level of packages. Include the sources for every customized package. --- aports/busybox/APKBUILD | 210 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 aports/busybox/APKBUILD (limited to 'aports/busybox/APKBUILD') diff --git a/aports/busybox/APKBUILD b/aports/busybox/APKBUILD new file mode 100644 index 0000000..a1e83c6 --- /dev/null +++ b/aports/busybox/APKBUILD @@ -0,0 +1,210 @@ +# Maintainer: Gabor Pali +pkgname=busybox +pkgver=1.34.1 +pkgrel=5 +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 openssl1.1-compat-dev libretls-dev" +makedepends="$makedepends_build $makedepends_host" +checkdepends= +provides="/bin/sh" +install= +subpackages= +options="!check" +source="https://busybox.net/downloads/busybox-$pkgver.tar.bz2 + 0001-rev-correct-output-for-long-input-lines.patch + + 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 + + 0001-ash-add-built-in-BB_ASH_VERSION-variable.patch + + 0001-cpio-add-support-for-ignore-devno-like-GNU-cpio.patch + 0002-cpio-add-support-for-renumber-inodes-like-GNU-cpio.patch + + 0001-pgrep-add-support-for-matching-against-UID-and-RUID.patch + + 0001-libbb-sockaddr2str-ensure-only-printable-characters-.patch + 0002-nslookup-sanitize-all-printed-strings-with-printable.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.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 <