Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: harden universal boot — slim kernel rebuild, bootloader chain, zram guards

Ensure the slim (Mac) kernel build is clean by running olddefconfig + make
clean before rebuilding without initramfs. Fix bootloader to only fall back
to direct kernel when loader is truly absent (not on any error). Guard zram
setup for machines without zram support. Auto-rebuild splash.efi when source
changes. Disable deferred framebuffer takeover for immediate console output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+40 -8
+1
fedac/native/Dockerfile.builder
··· 13 13 RUN dnf install -y --setopt=install_weak_deps=False \ 14 14 gcc make cpio lz4 bc perl flex bison diffutils \ 15 15 elfutils-libelf-devel openssl-devel \ 16 + gnu-efi-devel \ 16 17 curl jq git tar xz findutils pkgconf-pkg-config zstd xorriso \ 17 18 ca-certificates \ 18 19 alsa-lib-devel libdrm-devel flite-devel SDL3-devel \
+3
fedac/native/ac-os
··· 622 622 # loads via systemd-boot, which then provides the initramfs separately. 623 623 log "Building slim kernel (no embedded initramfs) for Mac boot..." 624 624 sed -i 's|^CONFIG_INITRAMFS_SOURCE=.*|CONFIG_INITRAMFS_SOURCE=""|' "${LINUX_DIR}/.config" 625 + make olddefconfig 2>&1 | tail -5 626 + make clean 2>/dev/null || true 625 627 sudo rm -f "${LINUX_DIR}/usr/initramfs_data.o" "${LINUX_DIR}/usr/.initramfs_data.o.cmd" 626 628 make -j$(nproc) bzImage 2>&1 | tail -1 627 629 sudo cp arch/x86/boot/bzImage "${BUILD_DIR}/vmlinuz-slim" ··· 629 631 log "Slim kernel: $(du -sh "${BUILD_DIR}/vmlinuz-slim" | cut -f1)" 630 632 # Restore config for next build 631 633 sed -i 's|^CONFIG_INITRAMFS_SOURCE=.*|CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lz4"|' "${LINUX_DIR}/.config" 634 + make olddefconfig 2>&1 | tail -5 632 635 } 633 636 634 637 record_build() {
+6 -3
fedac/native/bootloader/splash.c
··· 150 150 } 151 151 152 152 chain: 153 - // Try systemd-boot first (for Mac split-kernel boot), fall back to direct kernel 153 + // Try systemd-boot first (for Mac split-kernel boot). Only fall back to 154 + // direct kernel boot when LOADER.EFI is absent. In universal mode KERNEL.EFI 155 + // is the slim kernel and requires the separate initramfs, so falling 156 + // through after a loader error boots the wrong path. 154 157 status = chainload(ImageHandle, LOADER_PATH); 155 - // LOADER.EFI not found — try direct kernel (non-Mac boot) 156 - status = chainload(ImageHandle, KERNEL_PATH); 158 + if (status == EFI_NOT_FOUND) 159 + status = chainload(ImageHandle, KERNEL_PATH); 157 160 158 161 // Both failed — show error 159 162 Print(L"Boot failed: %r\n", status);
fedac/native/bootloader/splash.efi

This is a binary file and will not be displayed.

fedac/native/bootloader/splash.so

This is a binary file and will not be displayed.

