[PATCH] Fix modprobe status reported v3

Denys Vlasenko vda.linux at googlemail.com
Wed Jun 17 16:45:52 UTC 2009


On Tue, Jun 16, 2009 at 9:27 AM, Gilles Espinasse<g.esp at free.fr> wrote:
> Report modprobe status and not mostly report only EXITSUCCESS
>
> v3
>  Remove the global variable as any errror is reported from modprobe_maint
>  Add a DBG message when probing module by file name
>  Add an error message in case of alias error
>
> This fix the following cases by reporting an error in status :
> - when a module is not found
> - unloading a module used by another module (like hid used by usbhid)
> - when a module is not present in modules.dep (outdated .dep file)
> - in case of alias error (try with echo "alias foo bar" >> modules.alias;modprobe foo
>
> All that has been tested mainly with dummy.ko.gz module and rtnl-link-dummy alias
> Not tested with blacklist.
>
> Fix an old comment s/modprobe.dep/modules.dep/

Thanks!


> @@ -409,13 +413,19 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
>
>                                DBG("probing %s by realname %s", me->modname, realname);
>                                m2 = get_or_add_modentry(realname);
> -                               if (!(m2->flags & MODULE_FLAG_BLACKLISTED))
> -                                       do_modprobe(m2);
> -//FIXME: error check?
> +                               if (!(m2->flags & MODULE_FLAG_BLACKLISTED)
> +                                && (!(m2->flags & MODULE_FLAG_LOADED)
> +                                       || opt & MODPROBE_OPT_REMOVE )
> +                               ) {
> +                                       rc=do_modprobe(m2);
> +                                       if (rc < 0 && !(opt & INSMOD_OPT_SILENT))
> +                                               bb_error_msg("module %s alias error",
> +                                                            me->modname);
> +                               }

The error message is not informative. What is "alias error"?

Looks like we do not treat -q correctly. It should not suppress all errors.

I am trying to fix it based on your patch. Can you try attached patch
and let me know if you still have problems?
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.patch
Type: text/x-patch
Size: 12496 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090617/3e89a942/attachment-0001.bin>


More information about the busybox mailing list