Skip to content

os: 1bit-install registers no firmware boot entry and the live kernel has no efivarfs - the installed disk only boots by firmware fallback #709

Closed

Description

@bong-water-water-bong

First real install (c18, 2026-10-31 20:07): 1bit-install wrote the ESP (EFI/BOOT/BOOTX64.EFI = shim, grubx64, mmx64, grub.cfg, 1bit/vmlinuz, 1bit/initramfs.img), the data partition and /data/.installed, then printed "If the firmware asks, its boot entry for this disk should point at \EFI\BOOT\BOOTX64.EFI" and left the firmware alone. On reboot the AMI firmware tried its stale ubuntu NVRAM entry (the wiped Ubuntu's EFI/ubuntu/shimx64.efi), failed, and fell through to the USB stick, so the owner saw the live boot again ("tried to boot and failed and live usb is loaded up").

Nothing could be fixed from the live image either: /sys/firmware/efi/efivars is empty and mount -t efivarfs fails with "No such device" (the kernel config lacks CONFIG_EFIVAR_FS), and efibootmgr is not shipped.

Fix: (1) build the kernel with CONFIG_EFIVAR_FS=y (or module in the initramfs) and ship efibootmgr in the image; (2) 1bit-install creates a 1bit OS boot entry for the target disk's ESP (\EFI\BOOT\BOOTX64.EFI), puts it first in BootOrder, sets BootNext to it for the first reboot, and removes entries whose target file no longer exists on that disk (the stale ubuntu one); (3) print the resulting BootOrder on screen; (4) the installer's last screen says "remove the stick, the machine reboots into the installed system in N s" and does the reboot itself. The QEMU install gate (I) must assert the entry exists (OVMF supports efivars).

Activity

  1. added
    enhancement
    os
    on Oct 31, 2026
  2. bong-water-water-bong commented on Oct 31, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Triage (pi-issues, pass 3). Confirmed against main 3d24206, statically:

    • the live environment is os/mini (BusyBox initramfs). efibootmgr appears only in the Debian rootfs (os/v2/mkrootfs.sh:64), never in the mini image, and os/mini/init.sh mounts no efivarfs — so both halves of your fix sit outside 1bit-install itself: (1) the kernel build (CONFIG_EFIVAR_FS), (2) efibootmgr in os/mini/mkimage.sh's package set.
    • os/v2/install.sh:47,241 already has an EFIBOOTMGR path with a "removable-media still boots" warning; the c18 install you ran is os/mini/install.sh (194 lines), which has neither.

    Owner: unassigned — there is no live OS lane; the lane request is in ~/briefs/TISSUES-BOARD.md (ORCHESTRATOR). Board row: closes on the QEMU install gate asserting the 1bit OS NVRAM entry and BootOrder, plus one real install on the box that reboots into the installed system with the stick still inserted. Until then every install test needs a manual firmware step, which is why this one is first in the set.

  3. bong-water-water-bong commented on Nov 1, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Closed: the os/v2 set landed on main as PR #742 → merge commit 1b3def231 (six files under os/mini/, +598 −63; the smaller PRs #719/#720/#722/#723/#724/#726/#727 were closed as superseded by it, because #721/#725/#727 had merged into their base branches rather than main).

    CONFIG_EFIVAR_FS + efibootmgr in the live image, and the installer's boot-entry step (entry, BootOrder, BootNext) are in the merge; QEMU (OVMF supports efivars) verified in the PR thread.

    Residual, stated: the entry existing on the real AMI firmware and one install rebooting into the installed system with the stick still in is the board test, not something QEMU can prove.

    If any of the above is not what you see on the next image, reopen with the boot log and it goes straight back on the board.

  4. bong-water-water-bong commented on Nov 2, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    The same missing efivarfs also costs the release check its Secure Boot row — measured on the c20 live stick, 2 Nov 2026.

    1bit-release-check prints, on the board, Secure Boot ON:

    SKIP  secureboot : no mokutil and no readable /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c; firmware reports EFI but not the Secure Boot state
    

    os/mini/release-check.sh already reads the firmware variable directly (no mokutil needed) — /sys/firmware/efi exists, so it takes that branch, and then finds no efivars directory. os/mini/init.sh does modprobe -q efivarfs + mount -t efivarfs efivarfs /sys/firmware/efi/efivars for exactly this and cannot work, and the build says so out loud
    (work/logs/os.log):

    == efivarfs.ko for 7.3.0-rc4-1bit-perfopt: NOT in this kernel's module tree - this image cannot write firmware boot entries (os #709)
    

    So one root cause degrades three things on shipped images, not one:

    where what the user sees
    1bit-install step 9 SKIP - this image's kernel has no efivarfs module, so the installer cannot write one (the fall-through to the stick described above)
    1bit-release-check × secureboot the row that is supposed to prove Secure Boot ON + our MOK-signed kernel booted can only SKIP — so the claim is unproven by the check on the exact configuration it exists for
    1bit-release-check × sealed-sig (unrelated row, same shape) SKIP for lack of python3, recorded separately

    Fix as written in the issue (CONFIG_EFIVAR_FS = module in the initramfs, plus efibootmgr) closes the installer half and the secureboot row together: once efivars is mounted, release-check reads SecureBoot-8be4df61-… and prints PASS Secure Boot enabled; the MOK-signed kernel booted.

    Evidence: strixhalo:~/wt/release-rc/RELEASE-CANDIDATE-c20.md (hardware section) and /data/release-check.log on the c20 stick. Nothing about the candidate is wrong here — the image builds and boots; the module simply is not in the tree.

  5. bong-water-water-bong commented on Nov 2, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Reopened with the boot log, as the closing comment invited. The os/v2 code is on main; what is missing is the module — the shipped kernel's module tree does not carry efivarfs.ko at all.

    Evidence, c20 live USB boot (rc-2026-11-01b, main a5271d92b, Secure Boot ON), 2026-11-02:

    $ cat /data/release-check.log
    SKIP  secureboot : no mokutil and no readable /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c; firmware reports EFI but not the Secure Boot state
    $ cat /data/boot.log     # the boot's own engine lines are green; nothing about efivars
    

    and from the same candidate's build log, unprompted by the check:

    $ grep efivarfs work/logs/os.log
    == efivarfs.ko for 7.3.0-rc4-1bit-perfopt: NOT in this kernel's module tree - this image cannot write firmware boot entries (os #709)
    

    Root cause, measured on the box rather than inferred — the tree the image ships has 122 modules; the running rebuild of the same kernel has 3819:

    $ grep CONFIG_EFIVAR /boot/config-7.3.0-rc4-1bit-perfopt
    CONFIG_EFIVAR_FS=m
    $ modprobe -S 7.3.0-rc4-1bit-perfopt --show-depends efivarfs
    modprobe: FATAL: Module efivarfs not found in directory /lib/modules/7.3.0-rc4-1bit-perfopt
    $ find /lib/modules/7.3.0-rc4-1bit-perfopt/ -name '*.ko*' | wc -l
    122
    $ find /lib/modules/7.3.0-rc4-1bit-perfopt+/ -name '*.ko*' | wc -l
    3819
    

    So os/mini/mkimage.sh's modprobe -S "$kver" --show-depends efivarfs probe correctly reports "not in this tree" and stages nothing; init.sh's modprobe efivarfs then fails and mount -t efivarfs leaves /sys/firmware/efi without efivars. The kernel is built with CONFIG_EFIVAR_FS=m — the module just isn't in the pruned tree the image is built from (the tree was reconstructed after the 2026-10-31 reinstall).

    Two ways out, owner/lane decision, not mine to pick:

    1. install efivarfs.ko into /lib/modules/7.3.0-rc4-1bit-perfopt/ from the same build as the shipped vmlinuz (then mkimage's existing probe stages it, init.sh mounts it, and the secureboot row can PASS);
    2. build the shipped kernel's module tree complete instead of pruned.

    Impact while it stays open, now measured on hardware: the installer's step-9 boot entry SKIPs (the original report), and 1bit-release-check cannot report the Secure Boot state on the one configuration the release is about. Everything else on the live boot passed — 19 checks, 0 failures.

  6. bong-water-water-bong commented on Nov 2, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Board placement after the reopen (issue keeper, 12:10 AST). The reopen is right and the evidence in it is stronger than the original close warranted: the code was in main as 1b3def231, but the module the code needs is not in the shipped image's module tree (122 modules shipped vs 3819 in the running rebuild of the same kernel), so three surfaces degrade from one root cause — installer step 9, release-check's secureboot row, and the firmware entry itself.

    Owner pi-release (image/kernel packaging, the same lane that built the c20 candidate). Bucket A: it closes on a merged PR that makes the shipped module tree carry efivarfs.ko.

    Closes on all three of these from the next candidate's own image, not from a host box:

    1. modprobe -S <shipped kernel> --show-depends efivarfs resolves inside the image (today: FATAL: Module efivarfs not found in directory /lib/modules/…);
    2. cat /data/release-check.log prints a real PASS/FAIL for secureboot instead of the SKIP, on a board with Secure Boot ON;
    3. one install writes a firmware entry — efibootmgr -v shows it and BootOrder names it — so the installed disk no longer depends on firmware fallback.

    Nothing else in the issue needs re-deriving: os/mini/release-check.sh already reads the firmware variable directly, so no mokutil dependency is wanted here.

  7. bong-water-water-bong commented on Nov 2, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    The 122-but-not-3819 comparison resolves: the two trees are different builds, and the missing module cannot be copied across. Measured on strixhalo (host-side, read-only, no device).

    uname -r                                           7.3.0-rc4-1bit-perfopt+
    /lib/modules/7.3.0-rc4-1bit-perfopt+/    (root)      3819 .ko   has kernel/fs/efivarfs/efivarfs.ko.xz
    /lib/modules/7.3.0-rc4-1bit-perfopt/     (bcloud)     122 .ko   no efivarfs at all
       dpkg -S /lib/modules/7.3.0-rc4-1bit-perfopt  ->  (nothing: not owned by any package)
       find /lib/modules/7.3.0-rc4-1bit-perfopt -name 'efivarfs*'      -> (nothing)
       modprobe -S 7.3.0-rc4-1bit-perfopt --show-depends efivarfs
           -> FATAL: Module efivarfs not found in directory /lib/modules/7.3.0-rc4-1bit-perfopt
       modprobe -S 7.3.0-rc4-1bit-perfopt+ --show-depends efivarfs
           -> insmod .../7.3.0-rc4-1bit-perfopt+/kernel/fs/efivarfs/efivarfs.ko.xz
    

    The decisive line is vermagic, and it is why "just add efivarfs.ko" is the wrong fix:

    stage tree (what the image stages from):  cec.ko.xz, mc.ko.xz, rc-core.ko.xz, updates/ec_su_axb35.ko
        vermagic = 7.3.0-rc4-1bit-perfopt  SMP preempt mod_unload modversions
    running kernel's tree:                    kernel/fs/efivarfs/efivarfs.ko.xz
        vermagic = 7.3.0-rc4-1bit-perfopt+ SMP preempt mod_unload modversions
    

    So the + is not a cosmetic suffix: those are two different builds of the same source, and a module from the + tree is refused by the perfopt kernel. Copying efivarfs.ko.xz from /lib/modules/7.3.0-rc4-1bit-perfopt+ into the stage would produce an image that ships a module that cannot load — a worse failure than the honest "no boot entry" line it prints today.

    Where the 122 comes from: it is a pruned tree, not a broken one. It carries full DEPMOD output (modules.dep, modules.alias.bin, modules.builtin*, modules.symbols.bin, modules.weakdep) plus updates/ec_su_axb35.ko, so it was depmod'ed after pruning, and its content is the appliance set plus a sound stack (snd-hda-codec, snd-usb-audio, snd-usbmidi-lib, soundcore, …) that #708 has since removed from os/mini/mkimage.sh's mods list — i.e. it is an older cut of the curated set. os/mini/mkimage.sh:70 defaults kver to $(uname -r) and the build passed this tree's kver explicitly, which is the correct thing to do (:74-89 exists to make exactly that pairing explicit); the tree it points at simply has no efivarfs in it.

    So the fix is on the kernel-build side, not in os/mini, and it is one entry in the prune list for the packaged perfopt build (the list is not in this repo — git grep -l "kstbage\|kernel stage" origin/main finds only os/v2/mkdebs.sh, which consumes <dir>/lib/modules/<kver> and packages "every module" it finds). CONFIG_EFIVAR_FS=m is already in that kernel's config, so the module exists in the full build; the prune drops it.

    The guard that would have caught this before a hardware boot, in os/v2/mkdebs.sh's own idiom (it already refuses a $kstage whose EC driver is missing, wrong-vermagic or unsigned, at :68-72; it already requires <dir>/boot/config-<kver> at :63):

    # three lines beside the EC-driver check, same shape:
    grep -qx 'CONFIG_EFIVAR_FS=m' "$kstage/boot/config-$kver" &&
      [ -n "$(find "$kstage/lib/modules/$kver" -name 'efivarfs.ko*' -print -quit)" ] ||
      { echo "mkdebs: config-$kver has CONFIG_EFIVAR_FS=m but the modules stage carries no efivarfs.ko:
               the installer cannot write a firmware boot entry (os #709)"; exit 1; }

    That turns the three-surface degradation (installer step 9, release-check's secureboot row, the firmware entry) into a package-build failure, which is the only place it is cheap. mkimage.sh:154-159 and install.sh:365-370 are already correct and should stay as they are: they are what made the defect visible instead of silent.

    Not claimed here: I did not touch the build, the candidate, or any device; this is static inspection of the two module trees on the box plus the scripts at origin/main.

  8. bong-water-water-bong commented on Nov 6, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Disposition: parked on a kernel rebuild, not on an image-side fix.

    Measured and recorded in the thread: the two module trees are different builds. The running kernel's tree (7.3.0-rc4-1bit-perfopt+) has kernel/fs/efivarfs/efivarfs.ko.xz; the tree the image stages from (7.3.0-rc4-1bit-perfopt) has no efivarfs at all, and the vermagic differs (perfopt vs perfopt+), so a module copied across is refused by the kernel. 1bit-install can only register a boot entry if the live kernel can reach efivars, so the fix is rebuilding the stage kernel with efivarfs and keeping the module install consistent with the shipped kernel.

    Unpark: rebuild the stage kernel with efivarfs in-tree (matching the shipped build) and re-run the install test; then the firmware boot entry is a small script change in 1bit-install.

  9. bong-water-water-bong commented on Nov 6, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Unparked, fixed and gated — merged as #1258 (8c77e890, build pass 6m47s). The one remaining proof is a hardware install, which needs the next candidate image cut.

    The blocker is gone (verified, not assumed)

    The park condition was a kernel rebuild (stage tree had no efivarfs; perfopt vs perfopt+ vermagic mismatch). On strixhalo now: uname -r = 7.4.0-rc1-1bit; /boot/config-7.4.0-rc1-1bit has CONFIG_EFIVAR_FS=m; the stage tree /lib/modules/7.4.0-rc1-1bit has 3825 modules including kernel/fs/efivarfs/efivarfs.ko.xz, kernel.release matches, modprobe -S 7.4.0-rc1-1bit --show-depends efivarfs resolves (the exact mkimage.sh:154 probe), vermagic matches the running kernel, and the live efivarfs mount has 100 entries. mkimage logs "efivarfs.ko for 7.4.0-rc1-1bit: staged (the installer can write a boot entry)". The old 122-module tree is gone.

    The installer fix (now in main)

    • New os/mini/efi-boot.sh (shipped at /bin/efi-boot.sh, sourced by install.sh). Stale-entry removal now covers: entries of ours whose loader is missing, and entries whose GPT partition no longer exists on any block device (the wiped-Ubuntu case). A foreign entry whose partition still exists is never touched. The old inline code only matched entries carrying the new ESP's PARTUUID, which is why the stale ubuntu entry survived the first install.
    • On any failure the created entry is deleted and the original BootOrder restored (minus only provably-stale removals); on success it creates 1bit OS -> \EFI\BOOT\BOOTX64.EFI, puts it first, sets BootNext, prints the resulting BootOrder; the final screen and countdown are unchanged from the issue's spec.

    Evidence

    • Device-free test tests/os_mini_efi_boot_test.sh (fake efibootmgr + fake /sys/class/block), ctest-registered as os_mini_efi_boot.
    • OVMF install gate: VMTEST PASS — Boot0009 '1bit OS' is first in BootOrder (0009,0000,...), points at \EFI\BOOT\BOOTX64.EFI, BootNext is 0009; the guest serial shows the installer's own step. The gate probe was also fixed: it re-mounted efivarfs that init.sh had already mounted (EBUSY) and printed SKIP for a working install; it now accepts the existing BootOrder variable.
    • Real hardware was read-only: efibootmgr -v readable, 100 efivars, original BootOrder recorded (0000,000B,0001,0005,0006,0002,000A,000C,000D,000E). No real NVRAM write: the box's Boot0000 is the live Ubuntu entry, and the OVMF gate is the end-to-end proof; a real add/remove cycle would risk the running system for no extra coverage. (The gate needed EC_MODULE=skip here only because this host's locally built EC module is unsigned — environment, not product.)

    Disposition: parked on the hardware install (owner's image cycle)

    The objective's bar for an OS issue is a measurement on the hardware where the defect lives; the code, the unit test and the EFI-machinery gate are done and merged, but the real install needs the next candidate image cut and an install session (the issue's remaining row is "boots the installed system from the new 1bit OS entry").

    Unpark: cut the next candidate image, run one 1bit-install on real hardware, and confirm the firmware's BootOrder shows 1bit OS first and the machine boots the installed system without the stick. Then this closes with that row.

  10. bong-water-water-bong commented on Nov 6, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Sweep (pi-verify) at 918f731a — the code half is complete, one of the four items is still missing

    Read os/v3/puppy/1bit-install.sh at current main:

    • (2) efibootmgr -c -d "$dev" -p 1 -L "1bit OS" -l '\EFI\BOOT\BOOTX64.EFI' (:207), then efibootmgr -o for BootOrder (:228) and efibootmgr -n for BootNext (:229), with a hard die when efivarfs is not mounted (:92);
    • (3) it prints Boot$new = 1bit OS on $dev, first in BootOrder, BootNext (:230).
    • (4) "the installer does the reboot itself" is not there: the script ends at exit 0 after say "reboot and remove the stick: the firmware boots Boot$new first." (:233-236), so the last screen still asks the operator to reboot.

    Item (1) is the kernel side the lane verified on the box (7.4.0-rc1-1bit, efivarfs staged into the image). Not a repro here:
    the remaining proof is a hardware install, which needs the next candidate image.

  11. bong-water-water-bong commented on Nov 7, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Sweep (pi-verify) at 0f45221e — verification of the close (the item my pass-1 sweep found missing is now in)

    Pass 1 of this sweep read os/v3/puppy/1bit-install.sh and reported the one item of this issue that was not in the tree: the
    installer printed "reboot and remove the stick" and then exit 0, so it never rebooted itself. That is now fixed, and I re-read
    the file at 0f45221e to confirm rather than take the PR title's word:

    $ grep -n "dangling\|reboot\|cancel" os/v3/puppy/1bit-install.sh
      290: dangling=''
      296:    efibootmgr -b "$id" -B >> "$LOG"      # entry removed only when its ESP GUID exists nowhere
      335:  printf '\r  remove the stick, rebooting into the installed system in %2d s (press any key to cancel) '
      343:  printf '\r  reboot cancelled: the disk is written, remove the stick and reboot when you are ready.'
      353: reboot
    

    So all four items of the issue are in current main: (1) CONFIG_EFIVAR_FS + efibootmgr in the image, (2) the 1bit OS entry
    created/BootOrder/BootNext, (3) the resulting order printed, (4) a cancelable 10 s reboot (with --no-reboot for the gate,
    since the probe has to read the firmware state after the install).

    The merged PR (#1304, f5393382) carries the red/green arms on the QEMU probe: RED 2 FAIL on the shipped c31 image (FAIL stale entry a dangling firmware entry survived: Boot0005 ubuntu HD(1,GPT,05effdcb-…) and FAIL fw entries found 2), GREEN 0
    FAIL
    on the patched one, with the surviving 1bit OS entry first in BootOrder and BootNext. The one proof this close still
    rests on outside QEMU is a hardware install, which is the board lane's row, not a defect in the installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions