commit 478dbe703a4bbc6bbc152eb5352aacd3fdd71be1
parent 1dc19d4a300de03bc7bf0d9472297438e3a0eb54
Author: finwo <finwo@pm.me>
Date: Thu, 17 Sep 2026 14:24:14 +0200
Added more packages to get booting
Diffstat:
20 files changed, 321 insertions(+), 32 deletions(-)
diff --git a/mk/build.sh b/mk/build.sh
@@ -38,9 +38,9 @@ DESTDIR="${WORK}/dest"
WRKSRC=
OUTDIR="${ROOT}/build/repo"
# shared build logic for templates; set before the template is sourced so
-# templates can `. "${MKDIR}/kernel.inc"` at the top level
-MKDIR="${HERE}"
-export MKDIR
+# templates can `. "${UNOS_MKDIR}/kernel.inc"` at the top level
+UNOS_MKDIR="${HERE}"
+export UNOS_MKDIR
# Build-time sysroot (generated, never committed): libraries that other
# packages build against install twice - once into DESTDIR (the shipped
# .apk) and once into SYSROOT (headers + .so + prefix-fixed .pc files).
@@ -109,7 +109,7 @@ if [ -n "${distfiles}" ]; then
patch -d "${WRKSRC}" -p1 --no-backup-if-mismatch -i "${p}"
done
fi
-export DESTDIR WRKSRC FILESDIR WORK SYSROOT MKDIR
+export DESTDIR WRKSRC FILESDIR WORK SYSROOT UNOS_MKDIR
# host-built tools first (muon), target sysroot visible to pkg-config.
# Both are additive only; system cc/patch/curl/pkg-config resolve as before.
export PATH="${ROOT}/build/host/bin:${PATH}"
@@ -126,6 +126,20 @@ do_build
msg "${pkgname}: do_install"
do_install
+# --- sysroot .pc fixup (central convention; templates stop hand-rolling it)
+# A sysroot .pc must point at the sysroot, not /. Rewriting only prefix= is
+# not enough: many upstream .pc files spell libdir=/includedir= literally
+# (efivar does; the build of efibootmgr then picked host headers). Fix
+# every level, every .pc, every build. Idempotent.
+for _pc in "${SYSROOT}"/usr/lib/pkgconfig/*.pc; do
+ [ -e "${_pc}" ] || continue
+ sed -i \
+ -e "s|^prefix=.*|prefix=${SYSROOT}/usr|" \
+ -e "s|^libdir=.*|libdir=${SYSROOT}/usr/lib|" \
+ -e "s|^includedir=.*|includedir=${SYSROOT}/usr/include|" \
+ "${_pc}"
+done
+
# --- signing key: UNOS_SIGN_KEY > .sign-key > single key in ~/.unos-keys ---
# shellcheck disable=SC1090
. "${HERE}/sign-key.inc"
diff --git a/mk/kernel.inc b/mk/kernel.inc
@@ -1,7 +1,7 @@
#!/bin/sh
# mk/kernel.inc - shared kbuild recipe for the linux-{longterm,stable,
# mainline} templates. Sourced at template top level via
-# . "${MKDIR}/kernel.inc" (MKDIR is exported by the driver before the
+# . "${UNOS_MKDIR}/kernel.inc" (UNOS_MKDIR is exported by the driver before the
# template is sourced).
#
# The template sets variables, then the standard phases call in:
@@ -78,6 +78,7 @@ kernel_build() {
kernel_install() {
cd "${WRKSRC}"
install -D -m 644 arch/x86/boot/bzImage "${DESTDIR}/boot/vmlinuz-${KREL}"
+ ln -sf "vmlinuz-${KREL}" "${DESTDIR}/boot/vmlinuz"
install -D -m 644 System.map "${DESTDIR}/boot/System.map-${KREL}"
install -D -m 644 .config "${DESTDIR}/boot/config-${KREL}"
make ARCH=x86_64 INSTALL_MOD_PATH="${DESTDIR}" INSTALL_MOD_STRIP=1 \
diff --git a/mk/rootfs.sh b/mk/rootfs.sh
@@ -47,7 +47,7 @@ apk_ns "${APK}" --root "${ROOTFS}" --initdb \
echo "==> UNOS system (fully trusted from here on)"
apk_ns "${APK}" --root "${ROOTFS}" \
--cache-dir "${CACHE}" --repository "${REPO}" \
- add base-files glibc busybox unos-firstboot tinyssh libmnl zlib openssl iproute2 apk-tools linux-longterm
+ add base-files glibc busybox unos-firstboot tinyssh libmnl zlib openssl iproute2 apk-tools linux-longterm grub popt efivar efibootmgr
# Deterministic loader cache: package post-installs refresh it during the
# transaction, but assembly must not depend on script-execution order.
diff --git a/packages/README.md b/packages/README.md
@@ -53,12 +53,20 @@ directory is ever built by hand on a target switch.
- **Build-time sysroot (`build/sysroot`, generated, never committed).**
Libraries that other packages build against install twice: once into
`DESTDIR` (the shipped `.apk`) and once into `SYSROOT` (headers + `.so` +
- `.pc` files). The driver exports `SYSROOT`, prepends
- `build/host/bin` (host tools like muon) to `PATH`, and points
- `PKG_CONFIG_PATH` at the sysroot. Library templates must rewrite the
- `prefix=` line of their sysroot `.pc` copies to `${SYSROOT}/usr` - a
- plain `DESTDIR` install bakes `prefix=/usr`, which would point consumers
- at host headers.
+ `.pc` files). The driver exports `SYSROOT` and `UNOS_MKDIR` (the mk/
+ directory - never `MKDIR`, which collides with libtool's internal
+ `$MKDIR`), prepends `build/host/bin` (host tools like muon) to `PATH`,
+ and points `PKG_CONFIG_PATH` at the sysroot. The driver centrally
+ rewrites every sysroot `.pc` after `do_install` (all of `prefix=`,
+ `libdir=`, `includedir` to `${SYSROOT}/usr` paths) - hand-rolled
+ per-template `sed` of only `prefix=` is insufficient (efivar's
+ `libdir=/includedir=` are literal, not `${prefix}`-relative, so a
+ prefix-only rewrite left consumers on host `/usr/include`). Templates
+ only double-install and assert presence; the driver fixes the paths.
+ efivar additionally patches its `.pc.in` before generation to expose
+ both `-I${includedir}` and `-I${includedir}/efivar` (upstream only
+ ships the subdir, which relies on host `/usr/include` as an implicit
+ search path - absent in a sysroot).
- **Loader cache is generated, never shipped.** The loader's baked-in
search covers `/lib64` + `/usr/lib64` only, so every library package
carries a `files/post-install` running `exec /sbin/ldconfig` (absolute:
@@ -82,3 +90,19 @@ directory is ever built by hand on a target switch.
through `/proc/self/fd`, so any `apk add` that runs scripts needs
`/proc` mounted in the target (live systems always have it;
`mk/rootfs.sh` binds it for assembly; the installer must too).
+- **Kernel image symlink.** `mk/kernel.inc` installs both
+ `/boot/vmlinuz-${KREL}` and `/boot/vmlinuz -> vmlinuz-${KREL}`; the
+ static `grub.cfg` references the generic path. Older images had only
+ the versioned name - the installer creates the symlink idempotently
+ after unpacking rootfs, so both old and new images boot.
+- **GRUB is UEFI-only in this tree.** `packages/grub` builds
+ `x86_64-efi` only; `i386-pc` fails under binutils 2.44 (mislinked
+ `kernel.img` `.text` at 0x9074 vs 0x9000, `grub-mkimage` fail-louds).
+ The installer dies on BIOS firmware with a clear message; revisit
+ when binutils is fixed or upstream works around it. The grub package
+ prunes `grub-mkconfig` - the static `grub.cfg` is rendered by the
+ installer and checked with shipped `grub-script-check`.
+- **Host-independence.** `iproute2` scrubs autotools-appended optionals
+ (`HAVE_ELF` etc.) and asserts `NEEDED` is subset of {libmnl,libcap,libc}; `grub`
+ trims freetype/tasn1/fuse/zfs/dm; all `CPPFLAGS/LDFLAGS` are
+ sysroot-first. A build must not silently pick up host libraries.
diff --git a/packages/busybox/template b/packages/busybox/template
@@ -1,7 +1,7 @@
# Template file for 'busybox'
pkgname=busybox
version=1.36.1
-revision=5
+revision=6
short_desc="Swiss Army knife of embedded Linux utilities"
maintainer="finwo <finwo@pm.me>"
license="GPL-2.0-only"
@@ -21,17 +21,21 @@ depends=
# full-featured; busybox's references kernel-removed CBQ UAPI and does not
# build against modern headers), LDCONFIG (glibc's real ldconfig owns
# /sbin/ldconfig; the applet would conflict on that path and its cache
-# output must never feed glibc's loader), udhcpd (dnsmasq covers the
-# server side), httpd/inetd (tcpsvd is our super-server).
+# output must never feed glibc's loader), the xz family (real xz owns
+# usr/bin/{xz,xzcat,unxz,lzma,unlzma,lzcat} - apk refuses the overwrite
+# otherwise; six symbols gate them in bbunzip.c, all six go; kernel
+# initramfs xz stays independent via CONFIG_RD_XZ),
+# udhcpd (dnsmasq covers the server side), httpd/inetd (tcpsvd is our
+# super-server).
# Untouched (defconfig default) until their design lands: SYSLOGD/KLOGD.
# No checked-in .config on purpose: defconfig + CFG_* is the source of truth
# (this kconfig has no savedefconfig anyway); the assertions below enforce it.
CFG_ON="INIT HALT POWEROFF REBOOT GETTY LOGIN MOUNT UMOUNT SWITCH_ROOT ASH ASH_JOB_CONTROL RUNSV RUNSVDIR SV SVLOGD CHPST SETUIDGID TCPSVD UDHCPC"
-CFG_OFF="IP FEATURE_IP_ADDRESS FEATURE_IP_LINK FEATURE_IP_ROUTE FEATURE_IP_RULE FEATURE_IP_TUNNEL TC LDCONFIG UDHCPD HTTPD INETD"
+CFG_OFF="IP FEATURE_IP_ADDRESS FEATURE_IP_LINK FEATURE_IP_ROUTE FEATURE_IP_RULE FEATURE_IP_TUNNEL TC LDCONFIG UNLZMA LZCAT LZMA UNXZ XZCAT XZ UDHCPD HTTPD INETD"
# applet names as `busybox --list` prints them
REQUIRE="init halt poweroff reboot getty login mount umount switch_root ash runsv runsvdir sv svlogd chpst setuidgid tcpsvd udhcpc"
-FORBID="ip tc ldconfig udhcpd httpd inetd"
+FORBID="ip tc ldconfig unlzma lzcat lzma unxz xzcat xz udhcpd httpd inetd"
set_config() {
# $1 = symbol, $2 = y|n
diff --git a/packages/efibootmgr/template b/packages/efibootmgr/template
@@ -0,0 +1,37 @@
+# Template file for 'efibootmgr'
+pkgname=efibootmgr
+version=18
+revision=0
+short_desc="EFI boot manager entries tool"
+maintainer="finwo <finwo@pm.me>"
+license="GPL-2.0-only"
+homepage="https://github.com/rhboot/efibootmgr"
+distfiles="https://github.com/rhboot/efibootmgr/archive/refs/tags/18.tar.gz"
+checksum=442867d12f8525034a404fc8af3036dba8e1fc970998af2486c3b940dfad0874
+# runtime links (readelf-proven at build): libefivar + libpopt.
+depends="efivar popt"
+
+# Notes:
+# - No configure step; lowercase make vars (prefix/libdir/sbindir) plus
+# EFIDIR, which configure-time *requires* (build errors without it).
+# EFIDIR=unos matches install.sh --bootloader-id=unos, so the compiled
+# DEFAULT_LOADER lands in the right directory (its `grub.efi` filename
+# vs grub-install's `grubx64.efi` only matters for bare `efibootmgr`
+# invocations; grub-install always passes an explicit loader path).
+# - efivar + popt resolve from the sysroot via the driver PKG_CONFIG_PATH.
+# - sbindir=/usr/sbin (admin tool, matches our layout). No post-install
+# (no .so shipped). Needs efivarfs at RUNTIME (/sys/firmware/efi/efivars
+# - the installer already binds /sys, which carries it on UEFI hosts);
+# without it the tool errors clearly, it never silently no-ops.
+
+do_build() {
+ cd "${WRKSRC}"
+ make -j"$(nproc)" prefix=/usr libdir=/usr/lib sbindir=/usr/sbin EFIDIR=unos
+ [ -x src/efibootmgr ] || die "efibootmgr: binary missing after build"
+}
+
+do_install() {
+ cd "${WRKSRC}"
+ make install prefix=/usr libdir=/usr/lib sbindir=/usr/sbin EFIDIR=unos DESTDIR="${DESTDIR}"
+ [ -x "${DESTDIR}/usr/sbin/efibootmgr" ] || die "efibootmgr: not installed"
+}
diff --git a/packages/efivar/files/post-install b/packages/efivar/files/post-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+# efivar post-install: refresh the loader cache so the new .so resolves.
+# Every UNOS library package carries this (apk runs scripts per package at
+# install time; a single glibc-side run would be order-dependent). Absolute
+# path on purpose (see glibc post-install).
+exec /sbin/ldconfig
diff --git a/packages/efivar/template b/packages/efivar/template
@@ -0,0 +1,55 @@
+# Template file for 'efivar'
+pkgname=efivar
+version=39
+revision=0
+short_desc="EFI variable filesystem library and tools"
+maintainer="finwo <finwo@pm.me>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/rhboot/efivar"
+distfiles="https://github.com/rhboot/efivar/archive/refs/tags/39.tar.gz"
+checksum=c9edd15f2eeeea63232f3e669a48e992c7be9aff57ee22672ac31f5eca1609a6
+# glibc + busybox first: the post-install runs /sbin/ldconfig under
+# /bin/sh (ordering, not just runtime truth - see libmnl).
+depends="glibc busybox"
+
+# Notes:
+# - No configure step upstream; plain make with PREFIX/LIBDIR (defaults
+# would land libs in lib64). Docs stay on (host mandoc present).
+# - -Werror is upstream default; if a newer host gcc trips it, evaluate
+# the warning before reaching for overrides (grub precedent:
+# --disable-werror exists because vintage code + new gcc).
+# - Shared + static both build; the .a files are removed per the
+# shared-only policy. Sysroot seed + .pc rewrites (three .pc files,
+# fixed centrally by the driver) so efibootmgr's build finds them via
+# PKG_CONFIG_PATH.
+# - Upstream efivar.pc/efiboot.pc spell Cflags as -I${includedir}/efivar
+# only. That works on a host where /usr/include is an implicit search
+# path (so `#include <efivar/efivar.h>` inside efiboot.h resolves), but
+# in a sysroot build the bare /usr/include is NOT searched and consumers
+# that only `pkg-config efivar efiboot` (e.g. efibootmgr itself) fail.
+# Patch the .pc.in files to expose BOTH -I${includedir} and the subdir.
+# - The `efivar` CLI ships too (reading/writing EFI vars from UNOS itself).
+# - Every UNOS library package carries the ldconfig post-install.
+
+do_build() {
+ cd "${WRKSRC}"
+ # Expose the parent include dir too (see Notes above); .pc.in are
+ # templated with @@PLACEHOLDERS@@, so patch the source before any
+ # generation step writes the final .pc files.
+ for pc in src/efivar.pc.in src/efiboot.pc.in src/efisec.pc.in; do
+ [ -f "${pc}" ] || continue
+ sed -i 's|Cflags: -I${includedir}/efivar|Cflags: -I${includedir} -I${includedir}/efivar|' "${pc}"
+ done
+ make -j"$(nproc)" PREFIX=/usr LIBDIR=/usr/lib
+ [ -f src/libefivar.so ] || die "efivar: shared lib missing after build"
+}
+
+do_install() {
+ cd "${WRKSRC}"
+ make install PREFIX=/usr LIBDIR=/usr/lib DESTDIR="${DESTDIR}"
+ make install PREFIX=/usr LIBDIR=/usr/lib DESTDIR="${SYSROOT}"
+ rm -f "${DESTDIR}"/usr/lib/*.a "${SYSROOT}"/usr/lib/*.a
+ for pc in efivar.pc efiboot.pc efisec.pc; do
+ [ -f "${SYSROOT}/usr/lib/pkgconfig/${pc}" ] || die "efivar: no sysroot ${pc}"
+ done
+}
diff --git a/packages/grub/template b/packages/grub/template
@@ -0,0 +1,64 @@
+# Template file for 'grub'
+pkgname=grub
+version=2.14
+revision=0
+short_desc="Bootloader with support for BIOS and UEFI"
+maintainer="finwo <finwo@pm.me>"
+license="GPL-3.0-or-later"
+homepage="https://www.gnu.org/software/grub/"
+# NOTE: gnu publishes PGP .sig only, no sha256 file - TOFU pin.
+distfiles="https://ftp.gnu.org/gnu/grub/grub-2.14.tar.xz"
+checksum=bc8d3c73535b8838d8c8e2654d73edc4e6ae8c8acdb45d5df5dc9a1547446d43
+# xz: grub-install links liblzma (readelf-proven, not guessed).
+depends="xz"
+
+# Notes:
+# - x86_64-efi ONLY in v1 (not i386-pc): grub 2.14's pc kernel.img links
+# .text at 0x9074 instead of the required 0x9000 under host binutils
+# 2.44 (headers counted where old ld overlapped them), and grub-mkimage
+# fail-louds on it. Objects compile fine (-m32 codegen works); only the
+# flat core layout is wrong. Revisit when the toolchain allows: older
+# binutils, upstream fix, or a verified link flag - NOT by shipping
+# artifacts that build unbootable images. Modern whiteboxes and QEMU-OVMF
+# are UEFI anyway; legacy BIOS is a follow-up, not a blocker.
+# - Single out-of-tree build. --disable-nls (no localized boot menus) and
+# --disable-werror (host gcc is newer than grub's vintage).
+# - Inclusive install, then prune (grub-install needs its helpers at
+# runtime; cherry-picking risks breaking it). Pruned: info docs, themes,
+# locales, grub-mkconfig (UNOS writes a static grub.cfg - deterministic,
+# no probing). grub-script-check ships to validate that static config.
+# Man pages kept (tinyssh precedent).
+# - Upstream defaults are trimmed ONLY where auto-detection would create
+# host-dependent runtime deps (same lesson as iproute2's scrub): no
+# custom console fonts (serial only, drops freetype), no TPM-sealed boot
+# (drops tasn1), no FUSE mount, no ZFS, no device-mapper.
+# - CPPFLAGS/LDFLAGS put the sysroot first: configure "guesses" liblzma
+# via try-link, which would otherwise take host headers.
+# - No `make check` (needs qemu RVA); CI story pending.
+do_configure() {
+ mkdir -p "${WORK}/build-efi"
+ cd "${WORK}/build-efi"
+ CPPFLAGS="-I${SYSROOT}/usr/include" LDFLAGS="-L${SYSROOT}/usr/lib" \
+ "${WRKSRC}/configure" --prefix=/usr --with-platform=efi \
+ --disable-nls --disable-werror \
+ --disable-grub-mkfont --disable-grub-mount --disable-grub-protect \
+ --disable-libzfs --disable-device-mapper
+}
+
+do_build() {
+ make -C "${WORK}/build-efi" -j"$(nproc)"
+ [ -x "${WORK}/build-efi/grub-mkimage" ] || die "grub: efi grub-mkimage missing"
+}
+
+do_install() {
+ # install-strip: upstream binaries ship with debug_info; strip programs.
+ # (.mod files install as data and stay unstripped - measured acceptable.)
+ make -C "${WORK}/build-efi" install-strip DESTDIR="${DESTDIR}"
+ # prune: docs, themes, locales - serial/console boot needs none of them
+ rm -rf "${DESTDIR}/usr/share/info" "${DESTDIR}/usr/share/grub/themes" \
+ "${DESTDIR}/usr/share/locale"
+ # no probing config generation on a switch (see Notes)
+ rm -f "${DESTDIR}"/usr/sbin/grub-mkconfig "${DESTDIR}"/usr/share/man/man8/grub-mkconfig.8
+ [ -x "${DESTDIR}/usr/sbin/grub-install" ] || die "grub: grub-install missing"
+ [ -d "${DESTDIR}/usr/lib/grub/x86_64-efi" ] || die "grub: x86_64-efi modules missing"
+}
diff --git a/packages/libcap/template b/packages/libcap/template
@@ -43,6 +43,5 @@ do_install() {
rm -f "${SYSROOT}"/usr/lib/libcap.a "${SYSROOT}"/usr/lib/libpsx.a
for pc in libcap.pc libpsx.pc; do
[ -f "${SYSROOT}/usr/lib/pkgconfig/${pc}" ] || die "libcap: no sysroot ${pc}"
- sed -i "s|^prefix=.*$|prefix=${SYSROOT}/usr|" "${SYSROOT}/usr/lib/pkgconfig/${pc}"
done
}
diff --git a/packages/libmnl/template b/packages/libmnl/template
@@ -38,6 +38,5 @@ do_install() {
make install DESTDIR="${SYSROOT}"
# .la files are build-time libtool metadata, never shipped
rm -f "${DESTDIR}"/usr/lib/*.la "${SYSROOT}"/usr/lib/*.la
- [ -f "${SYSROOT}/usr/lib/pkgconfig/libmnl.pc" ] || die "libmnl: no sysroot .pc"
- sed -i "s|^prefix=.*$|prefix=${SYSROOT}/usr|" "${SYSROOT}/usr/lib/pkgconfig/libmnl.pc"
+ grep -q "^prefix=${SYSROOT}/usr$" "${SYSROOT}/usr/lib/pkgconfig/libmnl.pc" || die "libmnl: sysroot .pc not fixed"
}
diff --git a/packages/linux-longterm/template b/packages/linux-longterm/template
@@ -41,12 +41,12 @@ depends_linux_headers=
# (same ordering rule as the library packages).
# shellcheck disable=SC1091
-. "${MKDIR}/kernel.inc"
+. "${UNOS_MKDIR}/kernel.inc"
-KDELTA_ENABLE="IKCONFIG IKCONFIG_PROC NET_L3_MASTER_DEV IPV6_MULTIPLE_TABLES"
+KDELTA_ENABLE="IKCONFIG IKCONFIG_PROC NET_L3_MASTER_DEV IPV6_MULTIPLE_TABLES BLK_DEV_NVME MMC MMC_BLOCK"
KDELTA_MODULE="NET_VRF"
KDELTA_DISABLE=""
-KASSERT_Y="IPV6 IP_MULTIPLE_TABLES IPV6_MULTIPLE_TABLES NET_L3_MASTER_DEV DEVTMPFS_MOUNT BLK_DEV_INITRD SERIAL_8250_CONSOLE MODULES IKCONFIG IKCONFIG_PROC"
+KASSERT_Y="IPV6 IP_MULTIPLE_TABLES IPV6_MULTIPLE_TABLES NET_L3_MASTER_DEV DEVTMPFS_MOUNT BLK_DEV_INITRD SERIAL_8250_CONSOLE MODULES IKCONFIG IKCONFIG_PROC EFI_STUB BLK_DEV_NVME MMC MMC_BLOCK NVME_CORE"
KASSERT_M="NET_VRF"
KASSERT_N="MODULE_SIG"
diff --git a/packages/linux-mainline/template b/packages/linux-mainline/template
@@ -39,12 +39,12 @@ depends_linux_headers=
# to the 7.3_rc3 apk version) - all install paths use KREL.
# shellcheck disable=SC1091
-. "${MKDIR}/kernel.inc"
+. "${UNOS_MKDIR}/kernel.inc"
-KDELTA_ENABLE="IKCONFIG IKCONFIG_PROC NET_L3_MASTER_DEV IPV6_MULTIPLE_TABLES"
+KDELTA_ENABLE="IKCONFIG IKCONFIG_PROC NET_L3_MASTER_DEV IPV6_MULTIPLE_TABLES BLK_DEV_NVME MMC MMC_BLOCK"
KDELTA_MODULE="NET_VRF"
KDELTA_DISABLE=""
-KASSERT_Y="IPV6 IP_MULTIPLE_TABLES IPV6_MULTIPLE_TABLES NET_L3_MASTER_DEV DEVTMPFS_MOUNT BLK_DEV_INITRD SERIAL_8250_CONSOLE MODULES IKCONFIG IKCONFIG_PROC"
+KASSERT_Y="IPV6 IP_MULTIPLE_TABLES IPV6_MULTIPLE_TABLES NET_L3_MASTER_DEV DEVTMPFS_MOUNT BLK_DEV_INITRD SERIAL_8250_CONSOLE MODULES IKCONFIG IKCONFIG_PROC EFI_STUB BLK_DEV_NVME MMC MMC_BLOCK NVME_CORE"
KASSERT_M="NET_VRF"
KASSERT_N="MODULE_SIG"
diff --git a/packages/linux-stable/template b/packages/linux-stable/template
@@ -33,12 +33,12 @@ depends_linux_headers=
# fail loud if this list rots.
# shellcheck disable=SC1091
-. "${MKDIR}/kernel.inc"
+. "${UNOS_MKDIR}/kernel.inc"
-KDELTA_ENABLE="IKCONFIG IKCONFIG_PROC NET_L3_MASTER_DEV IPV6_MULTIPLE_TABLES"
+KDELTA_ENABLE="IKCONFIG IKCONFIG_PROC NET_L3_MASTER_DEV IPV6_MULTIPLE_TABLES BLK_DEV_NVME MMC MMC_BLOCK"
KDELTA_MODULE="NET_VRF"
KDELTA_DISABLE=""
-KASSERT_Y="IPV6 IP_MULTIPLE_TABLES IPV6_MULTIPLE_TABLES NET_L3_MASTER_DEV DEVTMPFS_MOUNT BLK_DEV_INITRD SERIAL_8250_CONSOLE MODULES IKCONFIG IKCONFIG_PROC"
+KASSERT_Y="IPV6 IP_MULTIPLE_TABLES IPV6_MULTIPLE_TABLES NET_L3_MASTER_DEV DEVTMPFS_MOUNT BLK_DEV_INITRD SERIAL_8250_CONSOLE MODULES IKCONFIG IKCONFIG_PROC EFI_STUB BLK_DEV_NVME MMC MMC_BLOCK NVME_CORE"
KASSERT_M="NET_VRF"
KASSERT_N="MODULE_SIG"
diff --git a/packages/openssl/template b/packages/openssl/template
@@ -43,6 +43,5 @@ do_install() {
rm -f "${SYSROOT}/usr/lib/libcrypto.a" "${SYSROOT}/usr/lib/libssl.a"
for pc in libcrypto.pc libssl.pc openssl.pc; do
[ -f "${SYSROOT}/usr/lib/pkgconfig/${pc}" ] || die "openssl: no sysroot ${pc}"
- sed -i "s|^prefix=.*$|prefix=${SYSROOT}/usr|" "${SYSROOT}/usr/lib/pkgconfig/${pc}"
done
}
diff --git a/packages/popt/files/post-install b/packages/popt/files/post-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+# popt post-install: refresh the loader cache so the new .so resolves.
+# Every UNOS library package carries this (apk runs scripts per package at
+# install time; a single glibc-side run would be order-dependent). Absolute
+# path on purpose (see glibc post-install).
+exec /sbin/ldconfig
diff --git a/packages/popt/template b/packages/popt/template
@@ -0,0 +1,37 @@
+# Template file for 'popt'
+pkgname=popt
+version=1.19
+revision=0
+short_desc="Command-line option parsing library"
+maintainer="finwo <finwo@pm.me>"
+license="MIT"
+homepage="https://github.com/rpm-software-management/popt"
+# NOTE: TOFU pin; https to ftp.rpm.org fails from here, http works.
+distfiles="http://ftp.rpm.org/popt/releases/popt-1.x/popt-1.19.tar.gz"
+checksum=c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9
+# glibc + busybox first: the post-install runs /sbin/ldconfig under
+# /bin/sh (ordering, not just runtime truth - see libmnl).
+depends="glibc busybox"
+
+# Notes:
+# - Shared-only per packages/README.md. Sysroot seed (second install +
+# .pc prefix rewrite) so efibootmgr's build finds it via PKG_CONFIG_PATH.
+# - Every UNOS library package carries the ldconfig post-install.
+
+do_configure() {
+ cd "${WRKSRC}"
+ ./configure --prefix=/usr --disable-static
+}
+
+do_build() {
+ cd "${WRKSRC}"
+ make -j"$(nproc)"
+}
+
+do_install() {
+ cd "${WRKSRC}"
+ make install DESTDIR="${DESTDIR}"
+ make install DESTDIR="${SYSROOT}"
+ rm -f "${DESTDIR}"/usr/lib/*.la "${SYSROOT}"/usr/lib/*.la
+ [ -f "${SYSROOT}/usr/lib/pkgconfig/popt.pc" ] || die "popt: no sysroot .pc"
+}
diff --git a/packages/xz/files/post-install b/packages/xz/files/post-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+# xz post-install: refresh the loader cache so the new .so resolves.
+# Every UNOS library package carries this (apk runs scripts per package at
+# install time; a single glibc-side run would be order-dependent). Absolute
+# path on purpose (see glibc post-install).
+exec /sbin/ldconfig
diff --git a/packages/xz/template b/packages/xz/template
@@ -0,0 +1,39 @@
+# Template file for 'xz'
+pkgname=xz
+version=5.8.4
+revision=1
+short_desc="General-purpose data compression library and tools"
+maintainer="finwo <finwo@pm.me>"
+license="0BSD"
+homepage="https://tukaani.org/xz/"
+# NOTE: TOFU pin from the GitHub release asset. Deliberately modern
+# (5.8.x): anything at/below 5.6.1 is unacceptable (2024 backdoor).
+distfiles="https://github.com/tukaani-project/xz/releases/download/v5.8.4/xz-5.8.4.tar.gz"
+checksum=0014c7886930454fe8bd4228665b51af55eeae560ea135c9c4cd33f55b2591d9
+# glibc + busybox first: the post-install runs /sbin/ldconfig under
+# /bin/sh (ordering, not just runtime truth - see libmnl).
+depends="glibc busybox"
+
+# Notes:
+# - Shared-only per packages/README.md. Sysroot seed (second install +
+# .pc prefix rewrite) so grub's configure links under the sysroot.
+# - Every UNOS library package carries the ldconfig post-install.
+
+do_configure() {
+ cd "${WRKSRC}"
+ ./configure --prefix=/usr --disable-static
+}
+
+do_build() {
+ cd "${WRKSRC}"
+ make -j"$(nproc)"
+}
+
+do_install() {
+ cd "${WRKSRC}"
+ make install DESTDIR="${DESTDIR}"
+ make install DESTDIR="${SYSROOT}"
+ # .la files are build-time libtool metadata, never shipped
+ rm -f "${DESTDIR}"/usr/lib/*.la "${SYSROOT}"/usr/lib/*.la
+ [ -f "${SYSROOT}/usr/lib/pkgconfig/liblzma.pc" ] || die "xz: no sysroot .pc"
+}
diff --git a/packages/zlib/template b/packages/zlib/template
@@ -37,6 +37,5 @@ do_install() {
make install DESTDIR="${DESTDIR}"
make install DESTDIR="${SYSROOT}"
rm -f "${DESTDIR}/usr/lib/libz.a" "${SYSROOT}/usr/lib/libz.a"
- [ -f "${SYSROOT}/usr/lib/pkgconfig/zlib.pc" ] || die "zlib: no sysroot .pc"
- sed -i "s|^prefix=.*$|prefix=${SYSROOT}/usr|" "${SYSROOT}/usr/lib/pkgconfig/zlib.pc"
+ grep -q "^prefix=${SYSROOT}/usr$" "${SYSROOT}/usr/lib/pkgconfig/zlib.pc" || die "zlib: sysroot .pc not fixed"
}