qemu: build the panel's own BusyBox for the rig (flare-edge#2210) #37

Merged
noah merged 1 commits from rb/ln-rig-busybox into rebuild 2026-10-29 08:46:18 -06:00
Owner

Refs flare-edge#2210 (the rig BusyBox half; the option guard and the init-chain boot are done in flare-edge #2222, SDK #32 and flare-edge #2230).

Why

The rig runs busybox.net's 1.31.0 defconfig-multiarch-musl binary. The panel runs BusyBox 1.37.0 with the image's own applet set and options. A script that calls an applet or option the panel lacks passes in the rig and fails on a panel: #1903 (setpriv --reuid), #2002 (stat), #1349 (flock -w).

What

  • qemu/busybox/panel.config: the image's BusyBox config. The full base used to live only in the vendor tree. It is rebuilt from Buildroot 2025.02.8 package/busybox/busybox.config, whose header matches the a/ side of 0001-busybox-applets.patch exactly. The patch is applied, then yes "" | make oldconfig runs in 1.37.0, as Buildroot does.
  • qemu/busybox/patches/: Buildroot 2025.02.8's 11 busybox patches, applied like the image build. 0007 is what lets tc build with current kernel headers.
  • qemu/busybox/rig.fragment: the only differences for the rig are STATIC, USE_BB_PWD_GRP and USE_BB_SHADOW (static glibc has no NSS). The test refuses any other symbol.
  • qemu/busybox/applets.txt, help.txt: the bench a capture (image 417a66b), the same files as the flare-edge fixtures.
  • qemu/build-busybox.sh: uses the pinned 1.37.0 source (sha256 as in Buildroot's hash file). The build fails if Kconfig rewrites any setting, if the applet list differs from the panel's, or if the binary is dynamic or not ARM. The output is cached by an input key: tarball, these files and the compiler version.
  • qemu/lib.sh: RIG_BUSYBOX=panel selects that binary. The default stays multiarch, so no existing run changes. An unknown value, or BUSYBOX together with panel, is refused. The bounded verified download is factored out as qemu_fetch_verified, and its existing test passes unchanged.
  • The panel has no cttyhack. warden.shell now calls warden_console_shell, which uses cttyhack where it exists. Without it, the helper runs setsid -c sh on the console tty from /sys/class/tty/console/active, or a plain sh if there is no tty.
  • CI qemu-tools: the offline tests, then a build checked against every applet's --help through qemu-user, then a panel initramfs. kernel-build (dispatch only) runs a second boot smoke with the panel initramfs.

The rig's other in-guest uses of applets the panel lacks are all in comments. I checked by grepping every multiarch-only applet name in rootfs/.

Gate on bfe-mpc-0056

Run through lane-remote; shellcheck ran on the workstation.

$ OUT=~/.cache/lane-LN/bbout bash qemu/build-busybox.sh
== busybox 1.37.0 source sha256 verified
== building busybox 1.37.0 (panel config, static, arm-linux-gnueabihf-gcc, -j4)
== panel busybox: .../busybox-armv7l-panel (6d949435...)
$ bash qemu/tests/busybox-panel-help.sh ~/.cache/lane-LN/bbout/busybox-armv7l-panel
busybox-panel-help: 282 applets, list and --help equal to the panel's
$ OUT=~/.cache/lane-LN/bbout RIG_BUSYBOX=panel bash qemu/mkinitramfs.sh
== panel busybox up to date (.../busybox-armv7l-panel)
== initramfs: .../initramfs.cpio.gz (816K)
qemu/tests/busybox-panel-test.sh      busybox-panel: all checks passed
qemu/tests/console-shell-test.sh      console-shell: all checks passed (also under the panel busybox sh)
qemu/tests/busybox-fetch.sh           busybox fetch tests passed
tests/mk-bootimg/run-ci-wiring-tests.sh  rc=0
qemu/tests/init-chain-test.sh         init-chain: all checks passed
qemu/tests/init-power-signals-test.sh rc=0 (2/2; base also 2/2)
qemu/tests/stage-rootfs-perms.sh      ALL STAGE-ROOTFS PERM TESTS PASSED
qemu/tests/rootfs-overlay.sh          rootfs-overlay: all scenarios passed
init-chain, init-rig-bus, ctl-bridge tests under WARDEN_TEST_SH="<panel busybox> sh": all pass
shellcheck -x (qemu-tools file set): clean

Mutants, each caught: setsid without -c; the applet check disabled; panel.config dropping a patched setting (CONFIG_TC); the fragment adding an applet (TIMEOUT); an extra RIG_BUSYBOX value; the fragment appended without replacing.

Not proven here: a VM boot with the panel initramfs (0056 has no qemu-system-arm). The kernel-build boot smoke step covers it on the next dispatch. Follow-up in flare-edge: pin this SDK, then switch the QEMU jobs to RIG_BUSYBOX=panel after a QEMU-profile run.

Generated with Claude Code
https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG

Refs flare-edge#2210 (the rig BusyBox half; the option guard and the init-chain boot are done in flare-edge #2222, SDK #32 and flare-edge #2230). ## Why The rig runs busybox.net's 1.31.0 `defconfig-multiarch-musl` binary. The panel runs BusyBox 1.37.0 with the image's own applet set and options. A script that calls an applet or option the panel lacks passes in the rig and fails on a panel: #1903 (`setpriv --reuid`), #2002 (`stat`), #1349 (`flock -w`). ## What - `qemu/busybox/panel.config`: the image's BusyBox config. The full base used to live only in the vendor tree. It is rebuilt from Buildroot 2025.02.8 `package/busybox/busybox.config`, whose header matches the `a/` side of `0001-busybox-applets.patch` exactly. The patch is applied, then `yes "" | make oldconfig` runs in 1.37.0, as Buildroot does. - `qemu/busybox/patches/`: Buildroot 2025.02.8's 11 busybox patches, applied like the image build. 0007 is what lets `tc` build with current kernel headers. - `qemu/busybox/rig.fragment`: the only differences for the rig are `STATIC`, `USE_BB_PWD_GRP` and `USE_BB_SHADOW` (static glibc has no NSS). The test refuses any other symbol. - `qemu/busybox/applets.txt`, `help.txt`: the bench a capture (image 417a66b), the same files as the flare-edge fixtures. - `qemu/build-busybox.sh`: uses the pinned 1.37.0 source (sha256 as in Buildroot's hash file). The build fails if Kconfig rewrites any setting, if the applet list differs from the panel's, or if the binary is dynamic or not ARM. The output is cached by an input key: tarball, these files and the compiler version. - `qemu/lib.sh`: `RIG_BUSYBOX=panel` selects that binary. The default stays `multiarch`, so no existing run changes. An unknown value, or `BUSYBOX` together with `panel`, is refused. The bounded verified download is factored out as `qemu_fetch_verified`, and its existing test passes unchanged. - The panel has no `cttyhack`. warden.shell now calls `warden_console_shell`, which uses cttyhack where it exists. Without it, the helper runs `setsid -c sh` on the console tty from `/sys/class/tty/console/active`, or a plain sh if there is no tty. - CI qemu-tools: the offline tests, then a build checked against every applet's `--help` through qemu-user, then a panel initramfs. kernel-build (dispatch only) runs a second boot smoke with the panel initramfs. The rig's other in-guest uses of applets the panel lacks are all in comments. I checked by grepping every multiarch-only applet name in rootfs/. ## Gate on bfe-mpc-0056 Run through lane-remote; shellcheck ran on the workstation. ``` $ OUT=~/.cache/lane-LN/bbout bash qemu/build-busybox.sh == busybox 1.37.0 source sha256 verified == building busybox 1.37.0 (panel config, static, arm-linux-gnueabihf-gcc, -j4) == panel busybox: .../busybox-armv7l-panel (6d949435...) $ bash qemu/tests/busybox-panel-help.sh ~/.cache/lane-LN/bbout/busybox-armv7l-panel busybox-panel-help: 282 applets, list and --help equal to the panel's $ OUT=~/.cache/lane-LN/bbout RIG_BUSYBOX=panel bash qemu/mkinitramfs.sh == panel busybox up to date (.../busybox-armv7l-panel) == initramfs: .../initramfs.cpio.gz (816K) qemu/tests/busybox-panel-test.sh busybox-panel: all checks passed qemu/tests/console-shell-test.sh console-shell: all checks passed (also under the panel busybox sh) qemu/tests/busybox-fetch.sh busybox fetch tests passed tests/mk-bootimg/run-ci-wiring-tests.sh rc=0 qemu/tests/init-chain-test.sh init-chain: all checks passed qemu/tests/init-power-signals-test.sh rc=0 (2/2; base also 2/2) qemu/tests/stage-rootfs-perms.sh ALL STAGE-ROOTFS PERM TESTS PASSED qemu/tests/rootfs-overlay.sh rootfs-overlay: all scenarios passed init-chain, init-rig-bus, ctl-bridge tests under WARDEN_TEST_SH="<panel busybox> sh": all pass shellcheck -x (qemu-tools file set): clean ``` Mutants, each caught: setsid without -c; the applet check disabled; panel.config dropping a patched setting (CONFIG_TC); the fragment adding an applet (TIMEOUT); an extra RIG_BUSYBOX value; the fragment appended without replacing. Not proven here: a VM boot with the panel initramfs (0056 has no qemu-system-arm). The kernel-build boot smoke step covers it on the next dispatch. Follow-up in flare-edge: pin this SDK, then switch the QEMU jobs to `RIG_BUSYBOX=panel` after a QEMU-profile run. Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
noah added 1 commit 2026-10-29 07:36:57 -06:00
qemu: build the panel's own BusyBox for the rig (flare-edge#2210)
ci / quality (push) Successful in 2m25s
ci / badges (push) Skipped
ci / mcdc (push) Successful in 29s
ci / prune-artifacts (push) Skipped
ci / test (push) Successful in 13s
ci / bench (push) Successful in 10s
ci / patches-apply (push) Successful in 24s
ci / kernel-build (push) Skipped
ci / mcdc (pull_request) Successful in 21s
ci / bench (pull_request) Successful in 17s
ci / test (pull_request) Successful in 14s
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / qemu-tools (push) Successful in 4m32s
ci / kernel-symbols (push) Successful in 4m28s
ci / patches-apply (pull_request) Successful in 57s
ci / qemu-tools (pull_request) Successful in 3m8s
ci / kernel-symbols (pull_request) Successful in 6m42s
ci / quality (pull_request) Successful in 2m19s
ci / badges (pull_request) Skipped
37037926df
The rig runs busybox.net's 1.31.0 multiarch binary, not the image's 1.37.0
with its applet config, so a script calling an applet or option the panel
lacks (#1903 setpriv --reuid, #2002 stat, #1349 flock -w) passes in the rig
and breaks on a panel.

- qemu/busybox/panel.config: the image's config, rebuilt from Buildroot
  2025.02.8 busybox.config plus 0001-busybox-applets.patch, resolved for
  1.37.0 as Buildroot does. patches/: Buildroot's 11 busybox patches.
  rig.fragment: static link and BusyBox's own passwd readers only.
  applets.txt and help.txt: the bench a capture (image 417a66b).
- qemu/build-busybox.sh: pinned 1.37.0 source, fails on any Kconfig rewrite
  of the config, an applet list other than the panel's, or a dynamic binary.
- qemu/lib.sh: RIG_BUSYBOX=panel selects it (default stays multiarch);
  the bounded verified download is now qemu_fetch_verified.
- warden.shell uses warden_console_shell: cttyhack where it exists, else
  setsid -c on the console tty (the panel's BusyBox has no cttyhack).
- CI: offline tests in qemu-tools, a build there checked against every
  applet's --help from the panel through qemu-user, and a second boot smoke
  with the panel initramfs in kernel-build.

Refs flare-edge#2210

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
noah merged commit 0c98a6018f into rebuild 2026-10-29 08:46:18 -06:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blueflare/bfe-core1106-sdk#37