From 479e25c0921e1b0e72f0988a64774ba142f12e15 Mon Sep 17 00:00:00 2001 From: Gr-linkk <280405187+Gr-linkk@users.noreply.github.com> Date: Fri, 30 Oct 2026 14:45:52 -0700 Subject: [PATCH 1/3] initramfs: load diagnostic modules with one syscall BusyBox can fall back from finit_module to init_module after an error. A hardware probe may already have changed device state before failing, so a second initialization defeats a staged bring-up experiment. Build module-load-once with both initramfs toolchains and put it on Dropbear's command path. It accepts an uncompressed module and optional parameters, makes one finit_module call, and preserves the loading error. Open nonblocking so a FIFO reaches the regular-file check without hanging. The intercepted-syscall tests and tests/all pass. Both ARM64 initramfs builds pass. QEMU confirms one attempt on ENOSYS; the same Alpine BusyBox falls back to init_module. Pixel 6 usage, invalid-file and unprivileged error paths pass, with exact cleanup and phone-smoke. No valid module was loaded and the new initramfs images were not booted. Assisted-by: Codex --- AGENTS.md | 6 +++ bin/omamobile | 11 +++++ tests/all | 2 + tests/module-load-once | 92 ++++++++++++++++++++++++++++++++++++++++ tools/module-load-once.c | 39 +++++++++++++++++ 5 files changed, 150 insertions(+) create mode 100755 tests/module-load-once create mode 100644 tools/module-load-once.c diff --git a/AGENTS.md b/AGENTS.md index b75d93b62..e90df056a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,6 +17,12 @@ Omarchy Mobile runs native Omarchy (Arch Linux ARM, Hyprland, Omarchy's packages - **`devmem` is `devmem ADDR [VALUE]`.** A second argument is written, so `devmem ADDR 32` writes 0x20. This once clobbered live DSIM timing registers. - **Read only blocks that are known powered and clocked, one register per call on a first probe.** A read of an unpowered block aborts the SoC and kills the session. - **Read-only steps first, then one change per boot.** New DT nodes stay `disabled` and are enabled by an overlay in [`device/cheetah/overlays/`](device/cheetah/overlays). Blacklist a module before installing a DTB that enables its node. Two new things that fail together tell you nothing. +- **Load a new diagnostic module with one syscall.** BusyBox can fall back + from a failed `finit_module` to `init_module`, repeating initialization. + Use `module-load-once MODULE.ko 'PARAMETERS'` for uncompressed probes: it + makes one `finit_module` call and reports failure without retrying. Future + initramfs builds include it; existing images need a separately staged copy. + It does not resolve dependencies or replace the stage's safety checks. - **Arm a safety net before every risky step:** - for anything that loads drivers or pokes hardware, a log stream to the laptop first and `--watchdog` (the stage tools do both); - for anything that can cut USB, a dead-man switch: `tools/usbc-deadman`, or `systemd-run --unit=x-deadman --on-active=90 `, then confirm over a *fresh* SSH login (`tools/phone-ssh --fresh`) and stop the timer; diff --git a/bin/omamobile b/bin/omamobile index 4e9697e58..7b1a03a1b 100755 --- a/bin/omamobile +++ b/bin/omamobile @@ -492,6 +492,9 @@ cmd_initramfs() { "$CLANG_DIR/bin/clang" --target=aarch64-linux-musl --sysroot="$sysroot" -fuse-ld=lld -static -nostdlib -O2 \ -o "$stage/usr/local/bin/reboot-to" "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ "$reboot_src" -L"$sysroot/usr/lib" -lc "$builtins" "$sysroot/usr/lib/crtn.o" + "$CLANG_DIR/bin/clang" --target=aarch64-linux-musl --sysroot="$sysroot" -fuse-ld=lld -static -nostdlib -O2 \ + -o "$stage/usr/local/bin/module-load-once" "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ + "$ROOT/tools/module-load-once.c" -L"$sysroot/usr/lib" -lc "$builtins" "$sysroot/usr/lib/crtn.o" # A/B slot metadata in devinfo (Apache-2.0 port of Google's boot HAL). Not called by init yet. "$CLANG_DIR/bin/clang" --target=aarch64-linux-musl --sysroot="$sysroot" -fuse-ld=lld -static -nostdlib -O2 \ -o "$stage/usr/local/bin/omamobile-bootctl" "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ @@ -513,8 +516,16 @@ cmd_initramfs() { "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ "$reboot_src" "$sysroot/usr/lib/libc.a" "$sysroot/usr/lib/crtn.o" \ || die "reboot-to failed to link" + clang --target=aarch64-linux-musl --sysroot="$sysroot" -nostdinc -isystem "$sysroot/usr/include" \ + -static -nostdlib -O2 -fno-stack-protector -fno-pie -fuse-ld=lld \ + -o "$stage/usr/local/bin/module-load-once" \ + "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ + "$ROOT/tools/module-load-once.c" "$sysroot/usr/lib/libc.a" "$sysroot/usr/lib/crtn.o" \ + || die "module-load-once failed to link" say "No $DEV_PACKAGE bootctl; built freestanding devmem and musl reboot-to" fi + # Dropbear's command shell can search only /usr/bin:/bin. + ln -s ../local/bin/module-load-once "$stage/usr/bin/module-load-once" mkdir -p "$stage/root/.ssh" cat "$HOME"/.ssh/*.pub > "$stage/root/.ssh/authorized_keys" chmod 700 "$stage/root/.ssh" && chmod 600 "$stage/root/.ssh/authorized_keys" diff --git a/tests/all b/tests/all index 53ae48b40..ebd953b2b 100755 --- a/tests/all +++ b/tests/all @@ -39,3 +39,5 @@ fi echo "# tests/phone-ssh" tests/phone-ssh +echo "# tests/module-load-once" +tests/module-load-once diff --git a/tests/module-load-once b/tests/module-load-once new file mode 100755 index 000000000..ab8f0178d --- /dev/null +++ b/tests/module-load-once @@ -0,0 +1,92 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Exercise the real loader with the module syscall intercepted. No modules load. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +scratch=$(mktemp -d) +trap 'rm -rf "$scratch"' EXIT +cat >"$scratch/syscall.c" <<'C' +#include +#include +#include +#include +#include +#include +#include +#include + +long __wrap_syscall(long number, ...) +{ + va_list ap; + int fd, flags; + const char *parameters; + char byte; + FILE *log; + + assert(number == SYS_finit_module); + va_start(ap, number); + fd = va_arg(ap, int); + parameters = va_arg(ap, const char *); + flags = va_arg(ap, int); + va_end(ap); + assert(fcntl(fd, F_GETFD) & FD_CLOEXEC); + assert(read(fd, &byte, 1) == 1 && byte == 'x'); + assert(flags == 0); + log = fopen(getenv("CALL_LOG"), "a"); + assert(log); + fprintf(log, "%s\n", parameters); + assert(fclose(log) == 0); + errno = atoi(getenv("LOAD_ERRNO")); + return errno ? -1 : 0; +} + +int __real_close(int fd); +int __wrap_close(int fd) +{ + int result = __real_close(fd); + errno = EBADF; /* Closing must not hide the loading error. */ + return result; +} +C +${CC:-cc} -Wall -Wextra -Werror tools/module-load-once.c "$scratch/syscall.c" \ + -Wl,--wrap=syscall,--wrap=close -o "$scratch/module-load-once" +python3 - "$scratch" <<'PY' +import errno +import os +from pathlib import Path +import subprocess +import sys + +work = Path(sys.argv[1]) +module = work / 'test.ko' +module.write_bytes(b'x: deliberately not a kernel module') +log = work / 'calls' + +def run(args, error=0): + log.unlink(missing_ok=True) + env = dict(os.environ, CALL_LOG=str(log), LOAD_ERRNO=str(error), LC_ALL='C') + result = subprocess.run([str(work / 'module-load-once'), *map(str, args)], + env=env, capture_output=True, text=True, timeout=2) + calls = log.read_text().splitlines() if log.exists() else [] + return result, calls + +for parameters in [[], ['count=1 label="two words"']]: + for error in [0, errno.EIO, errno.ENOSYS, errno.EOPNOTSUPP]: + result, calls = run([module, *parameters], error) + assert result.returncode == bool(error), result + assert calls == [parameters[0] if parameters else ''], calls + if error: + assert os.strerror(error) in result.stderr, result.stderr + +empty = work / 'empty.ko' +empty.touch() +fifo = work / 'fifo.ko' +os.mkfifo(fifo) +for path in [work / 'missing.ko', empty, work, fifo]: + result, calls = run([path]) + assert result.returncode == 1 and calls == [], (path, result, calls) +for args in [[], [module, 'one', 'two']]: + result, calls = run(args) + assert result.returncode == 2 and calls == [], (result, calls) +print('ok - module loader calls once, preserves parameters/errors and rejects invalid input without loading') +PY diff --git a/tools/module-load-once.c b/tools/module-load-once.c new file mode 100644 index 000000000..dd92cc25d --- /dev/null +++ b/tools/module-load-once.c @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: MIT */ +/* Load an uncompressed module with one finit_module call and no fallback. */ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + struct stat info; + int fd, result, saved_errno; + + if (argc < 2 || argc > 3) { + fputs("Usage: module-load-once MODULE.ko [PARAMETERS]\n", stderr); + return 2; + } + fd = open(argv[1], O_RDONLY | O_CLOEXEC | O_NONBLOCK); + if (fd < 0) { + perror("open module"); + return 1; + } + if (fstat(fd, &info) || !S_ISREG(info.st_mode) || info.st_size <= 0) { + fputs("Module must be a nonempty regular file\n", stderr); + close(fd); + return 1; + } + result = syscall(SYS_finit_module, fd, argc == 3 ? argv[2] : "", 0); + saved_errno = errno; + close(fd); + if (result) { + errno = saved_errno; + perror("finit_module (not retried)"); + return 1; + } + return 0; +} From 474513937286fe30889365899aa90ca49b0f6c7e Mon Sep 17 00:00:00 2001 From: Gr-linkk <280405187+Gr-linkk@users.noreply.github.com> Date: Sat, 31 Oct 2026 10:02:57 -0700 Subject: [PATCH 2/3] initramfs: use the one-call loader only for packed modules The helper previously had no caller but shipped in every boot image. Build it only when INITRAMFS_MODULES requests modules and call it from load_modules, preserving the board gate, ordered loading and failure reporting without a BusyBox retry. Drop the general diagnostic mandate. Exercise the real shell caller with success, failure, missing-helper, wrong-board and absent-list cases. Both compiler paths build static ARM64 helpers with module fixtures; cheetah and oriole images omit it. No revised initramfs has been booted on a phone. Assisted-by: OpenAI GPT-6 Astra --- AGENTS.md | 6 ------ bin/omamobile | 24 +++++++++++++----------- initramfs/init | 6 ++++-- tests/initramfs-steps | 14 +++++++++++++- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index da1c9c70f..6e0265f08 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,12 +17,6 @@ Omarchy Mobile runs native Omarchy (Arch Linux ARM, Hyprland, Omarchy's packages - **`devmem` is `devmem ADDR [VALUE]`.** A second argument is written, so `devmem ADDR 32` writes 0x20. This once clobbered live DSIM timing registers. - **Read only blocks that are known powered and clocked, one register per call on a first probe.** A read of an unpowered block aborts the SoC and kills the session. - **Read-only steps first, then one change per boot.** New DT nodes stay `disabled` and are enabled by an overlay in [`device/cheetah/overlays/`](device/cheetah/overlays). Blacklist a module before installing a DTB that enables its node. Two new things that fail together tell you nothing. -- **Load a new diagnostic module with one syscall.** BusyBox can fall back - from a failed `finit_module` to `init_module`, repeating initialization. - Use `module-load-once MODULE.ko 'PARAMETERS'` for uncompressed probes: it - makes one `finit_module` call and reports failure without retrying. Future - initramfs builds include it; existing images need a separately staged copy. - It does not resolve dependencies or replace the stage's safety checks. - **Arm a safety net before every risky step:** - for anything that loads drivers or pokes hardware, a log stream to the laptop first and `--watchdog` (the stage tools do both); - for anything that can cut USB, a dead-man switch: `tools/usbc-deadman`, or `systemd-run --unit=x-deadman --on-active=90 `, then confirm over a *fresh* SSH login (`tools/phone-ssh --fresh`) and stop the timer; diff --git a/bin/omamobile b/bin/omamobile index 4bc907294..30882afff 100755 --- a/bin/omamobile +++ b/bin/omamobile @@ -514,9 +514,11 @@ cmd_initramfs() { "$CLANG_DIR/bin/clang" --target=aarch64-linux-musl --sysroot="$sysroot" -fuse-ld=lld -static -nostdlib -O2 \ -o "$stage/usr/local/bin/reboot-to" "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ "$reboot_src" -L"$sysroot/usr/lib" -lc "$builtins" "$sysroot/usr/lib/crtn.o" - "$CLANG_DIR/bin/clang" --target=aarch64-linux-musl --sysroot="$sysroot" -fuse-ld=lld -static -nostdlib -O2 \ - -o "$stage/usr/local/bin/module-load-once" "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ - "$ROOT/tools/module-load-once.c" -L"$sysroot/usr/lib" -lc "$builtins" "$sysroot/usr/lib/crtn.o" + if [[ -n ${DEV_INITRAMFS_MODULES:-} ]]; then + "$CLANG_DIR/bin/clang" --target=aarch64-linux-musl --sysroot="$sysroot" -fuse-ld=lld -static -nostdlib -O2 \ + -o "$stage/usr/local/bin/module-load-once" "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ + "$ROOT/tools/module-load-once.c" -L"$sysroot/usr/lib" -lc "$builtins" "$sysroot/usr/lib/crtn.o" + fi # A/B slot metadata in devinfo (Apache-2.0 port of Google's boot HAL). Not called by init yet. "$CLANG_DIR/bin/clang" --target=aarch64-linux-musl --sysroot="$sysroot" -fuse-ld=lld -static -nostdlib -O2 \ -o "$stage/usr/local/bin/omamobile-bootctl" "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ @@ -538,16 +540,16 @@ cmd_initramfs() { "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ "$reboot_src" "$sysroot/usr/lib/libc.a" "$sysroot/usr/lib/crtn.o" \ || die "reboot-to failed to link" - clang --target=aarch64-linux-musl --sysroot="$sysroot" -nostdinc -isystem "$sysroot/usr/include" \ - -static -nostdlib -O2 -fno-stack-protector -fno-pie -fuse-ld=lld \ - -o "$stage/usr/local/bin/module-load-once" \ - "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ - "$ROOT/tools/module-load-once.c" "$sysroot/usr/lib/libc.a" "$sysroot/usr/lib/crtn.o" \ - || die "module-load-once failed to link" + if [[ -n ${DEV_INITRAMFS_MODULES:-} ]]; then + clang --target=aarch64-linux-musl --sysroot="$sysroot" -nostdinc -isystem "$sysroot/usr/include" \ + -static -nostdlib -O2 -fno-stack-protector -fno-pie -fuse-ld=lld \ + -o "$stage/usr/local/bin/module-load-once" \ + "$sysroot/usr/lib/crt1.o" "$sysroot/usr/lib/crti.o" \ + "$ROOT/tools/module-load-once.c" "$sysroot/usr/lib/libc.a" "$sysroot/usr/lib/crtn.o" \ + || die "module-load-once failed to link" + fi say "No $DEV_PACKAGE bootctl; built freestanding devmem and musl reboot-to" fi - # Dropbear's command shell can search only /usr/bin:/bin. - ln -s ../local/bin/module-load-once "$stage/usr/bin/module-load-once" mkdir -p "$stage/root/.ssh" cat "$HOME"/.ssh/*.pub > "$stage/root/.ssh/authorized_keys" chmod 700 "$stage/root/.ssh" && chmod 600 "$stage/root/.ssh/authorized_keys" diff --git a/initramfs/init b/initramfs/init index 36cd2d946..aa210a157 100755 --- a/initramfs/init +++ b/initramfs/init @@ -167,7 +167,7 @@ board_matches() { return 0 } -# Modules this image carries (the descriptor's INITRAMFS_MODULES), insmodded +# Modules this image carries (the descriptor's INITRAMFS_MODULES), loaded # in the packed order before any other step: on raven the PMIC regulator # driver the simple-framebuffer waits for, and the MAX77759 nvmem that ABL # reads the reboot reason from. They were built for this image's board. @@ -175,8 +175,10 @@ load_modules() { local m [ -s /lib/modules/omamobile/order ] || return 0 board_matches "initramfs modules" || return 0 + # BusyBox insmod may retry initialization after finit_module fails. + # These modules can already have touched hardware before returning an error. while read -r m; do - insmod "/lib/modules/omamobile/$m.ko" 2>/dev/null || say "insmod $m failed" + /usr/local/bin/module-load-once "/lib/modules/omamobile/$m.ko" 2>/dev/null || say "module-load-once $m failed" done < /lib/modules/omamobile/order } load_modules diff --git a/tests/initramfs-steps b/tests/initramfs-steps index bec6b7f52..054687b0a 100755 --- a/tests/initramfs-steps +++ b/tests/initramfs-steps @@ -68,10 +68,12 @@ ln -s "$t/i2c/platform/soc@0/10d60000.i2c/i2c-6" "$t/devices/i2c-6" sed -e "s|/etc/omamobile-|$t/etc/omamobile-|g" \ -e "s|/proc/device-tree/compatible|$t/compatible|" \ -e "s|/lib/modules/omamobile|$t/mod|g" \ + -e "s|/usr/local/bin/module-load-once|$t/bin/module-load-once|g" \ -e "s|/sys/bus/i2c/devices|$t/devices|" \ -e 's|( while sleep 2; do usb_switch quiet; done ) &|:|' \ "$t/fn.sh" > "$t/fn-test.sh" printf '#!/bin/sh\necho "insmod $*" >> "%s/hw.log"\n' "$t" > "$t/bin/insmod" +printf '#!/bin/sh\necho "module-load-once $*" >> "%s/hw.log"\nexit "${MODULE_LOAD_STATUS:-0}"\n' "$t" > "$t/bin/module-load-once" printf '#!/bin/sh\necho "i2cget $*" >> "%s/hw.log"\ncat "%s/reg"\n' "$t" "$t" > "$t/bin/i2cget" printf '#!/bin/sh\necho "i2cset $*" >> "%s/hw.log"\necho 0x09 > "%s/reg"\n' "$t" "$t" > "$t/bin/i2cset" printf '#!/bin/sh\nexit 0\n' > "$t/bin/sleep" @@ -85,7 +87,17 @@ run() { # $1: the step printf 'sec-acpm\nmax77759\n' > "$t/mod/order" printf 'google,gs101-raven\n' > "$t/etc/omamobile-compatible" run load_modules -[[ $(cat "$t/hw.log") == "insmod $t/mod/sec-acpm.ko"$'\n'"insmod $t/mod/max77759.ko" ]] || fail "a matching board loads its modules in order" +[[ $(cat "$t/hw.log") == "module-load-once $t/mod/sec-acpm.ko"$'\n'"module-load-once $t/mod/max77759.ko" ]] || fail "a matching board loads its modules in order" +# A failed helper must not fall back to BusyBox insmod or retry the module. +MODULE_LOAD_STATUS=1 run load_modules +[[ $(cat "$t/hw.log") == "module-load-once $t/mod/sec-acpm.ko"$'\n'"module-load-once $t/mod/max77759.ko" ]] || fail "failed loads are attempted only once, in order" +[[ $(cat "$t/said") == "module-load-once sec-acpm failed"$'\n'"module-load-once max77759 failed" ]] || fail "each failed load is reported" +# A missing helper is also a failure, never permission to use insmod. +mv "$t/bin/module-load-once" "$t/bin/module-load-once.saved" +run load_modules +[[ ! -e $t/hw.log ]] || fail "missing helper fell back to insmod" +[[ $(wc -l < "$t/said") == 2 ]] || fail "missing helper failures are reported" +mv "$t/bin/module-load-once.saved" "$t/bin/module-load-once" printf 'google,gs201-cheetah\n' > "$t/etc/omamobile-compatible" run load_modules [[ ! -e $t/hw.log ]] || fail "another board's image loaded a module" From 781687ca96d5fbf03f793d4b09bed465bd1efa59 Mon Sep 17 00:00:00 2001 From: Gr-linkk <280405187+Gr-linkk@users.noreply.github.com> Date: Tue, 3 Nov 2026 15:05:29 -0700 Subject: [PATCH 3/3] initramfs: report packed module loader errors Keep the loader error in the boot log so failed module initialization can be diagnosed without retrying it. --- initramfs/init | 4 ++-- tests/initramfs-steps | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/initramfs/init b/initramfs/init index aa210a157..6e5fe74a2 100755 --- a/initramfs/init +++ b/initramfs/init @@ -172,13 +172,13 @@ board_matches() { # driver the simple-framebuffer waits for, and the MAX77759 nvmem that ABL # reads the reboot reason from. They were built for this image's board. load_modules() { - local m + local m error [ -s /lib/modules/omamobile/order ] || return 0 board_matches "initramfs modules" || return 0 # BusyBox insmod may retry initialization after finit_module fails. # These modules can already have touched hardware before returning an error. while read -r m; do - /usr/local/bin/module-load-once "/lib/modules/omamobile/$m.ko" 2>/dev/null || say "module-load-once $m failed" + error=$(/usr/local/bin/module-load-once "/lib/modules/omamobile/$m.ko" 2>&1) || say "module-load-once $m failed: $error" done < /lib/modules/omamobile/order } load_modules diff --git a/tests/initramfs-steps b/tests/initramfs-steps index 054687b0a..c45c93588 100755 --- a/tests/initramfs-steps +++ b/tests/initramfs-steps @@ -73,7 +73,7 @@ sed -e "s|/etc/omamobile-|$t/etc/omamobile-|g" \ -e 's|( while sleep 2; do usb_switch quiet; done ) &|:|' \ "$t/fn.sh" > "$t/fn-test.sh" printf '#!/bin/sh\necho "insmod $*" >> "%s/hw.log"\n' "$t" > "$t/bin/insmod" -printf '#!/bin/sh\necho "module-load-once $*" >> "%s/hw.log"\nexit "${MODULE_LOAD_STATUS:-0}"\n' "$t" > "$t/bin/module-load-once" +printf '#!/bin/sh\necho "module-load-once $*" >> "%s/hw.log"\n[ "${MODULE_LOAD_STATUS:-0}" = 0 ] || echo "finit_module: simulated failure" >&2\nexit "${MODULE_LOAD_STATUS:-0}"\n' "$t" > "$t/bin/module-load-once" printf '#!/bin/sh\necho "i2cget $*" >> "%s/hw.log"\ncat "%s/reg"\n' "$t" "$t" > "$t/bin/i2cget" printf '#!/bin/sh\necho "i2cset $*" >> "%s/hw.log"\necho 0x09 > "%s/reg"\n' "$t" "$t" > "$t/bin/i2cset" printf '#!/bin/sh\nexit 0\n' > "$t/bin/sleep" @@ -91,7 +91,7 @@ run load_modules # A failed helper must not fall back to BusyBox insmod or retry the module. MODULE_LOAD_STATUS=1 run load_modules [[ $(cat "$t/hw.log") == "module-load-once $t/mod/sec-acpm.ko"$'\n'"module-load-once $t/mod/max77759.ko" ]] || fail "failed loads are attempted only once, in order" -[[ $(cat "$t/said") == "module-load-once sec-acpm failed"$'\n'"module-load-once max77759 failed" ]] || fail "each failed load is reported" +[[ $(cat "$t/said") == "module-load-once sec-acpm failed: finit_module: simulated failure"$'\n'"module-load-once max77759 failed: finit_module: simulated failure" ]] || fail "each failed load is reported" # A missing helper is also a failure, never permission to use insmod. mv "$t/bin/module-load-once" "$t/bin/module-load-once.saved" run load_modules