From 2896f6a30146f5a67ea2813929a8f49eeb951472 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 3 Feb 2009 17:43:12 +0000 Subject: sort modules in the interface --- mdk-stage1/NEWS | 1 + mdk-stage1/modules.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'mdk-stage1') 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; -- cgit v1.2.1