diff --git a/qemu/lib.sh b/qemu/lib.sh index 4ca3798..cff57f2 100644 --- a/qemu/lib.sh +++ b/qemu/lib.sh @@ -100,10 +100,10 @@ qemu_get_busybox() { local want got want="$(qemu_busybox_panel_inputs)" got="$(cat "$BUSYBOX.inputs" 2>/dev/null || true)" - [ -f "$BUSYBOX" ] && [ "$got" = "$want" ] || { + if [ ! -f "$BUSYBOX" ] || [ "$got" != "$want" ]; then echo "FATAL: BUSYBOX=$BUSYBOX is not a panel BusyBox built from this tree's qemu/busybox/ ($BUSYBOX.inputs '${got:-missing}', want '$want'): run qemu/build-busybox.sh" >&2 exit 1 - } + fi BB="$BUSYBOX" qemu_log "panel busybox: prebuilt $BB (inputs $want)" return diff --git a/qemu/tests/busybox-panel-test.sh b/qemu/tests/busybox-panel-test.sh index fcc737e..d52c1fd 100644 --- a/qemu/tests/busybox-panel-test.sh +++ b/qemu/tests/busybox-panel-test.sh @@ -149,7 +149,8 @@ mkdir -p "$SCRATCH/qcopy" cp -a "$QEMU_DIR/busybox" "$SCRATCH/qcopy/" printf '# CONFIG_TIMEOUT is not set\n' >> "$SCRATCH/qcopy/busybox/panel.config" other="$(QEMU_DIR="$SCRATCH/qcopy" qemu_busybox_panel_inputs)" -printf 'x\n' >> "$SCRATCH/qcopy/busybox/patches/$(ls "$QEMU_DIR/busybox/patches" | head -n 1)" +first_patch="$(find "$SCRATCH/qcopy/busybox/patches" -maxdepth 1 -type f -name '*.patch' | sort | head -n 1)" +printf 'x\n' >> "$first_patch" other2="$(QEMU_DIR="$SCRATCH/qcopy" qemu_busybox_panel_inputs)" if [ "$other" != "$inputs" ] && [ "$other2" != "$other" ]; then pass "a panel.config or patch edit changes qemu_busybox_panel_inputs"