Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

feat: universal boot — one USB image works on both Macs and ThinkPads

Oven build now produces vmlinuz-slim (no embedded initramfs) + separate
initramfs.cpio.gz alongside the full vmlinuz. Flash script auto-detects:
if slim kernel exists, uses splash → systemd-boot → slim kernel chain
(works on Mac EFI). Otherwise falls back to chainloader (ThinkPad).

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

+58 -18
+1
fedac/native/Dockerfile.flash-helper
··· 8 8 COPY fedac/native/scripts/media-layout.sh /usr/local/lib/ac-media-layout.sh 9 9 COPY fedac/native/scripts/flash-helper-runner.sh /usr/local/bin/ac-os-flash-helper 10 10 COPY fedac/native/boot/systemd-bootx64.efi /usr/local/lib/systemd-bootx64.efi 11 + COPY fedac/native/bootloader/splash.efi /usr/local/lib/splash.efi 11 12 12 13 RUN chmod +x /usr/local/bin/ac-os-flash-helper 13 14
+23
fedac/native/docker-build.sh
··· 569 569 SHA=$(sha256sum "$BUILD/vmlinuz" | awk '{print $1}') 570 570 571 571 # ══════════════════════════════════════════════ 572 + # Step 4b: Build slim kernel (no embedded initramfs) for Mac EFI boot 573 + # ══════════════════════════════════════════════ 574 + log "Step 4b: Building slim kernel for Mac..." 575 + sed -i 's|^CONFIG_INITRAMFS_SOURCE=.*|CONFIG_INITRAMFS_SOURCE=""|' .config 576 + rm -f usr/initramfs_data.o usr/.initramfs_data.o.cmd 577 + if run_make_with_heartbeat "$BUILD/kernel-slim.log" make -j"${KERNEL_JOBS}" bzImage; then 578 + cp arch/x86/boot/bzImage "$BUILD/vmlinuz-slim" 579 + cp arch/x86/boot/bzImage "$OUT/vmlinuz-slim" 2>/dev/null || true 580 + SLIM_SIZE=$(stat -c%s "$BUILD/vmlinuz-slim") 581 + log " Slim kernel: $((SLIM_SIZE / 1048576))MB" 582 + else 583 + err "Slim kernel build failed (non-fatal)" 584 + fi 585 + # Restore config for any subsequent builds 586 + sed -i 's|^CONFIG_INITRAMFS_SOURCE=.*|CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lz4"|' .config 587 + 588 + # Export initramfs as gzip (for systemd-boot on Mac) 589 + log " Packing initramfs.cpio.gz..." 590 + lz4 -d "$BUILD/initramfs.cpio.lz4" -c 2>/dev/null | gzip -c > "$BUILD/initramfs.cpio.gz" 591 + cp "$BUILD/initramfs.cpio.gz" "$OUT/initramfs.cpio.gz" 2>/dev/null || true 592 + log " initramfs.cpio.gz: $(($(stat -c%s "$BUILD/initramfs.cpio.gz") / 1048576))MB" 593 + 594 + # ══════════════════════════════════════════════ 572 595 # Step 5: Generate UEFI-bootable ISO 573 596 # ══════════════════════════════════════════════ 574 597 log "Step 5: Building ISO..."
+26 -14
fedac/native/scripts/flash-helper-runner.sh
··· 81 81 cp "${STAGED_ROOT}/EFI/BOOT/KERNEL.EFI" "${mountpoint}/EFI/BOOT/BOOTX64.EFI" 82 82 ;; 83 83 systemd-boot) 84 - # Use systemd-boot as BOOTX64.EFI with SLIM kernel + separate initramfs. 85 - # Mac EFI can't load a 270MB kernel. The slim kernel (~15MB) has no 86 - # embedded initramfs. systemd-boot loads both via linux + initrd. 84 + # Universal boot: splash.efi → systemd-boot → slim kernel + initramfs. 85 + # splash.efi shows "Aesthetic.Computer" on black, chains to LOADER.EFI. 86 + # Works on both Macs (can't load 270MB) and ThinkPads. 87 87 local sdboot="/usr/local/lib/systemd-bootx64.efi" 88 88 [ ! -f "${sdboot}" ] && sdboot="/repo/fedac/native/boot/systemd-bootx64.efi" 89 89 [ ! -f "${sdboot}" ] && sdboot="/workspaces/aesthetic-computer/fedac/native/boot/systemd-bootx64.efi" 90 - cp "${sdboot}" "${mountpoint}/EFI/BOOT/BOOTX64.EFI" 90 + # splash.efi as BOOTX64.EFI (shows splash, chains to LOADER.EFI) 91 + cp "${STAGED_ROOT}/EFI/BOOT/BOOTX64.EFI" "${mountpoint}/EFI/BOOT/BOOTX64.EFI" 92 + # systemd-boot as LOADER.EFI (loads slim kernel + initramfs) 93 + cp "${sdboot}" "${mountpoint}/EFI/BOOT/LOADER.EFI" 91 94 # Use slim kernel if available, fall back to full kernel 92 95 if [ -f "${STAGED_ROOT}/EFI/BOOT/KERNEL-SLIM.EFI" ]; then 93 96 cp "${STAGED_ROOT}/EFI/BOOT/KERNEL-SLIM.EFI" "${mountpoint}/EFI/BOOT/KERNEL.EFI" 94 97 else 95 98 cp "${STAGED_ROOT}/EFI/BOOT/KERNEL.EFI" "${mountpoint}/EFI/BOOT/KERNEL.EFI" 96 99 fi 97 - # Separate initramfs for systemd-boot to load 98 - if [ -f "${STAGED_ROOT}/initramfs.cpio.lz4" ]; then 100 + # Separate initramfs for systemd-boot to load (prefer gzip, fall back to lz4) 101 + if [ -f "${STAGED_ROOT}/initramfs.cpio.gz" ]; then 102 + cp "${STAGED_ROOT}/initramfs.cpio.gz" "${mountpoint}/initramfs.cpio.gz" 103 + elif [ -f "${STAGED_ROOT}/initramfs.cpio.lz4" ]; then 99 104 cp "${STAGED_ROOT}/initramfs.cpio.lz4" "${mountpoint}/initramfs.cpio.lz4" 100 105 fi 101 106 # systemd-boot loader config 102 107 mkdir -p "${mountpoint}/loader/entries" 103 108 printf 'default ac-native.conf\ntimeout 0\n' > "${mountpoint}/loader/loader.conf" 104 - cat > "${mountpoint}/loader/entries/ac-native.conf" << 'SDBOOT_EOF' 109 + local initrd_file="initramfs.cpio.gz" 110 + [ ! -f "${mountpoint}/initramfs.cpio.gz" ] && initrd_file="initramfs.cpio.lz4" 111 + cat > "${mountpoint}/loader/entries/ac-native.conf" << SDBOOT_EOF 105 112 title AC Native OS 106 113 linux /EFI/BOOT/KERNEL.EFI 107 - initrd /initramfs.cpio.lz4 114 + initrd /${initrd_file} 108 115 options console=tty0 quiet loglevel=3 vt.global_cursor_default=0 init=/init efi=noruntime 109 116 SDBOOT_EOF 110 117 ;; ··· 266 273 267 274 # Partition 1 (ACBOOT): config + kernel as KERNEL.EFI (for AC initramfs to find) 268 275 copy_boot_tree_to_vfat "${MAIN_PART}" /mnt/ac-main yes kernel-only 269 - # Partition 2 (ACEFI): systemd-boot (134KB) + KERNEL.EFI (270MB) 270 - # Mac EFI firmware can't LoadImage a 270MB PE/COFF. splash.efi also 271 - # uses LoadImage internally and fails the same way. systemd-boot uses 272 - # the EFI handover protocol to load the kernel directly into memory, 273 - # bypassing LoadImage entirely. 274 - copy_boot_tree_to_vfat "${EFI_PART}" /mnt/ac-efi no systemd-boot 276 + 277 + # Partition 2 (ACEFI): universal boot — splash → systemd-boot → slim kernel + initramfs 278 + # Works on both Macs (can't load 270MB EFI app) and ThinkPads. 279 + # If slim kernel isn't available, falls back to chainloader mode. 280 + if [ -f "${STAGED_ROOT}/EFI/BOOT/KERNEL-SLIM.EFI" ] && [ -f "${STAGED_ROOT}/initramfs.cpio.gz" ]; then 281 + log "Using universal boot: splash → systemd-boot → slim kernel + initramfs" 282 + copy_boot_tree_to_vfat "${EFI_PART}" /mnt/ac-efi no systemd-boot 283 + else 284 + log "No slim kernel — using chainloader mode (ThinkPad only)" 285 + copy_boot_tree_to_vfat "${EFI_PART}" /mnt/ac-efi no chainloader 286 + fi 275 287 populate_mac_partition "${MAC_PART}" /mnt/ac-mac 276 288 277 289 sync
+8 -4
fedac/native/scripts/media-layout.sh
··· 100 100 cp "${kernel_path}" "${stage_root}/EFI/BOOT/KERNEL.EFI" 101 101 cp "${config_path}" "${stage_root}/config.json" 102 102 103 - # Stage slim kernel + initramfs for Mac boot (systemd-boot mode) 103 + # Stage slim kernel + initramfs for universal boot (systemd-boot mode) 104 104 local kernel_dir 105 105 kernel_dir="$(dirname "${kernel_path}")" 106 106 local slim="${kernel_dir}/vmlinuz-slim" 107 - local initramfs="${kernel_dir}/initramfs.cpio.lz4" 108 107 if [ -f "${slim}" ]; then 109 108 cp "${slim}" "${stage_root}/EFI/BOOT/KERNEL-SLIM.EFI" 110 109 fi 111 - if [ -f "${initramfs}" ]; then 112 - cp "${initramfs}" "${stage_root}/initramfs.cpio.lz4" 110 + # Prefer gzip initramfs (universal), fall back to lz4 111 + local initramfs_gz="${kernel_dir}/initramfs.cpio.gz" 112 + local initramfs_lz4="${kernel_dir}/initramfs.cpio.lz4" 113 + if [ -f "${initramfs_gz}" ]; then 114 + cp "${initramfs_gz}" "${stage_root}/initramfs.cpio.gz" 115 + elif [ -f "${initramfs_lz4}" ]; then 116 + cp "${initramfs_lz4}" "${stage_root}/initramfs.cpio.lz4" 113 117 fi 114 118 } 115 119