Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#25788 - [filesystem mkinitcpio] move of USB modprobe rule

Attached to Project: Arch Linux
Opened by Matthias Dienstbier (fs4000) - Saturday, 27 August 2011, 11:36 GMT
Last edited by Dave Reisner (falconindy) - Sunday, 09 October 2011, 23:55 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Thomas B├Ąchler (brain0)
Dave Reisner (falconindy)
Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


In filesystem the USB modprobe rule was moved to /lib:

Don't forget to reflect this change in mkinitcpio and release both at the same time: (line 14)
This task depends upon

Closed by  Dave Reisner (falconindy)
Sunday, 09 October 2011, 23:55 GMT
Reason for closing:  Fixed
Additional comments about closing:  mkinitcpio 0.7.4, filesystem 2011.10
Comment by Tom Gundersen (tomegun) - Sunday, 28 August 2011, 10:49 GMT
Thanks for the reminder. I have pushed a commit here: <>.

One thing to check before committing: How does add_file deal with missing files? In the future the /etc/modprobe.d/<...> file may or may not exist. Will it just be silently ignored if I try to add a non-existent file? Should it be?
Comment by Dave Reisner (falconindy) - Sunday, 28 August 2011, 12:56 GMT
It complains about missing files:

If you add a file and it doesn't exist, you should be told as such.
Comment by Tom Gundersen (tomegun) - Monday, 29 August 2011, 00:41 GMT
I don't know what is best: adding just the /lib file will not cause any warnings, but is strictly speaking "wrong" as the user should be able to override it in /etc. That said, I cannot imagine why anyone would override this file...
Comment by Matthias Dienstbier (fs4000) - Tuesday, 30 August 2011, 21:02 GMT
What about that?
[ -f "/etc/modprobe.d/usb-load-ehci-first.conf" ] && add_file "/etc/modprobe.d/usb-load-ehci-first.conf" || add_file "/lib/modprobe.d/usb-load-ehci-first.conf"


if [ -f "/etc/modprobe.d/usb-load-ehci-first.conf" ]; then
__add_file "/etc/modprobe.d/usb-load-ehci-first.conf"
__add_file "/lib/modprobe.d/usb-load-ehci-first.conf"
Comment by Dave Reisner (falconindy) - Tuesday, 30 August 2011, 21:29 GMT
Sure, a conditional is the way to solve this. I don't think that needs to be pointed out here. However, neither of your solutions are satisfactory. For your own edification:

- we use bash, not posix constructs in mkinitcpio
- there are undesirable side effects when using a compound command (especially in this case)
- we should be looking explicitly for the rule in /lib first, not /etc.
- __add_file requires 3 parameters or else it will fail. moreover, it should never be used by build-time hooks. add_file is much smarter.
Comment by Matthias Dienstbier (fs4000) - Wednesday, 31 August 2011, 10:02 GMT
I used the underscores only for indentation as spaces don't work, didn't realize this other function also exists.
Comment by Dave Reisner (falconindy) - Sunday, 09 October 2011, 23:54 GMT
Did this in one fell swoop. No kludges, just a hard dep on the new filesystem package.