diff --git a/kernel/selftest.sh b/kernel/selftest.sh index 9327686..1b39b7a 100755 --- a/kernel/selftest.sh +++ b/kernel/selftest.sh @@ -107,8 +107,14 @@ if [ -z "$KO" ]; then [ -d "$dir" ] || continue for cand in "$dir"/${MODULE}*.ko; do [ -f "$cand" ] || continue - vm="$(modinfo -F vermagic "$cand" 2>/dev/null)" - msg="$msg"$'\n'" $cand (built for ${vm%% *})" + if vm="$(modinfo -F vermagic "$cand" 2>/dev/null)" && [ -n "$vm" ]; then + note="built for ${vm%% *}" + else + # modinfo couldn't read it - usually not an ELF .ko at all + # (e.g. a still-zipped release file). Show what it really is. + note="UNREADABLE: $(file -b "$cand" 2>/dev/null || echo 'not a kernel module') - unzip/rebuild?" + fi + msg="$msg"$'\n'" $cand ($note)" any=1 done done