FS#24766 - [mkinitcpio] modprobe usage output on boot

Attached to Project: Arch Linux
Opened by xduugu (xduugu) - Saturday, 18 June 2011, 08:43 GMT
Last edited by Eric Belanger (Snowman) - Saturday, 09 July 2011, 18:50 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 15
Private No

Details

Description:
Since commit 7a165, modprobe is run on $MODULES even if it is empty as in my case. This results in a modprobe usage message on boot.

https://projects.archlinux.org/mkinitcpio.git/commit/?id=7a165fb842eb1dcfdd9aa27b74354245d6980d19


Additional info:
* mkinitcpio >= 0.6.14-1
* MODULES has to be empty in /etc/mkinitcpio.conf


Steps to reproduce:
- Empty $MODULES and rebuild the kernel image OR
- just run "/sbin/modprobe -qab" in a terminal


Proposed solution: Check if $MODULES actually contains any non-space characters.

[ -n "${MODULES// /} ]

By the way, earlymodules suffers from the same issue if it is set to something like " " which is not empty, but not applicable for modprobe as well.
This task depends upon

Closed by  Eric Belanger (Snowman)
Saturday, 09 July 2011, 18:50 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in mkinitcpio >= 0.7.1. mkinitcpio < 0.7 was not affected.
Comment by xduugu (xduugu) - Monday, 20 June 2011, 17:25 GMT
Could someone please fix the typo in the subject? It has to be "mkinitcpio" of course. Also, there is a closing quotation mark missing in

[ -n "${MODULES// /} ]

which should be

[ -n "${MODULES// /}" ]
Comment by Christian Hesse (eworm) - Friday, 01 July 2011, 07:31 GMT
This is fixed in mkinitcpio 0.7-1 (currently in [testing]). Thanks a lot!
Comment by xduugu (xduugu) - Saturday, 02 July 2011, 09:46 GMT
Yeah, at least for empty MODULE variables. Setting MODULES=" " will still produce this output.
Comment by Thomas Bächler (brain0) - Saturday, 02 July 2011, 10:28 GMT
${MODULES// /} does not solve the problem, but removes all whitespace from MODULES.
Comment by xduugu (xduugu) - Saturday, 02 July 2011, 10:51 GMT
That's exactly what it does, solving the problem. Of course, the spaces are just removed in the test, not in the modprobe call.
empty or spaces-only MODULES → -n returns false
at least one single non-space character → -n is true

$ MODULES=" "
$
$
$ [ -n "$MODULES" ] && /sbin/modprobe -qab $MODULES
Usage: /sbin/modprobe [-v] [-V] [-C config-file] [-d <dirname> ] [-n] [-i] [-q] [-b] [-o <modname>] [ --dump-modversions ] <modname> [parameters...]
/sbin/modprobe -r [-n] [-i] [-v] <modulename> ...
/sbin/modprobe -l -t <dirname> [ -a <modulename> ...]
$
$
$ [ -n "${MODULES// /}" ] && /sbin/modprobe -qab $MODULES
$




$ MODULES="uvcvideo"
$ lsmod | grep -m1 uvcvideo
$ [ -n "${MODULES// /}" ] && /sbin/modprobe -qab $MODULES
$ lsmod | grep -m1 uvcvideo
uvcvideo 62079 0
$
Comment by Thomas Bächler (brain0) - Saturday, 02 July 2011, 11:14 GMT
Right, yes.
Comment by xduugu (xduugu) - Saturday, 09 July 2011, 15:35 GMT
Whoops, I was quite sure that this was a regression in 0.7 - apparently not. I guess the report should be kept open until the core package was updated.

Loading...