+3
fedac/native/docker-build.sh
··· 576 576 # ══════════════════════════════════════════════ 577 577 log "Step 4b: Building slim kernel for Mac..." 578 578 sed -i 's|^CONFIG_INITRAMFS_SOURCE=.*|CONFIG_INITRAMFS_SOURCE=""|' .config 579 + make olddefconfig >>"$KCFG_LOG" 2>&1 || { err "Kernel olddefconfig failed before slim build"; tail -120 "$KCFG_LOG" >&2; exit 1; } 580 + make clean 2>/dev/null || true 579 581 rm -f usr/initramfs_data.o usr/.initramfs_data.o.cmd 580 582 if run_make_with_heartbeat "$BUILD/kernel-slim.log" make -j"${KERNEL_JOBS}" bzImage; then 581 583 cp arch/x86/boot/bzImage "$BUILD/vmlinuz-slim" ··· 587 589 fi 588 590 # Restore config for any subsequent builds 589 591 sed -i 's|^CONFIG_INITRAMFS_SOURCE=.*|CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lz4"|' .config 592 + make olddefconfig >>"$KCFG_LOG" 2>&1 || { err "Kernel olddefconfig failed while restoring initramfs config"; tail -120 "$KCFG_LOG" >&2; exit 1; } 590 593 591 594 # Export initramfs as gzip (for systemd-boot on Mac) 592 595 log " Packing initramfs.cpio.gz..."
+6 -2
fedac/native/initramfs/init
··· 14 14 mount -t efivarfs efivarfs /sys/firmware/efi/efivars 2>/dev/null 15 15 16 16 # zram swap 17 - modprobe zram 2>/dev/null 18 - echo 1G > /sys/block/zram0/disksize 2>/dev/null && mkswap /dev/zram0 >/dev/null 2>&1 && swapon /dev/zram0 2>/dev/null 17 + modprobe zram 2>/dev/null || true 18 + if [ -e /sys/block/zram0/disksize ] && [ -b /dev/zram0 ]; then 19 + echo 1G > /sys/block/zram0/disksize && 20 + mkswap /dev/zram0 >/dev/null 2>&1 && 21 + swapon /dev/zram0 2>/dev/null 22 + fi 19 23 20 24 # Loopback 21 25 ip link set lo up 2>/dev/null
+1 -1
fedac/native/kernel/config-minimal
··· 2775 2775 # CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set 2776 2776 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y 2777 2777 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set 2778 - CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER=y 2778 + # CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set 2779 2779 # end of Console display driver support 2780 2780 2781 2781 # CONFIG_LOGO is not set
+17
fedac/native/scripts/media-layout.sh
··· 19 19 20 20 ac_media_bootloader_path() { 21 21 local splash="${AC_SPLASH_EFI:-${MEDIA_LAYOUT_ROOT}/bootloader/splash.efi}" 22 + local splash_dir 23 + splash_dir="$(dirname "${splash}")" 24 + local splash_src="${splash_dir}/splash.c" 25 + local splash_font="${splash_dir}/font8x8.h" 26 + local splash_make="${splash_dir}/Makefile" 27 + 28 + if [ -f "${splash_make}" ] && [ -f "${splash_src}" ]; then 29 + if [ ! -f "${splash}" ] || 30 + [ "${splash_src}" -nt "${splash}" ] || 31 + { [ -f "${splash_font}" ] && [ "${splash_font}" -nt "${splash}" ]; } || 32 + [ "${splash_make}" -nt "${splash}" ]; then 33 + (cd "${splash_dir}" && make all >/dev/null) || { 34 + echo "Failed to rebuild splash bootloader in ${splash_dir}" >&2 35 + return 1 36 + } 37 + fi 38 + fi 22 39 if [ ! -f "${splash}" ]; then 23 40 echo "Missing splash bootloader: ${splash}" >&2 24 41 return 1
+3 -2
fedac/native/src/ac-native.c
··· 236 236 237 237 // Enable zram swap (compressed RAM — effectively doubles available memory) 238 238 // Firefox + GTK needs significant memory beyond the initramfs tmpfs 239 - system("modprobe zram 2>/dev/null; " 240 - "echo 1G > /sys/block/zram0/disksize 2>/dev/null && " 239 + system("(modprobe zram 2>/dev/null || true); " 240 + "[ -e /sys/block/zram0/disksize ] && [ -b /dev/zram0 ] && " 241 + "echo 1G > /sys/block/zram0/disksize && " 241 242 "mkswap /dev/zram0 >/dev/null 2>&1 && " 242 243 "swapon /dev/zram0 2>/dev/null"); 243 244