Files
takana/recipes/linux.toml
T
sergioandClaude Opus 4.8 f108cc626d kernel-from-source: resolver build-deps (libelf+openssl) + refinar config
Avance del frente kernel: el build pasó objtool y certs.
- bootstrap-devfs.sh: +flex +bison +elfutils-dev +openssl-dev al NEEDED.
  * elfutils-dev (libelf/gelf.h): objtool lo exige — en x86_64 las mitigaciones
    seleccionan CONFIG_OBJTOOL aunque se use frame-pointer unwinder.
  * openssl-dev: el host-tool certs/extract-cert lo #incluye — el defconfig
    fuerza CONFIG_SYSTEM_DATA_VERIFICATION=y vía KEYS←NFS/integrity/dns_resolver
    (no apagable sin desarmar media config).
  Ambas son build-libs de arranque (status g++/zlib-dev), SEGURAS para el of_tree
  del self-host: hammerd no usa openssl (Cargo.lock limpio) y arje-zero va
  preseeded/cacheado (no se reconstruye). De-Alpinizables luego con
  recipes/{elfutils,openssl}.toml.
- linux.toml: quité los -d de keyring que no pegan (olddefconfig/syncconfig los
  revierten por el select-chain); openssl resuelve extract-cert. Comentario
  actualizado con el diagnóstico.

Estado: build compila el kernel completo (objtool+certs OK); defconfig es grande
(GPU/wireless), pendiente el bzImage + boot-test + optimización de config.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 08:19:47 -04:00

56 lines
3.2 KiB
TOML

# Linux kernel 6.16.12 — frente kernel-from-source (soberanía del bootstrap).
#
# Hoy la VM del selfhost-verify bootea un kernel importado pinned (/boot/vmlinuz-linux del host). Esta
# receta lo construye desde fuente con hammer: el último eslabón del bootstrap que no era hammer-built.
# Misma versión que recipes/linux-headers.toml (6.16.12) ⇒ coherencia headers↔kernel.
#
# Criterio de éxito: el bzImage hammer-built bootea el builder de selfhost-verify y la corrida da
# ✓ REPRODUCIBLE (KERNEL=<este bzImage> ./scripts/selfhost-verify.sh).
#
# Compilador: CC=gcc/HOSTCC=gcc (NO zig) — el kernel es el binario más grande del lab y zig 0.16
# miscompila binarios grandes (lesson binutils/python/cmake/flex); el kernel se compila con la GNU
# toolchain estándar (gcc + binutils as/ld del toolchain). No es input del 4/4 (es el kernel que
# BOOTEA la VM, no algo que el 4/4 enlace), así que el compilador da igual mientras el kernel bootee.
#
# Config: defconfig x86_64 (base PC booteable en QEMU: 8250 serial, initrd, PCI) + ajustes monolíticos
# - E1000/OVERLAY_FS/USER_NS =y (built-in): el builder usa e1000 (vendoring) + overlay (sandbox bwrap)
# + user namespaces (bwrap). Built-in ⇒ sin inyección de .ko ni version-magic.
# - MODULE_SIG/DEBUG_INFO_BTF off: evitan firma de módulos y pahole (BTF), ausente del toolchain.
# - UNWINDER_FRAME_POINTER en vez de ORC: reduce objtool pero NO lo elimina — en x86_64 las
# mitigaciones (RETHUNK/retpoline-validation) seleccionan CONFIG_OBJTOOL igual, y objtool necesita
# libelf (gelf.h). Además el defconfig fuerza CONFIG_SYSTEM_DATA_VERIFICATION=y (cadena KEYS←NFS/
# integrity/dns_resolver, no apagable sin desarmar media config) ⇒ su host-tool certs/extract-cert
# #incluye openssl. Por eso libelf + openssl se proveen como BOOTSTRAP-LIBS apk en bootstrap-devfs.sh
# (status g++/zlib-dev; SEGUROS para el of_tree: hammerd no usa openssl, arje-zero va preseeded).
# deps.build=[flex,bison,m4] son hammer-built; libelf/openssl quedan de-Alpinizables luego con
# recipes/{elfutils,openssl}.toml. [WIP: iterando la config hasta que el bzImage bootee el builder.]
name = "linux"
version = "6.16.12"
[source]
tarball = "https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-6.16.12.tar.gz"
sha256 = "ffc6af80b014ddebd55e116aa29a9f7a5256c87a29a8a9dd97270b6d49625109"
[build]
compiler = "zig-cc"
target = "x86_64-linux-musl"
link = "dynamic"
[deps]
# flex (lexer kconfig) + bison (parser kconfig) + m4 (bison lo invoca en runtime). Se materializan como
# capa overlay en /usr (binarios en /usr/bin, skeletons de bison en /usr/share/bison).
build = ["flex", "bison", "m4"]
[build.phases]
configure = """
make ARCH=x86_64 defconfig && \
scripts/config -d MODULE_SIG -d MODULE_SIG_ALL -d DEBUG_INFO_BTF -d DEBUG_INFO \
-d UNWINDER_ORC -e UNWINDER_FRAME_POINTER \
-e BLK_DEV_INITRD -e DEVTMPFS -e DEVTMPFS_MOUNT -e TMPFS \
-e E1000 -e OVERLAY_FS -e USER_NS -e NAMESPACES && \
make ARCH=x86_64 olddefconfig
"""
compile = "make ARCH=x86_64 CC=gcc HOSTCC=gcc -j\"$(nproc)\" bzImage"
install = "mkdir -p /out/boot && cp arch/x86/boot/bzImage /out/boot/bzImage && cp .config /out/boot/config-6.16.12"