["test-depmod/detect-loop/lib/modules/4.4.4/kernel/mod-loop-i.ko"]="mod-loop-i.ko"
["test-depmod/detect-loop/lib/modules/4.4.4/kernel/mod-loop-j.ko"]="mod-loop-j.ko"
["test-depmod/detect-loop/lib/modules/4.4.4/kernel/mod-loop-k.ko"]="mod-loop-k.ko"
+ ["test-depmod/search-order-external-first/lib/modules/4.4.4/foo/"]="mod-simple.ko"
+ ["test-depmod/search-order-external-first/lib/modules/4.4.4/foobar/"]="mod-simple.ko"
+ ["test-depmod/search-order-external-first/lib/modules/external/"]="mod-simple.ko"
+ ["test-depmod/search-order-external-last/lib/modules/4.4.4/foo/"]="mod-simple.ko"
+ ["test-depmod/search-order-external-last/lib/modules/4.4.4/foobar/"]="mod-simple.ko"
+ ["test-depmod/search-order-external-last/lib/modules/external/"]="mod-simple.ko"
["test-dependencies/lib/modules/4.0.20-kmod/kernel/fs/foo/"]="mod-foo-b.ko"
["test-dependencies/lib/modules/4.0.20-kmod/kernel/"]="mod-foo-c.ko"
["test-dependencies/lib/modules/4.0.20-kmod/kernel/lib/"]="mod-foo-a.ko"
["test-modprobe/oldkernel-force/lib/modules/3.3.3/kernel/"]="mod-simple.ko"
["test-modprobe/alias-to-none/lib/modules/4.4.4/kernel/"]="mod-simple.ko"
["test-modprobe/module-param-kcmdline/lib/modules/4.4.4/kernel/"]="mod-simple.ko"
+ ["test-modprobe/external/lib/modules/external/"]="mod-simple.ko"
["test-depmod/modules-order-compressed/lib/modules/4.4.4/kernel/drivers/block/cciss.ko"]="mod-fake-cciss.ko"
["test-depmod/modules-order-compressed/lib/modules/4.4.4/kernel/drivers/scsi/hpsa.ko"]="mod-fake-hpsa.ko"
["test-depmod/modules-order-compressed/lib/modules/4.4.4/kernel/drivers/scsi/scsi_mod.ko"]="mod-fake-scsi-mod.ko"
["test-modinfo/mod-simple-sparc64.ko"]="mod-simple-sparc64.ko"
["test-modinfo/mod-simple-sha1.ko"]="mod-simple.ko"
["test-modinfo/mod-simple-sha256.ko"]="mod-simple.ko"
+ ["test-modinfo/external/lib/modules/external/mod-simple.ko"]="mod-simple.ko"
["test-tools/insert/lib/modules/4.4.4/kernel/"]="mod-simple.ko"
["test-tools/remove/lib/modules/4.4.4/kernel/"]="mod-simple.ko"
)
--- /dev/null
+external 4\.4\..* /lib/modules/external
--- /dev/null
+search external foobar foo built-in
--- /dev/null
+/lib/modules/external/mod-simple.ko:
--- /dev/null
+external 4\.4\..* /lib/modules/external
--- /dev/null
+search foobar foo built-in external
--- /dev/null
+foobar/mod-simple.ko:
--- /dev/null
+/lib/modules/external/mod-simple.ko
--- /dev/null
+# Aliases extracted from modules themselves.
--- /dev/null
+/lib/modules/external/mod-simple.ko:
--- /dev/null
+# Soft dependencies extracted from modules themselves.
--- /dev/null
+# Aliases for symbols, used by symbol_request().
--- /dev/null
+# Aliases extracted from modules themselves.
--- /dev/null
+/lib/modules/external/mod-simple.ko:
--- /dev/null
+# Soft dependencies extracted from modules themselves.
--- /dev/null
+# Aliases for symbols, used by symbol_request().
.err = DETECT_LOOP_ROOTFS "/correct.txt",
});
+#define SEARCH_ORDER_EXTERNAL_FIRST_ROOTFS TESTSUITE_ROOTFS "test-depmod/search-order-external-first"
+static noreturn int depmod_search_order_external_first(const struct test *t)
+{
+ const char *progname = ABS_TOP_BUILDDIR "/tools/depmod";
+ const char *const args[] = {
+ progname,
+ NULL,
+ };
+
+ test_spawn_prog(progname, args);
+ exit(EXIT_FAILURE);
+}
+DEFINE_TEST(depmod_search_order_external_first,
+ .description = "check if depmod honor external keyword with higher priority",
+ .config = {
+ [TC_UNAME_R] = "4.4.4",
+ [TC_ROOTFS] = SEARCH_ORDER_EXTERNAL_FIRST_ROOTFS,
+ },
+ .output = {
+ .files = (const struct keyval[]) {
+ { SEARCH_ORDER_EXTERNAL_FIRST_ROOTFS "/lib/modules/4.4.4/correct-modules.dep",
+ SEARCH_ORDER_EXTERNAL_FIRST_ROOTFS "/lib/modules/4.4.4/modules.dep" },
+ { }
+ },
+ });
+
+#define SEARCH_ORDER_EXTERNAL_LAST_ROOTFS TESTSUITE_ROOTFS "test-depmod/search-order-external-last"
+static noreturn int depmod_search_order_external_last(const struct test *t)
+{
+ const char *progname = ABS_TOP_BUILDDIR "/tools/depmod";
+ const char *const args[] = {
+ progname,
+ NULL,
+ };
+
+ test_spawn_prog(progname, args);
+ exit(EXIT_FAILURE);
+}
+DEFINE_TEST(depmod_search_order_external_last,
+ .description = "check if depmod honor external keyword with lower priority",
+ .config = {
+ [TC_UNAME_R] = "4.4.4",
+ [TC_ROOTFS] = SEARCH_ORDER_EXTERNAL_LAST_ROOTFS,
+ },
+ .output = {
+ .files = (const struct keyval[]) {
+ { SEARCH_ORDER_EXTERNAL_LAST_ROOTFS "/lib/modules/4.4.4/correct-modules.dep",
+ SEARCH_ORDER_EXTERNAL_LAST_ROOTFS "/lib/modules/4.4.4/modules.dep" },
+ { }
+ },
+ });
+
TESTSUITE_MAIN();
.out = TESTSUITE_ROOTFS "test-modinfo/correct.txt",
});
#endif
+
+static noreturn int test_modinfo_external(const struct test *t)
+{
+ const char *const args[] = {
+ progname, "-F", "filename",
+ "mod-simple",
+ NULL,
+ };
+ test_spawn_prog(progname, args);
+ exit(EXIT_FAILURE);
+}
+DEFINE_TEST(test_modinfo_external,
+ .description = "check if modinfo finds external module",
+ .config = {
+ [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modinfo/external",
+ [TC_UNAME_R] = "4.4.4",
+ },
+ .output = {
+ .out = TESTSUITE_ROOTFS "test-modinfo/correct-external.txt",
+ })
+
TESTSUITE_MAIN();
.modules_loaded = "mod-simple",
);
+static noreturn int modprobe_external(const struct test *t)
+{
+ const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+ const char *const args[] = {
+ progname,
+ "mod-simple",
+ NULL,
+ };
+
+ test_spawn_prog(progname, args);
+ exit(EXIT_FAILURE);
+}
+DEFINE_TEST(modprobe_external,
+ .description = "check modprobe able to load external module",
+ .config = {
+ [TC_UNAME_R] = "4.4.4",
+ [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/external",
+ [TC_INIT_MODULE_RETCODES] = "",
+ },
+ .modules_loaded = "mod-simple",
+ );
+
TESTSUITE_MAIN();