From 1e2fe3f04e1181bfd598153bb92b03374560160d Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 21 Aug 2024 19:22:34 +0200 Subject: [PATCH] autopkgtest: Fix test failure when built-in drivers request firmware On Debian armhf, the imx_sdma driver is currently built-in. It requests firmware and has the corresponding module metadata, and in tests we currently generate a warning that this is missing. Any output to stderr results in a test failure by default. It is possible to override that, but I think we do generally want this behaviour. imx_sdma could be built as a module (as it is on arm64), and it might also make sense to remove the firmware warnings, but those will take some time to do. As a quick fix to let initramfs-tools to go into testing, work around this by creating dummy files for any firmware listed in built-in module metadata. This fixes the other half of #1078168. Signed-off-by: Ben Hutchings --- debian/tests/test-common | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/tests/test-common b/debian/tests/test-common index 981aafe..d10d59c 100644 --- a/debian/tests/test-common +++ b/debian/tests/test-common @@ -13,6 +13,15 @@ if [ -z "$KVER" ]; then exit 2 fi +# If any built-in drivers request firmware, create dummy files to +# avoid warnings for this (see #1078168). +tr '\0' '\n' < "/lib/modules/$KVER/modules.builtin.modinfo" \ +| sed -n -e 's/^[^=]*\.firmware=//p' \ +| while read fw_file; do + mkdir -p "/lib/firmware/$(dirname "$fw_file")" + touch "/lib/firmware/$fw_file" +done + case "$(dpkg --print-architecture)" in arm64) # The Ubuntu arm64 autopkgtest runs rarely into the 1200 seconds timeout.