summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/NEWS1
-rw-r--r--mdk-stage1/modules.c8
2 files changed, 8 insertions, 1 deletions
diff --git a/mdk-stage1/NEWS b/mdk-stage1/NEWS
index bc8456cd2..99133589e 100644
--- a/mdk-stage1/NEWS
+++ b/mdk-stage1/NEWS
@@ -1,3 +1,4 @@
+- sort modules in the interface
- try to load squashfs_lzma too
1.32:
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c
index 53bc87d4c..c25d9358f 100644
--- a/mdk-stage1/modules.c
+++ b/mdk-stage1/modules.c
@@ -420,6 +420,11 @@ static enum return_type insmod_with_options(char * mod, enum driver_type type)
return RETURN_OK;
}
+static int strsortfunc(const void *a, const void *b)
+{
+ return strcmp(* (char * const *) a, * (char * const *) b);
+}
+
enum return_type ask_insmod(enum driver_type type)
{
enum return_type results;
@@ -431,11 +436,12 @@ enum return_type ask_insmod(enum driver_type type)
char ** p_modules = modules;
char ** p_descrs = descrs;
+ qsort(dlist, string_array_length(dlist), sizeof(char *), strsortfunc);
+
unset_automatic(); /* we are in a fallback mode */
while (p_dlist && *p_dlist) {
struct module_descr_elem * descr;
-
if (!strstr(*p_dlist, kernel_module_extension())) {
p_dlist++;
continue;