summaryrefslogtreecommitdiff
path: root/tests/bin
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-11-17 14:58:45 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2022-11-17 15:50:38 +0000
commitbe34bbec6ceabeb6d89acd047d94388dbe5224b5 (patch)
treee1dda5ddcd445fa004bfd8a3dad17e7599697cbc /tests/bin
parent2947bb73b960358653cbc478b073e388a9d42a2f (diff)
downloadalpine-conf-be34bbec6ceabeb6d89acd047d94388dbe5224b5.zip
tests: add fake modinfo
Needed to test that we get the proper firmware included in modloop with update-kernel
Diffstat (limited to 'tests/bin')
-rwxr-xr-xtests/bin/modinfo23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/bin/modinfo b/tests/bin/modinfo
new file mode 100755
index 0000000..14a43bb
--- /dev/null
+++ b/tests/bin/modinfo
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -k)
+ shift
+ kver="$1"
+ ;;
+ -F)
+ shift
+ field="$1"
+ ;;
+ *)
+ if [ -n "$field" ]; then
+ awk -v field="$field:" '$1==field {print $2}' "$1"
+ else
+ cat "$1"
+ fi
+ ;;
+ esac
+ shift
+done
+