diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-07-11 04:20:28 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-09-27 12:18:04 +0200 |
commit | 5a0f7ebc8d2cede7532539268e0ffc0bd6816572 (patch) | |
tree | 1709a7c58504db390f0161977af581e32da394fc /install | |
parent | ff557b25937b3511dd04e009a4735b73d1279d4c (diff) | |
download | mkinitcpio-5a0f7ebc8d2cede7532539268e0ffc0bd6816572.tar.gz mkinitcpio-5a0f7ebc8d2cede7532539268e0ffc0bd6816572.tar.xz |
functions: allow ignoring errors on module addition
We conditionally, but naively, add modules in some of our install hooks,
but the kernel may not have these. Note that these modules can fail
silently by detecting a '?' suffix on the module name. In conjunction with
this, the add_module function now takes a flag, -t or --try, which will
ignore module not found errors from modinfo. The config file will also
support this syntax.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'install')
-rw-r--r-- | install/base | 2 | ||||
-rw-r--r-- | install/fw | 2 | ||||
-rw-r--r-- | install/ide | 2 | ||||
-rw-r--r-- | install/pata | 2 | ||||
-rw-r--r-- | install/pcmcia | 5 | ||||
-rw-r--r-- | install/sata | 2 | ||||
-rw-r--r-- | install/scsi | 2 | ||||
-rw-r--r-- | install/usb | 4 | ||||
-rw-r--r-- | install/usbinput | 4 |
9 files changed, 12 insertions, 13 deletions
diff --git a/install/base b/install/base index b4f23d5..e85551c 100644 --- a/install/base +++ b/install/base @@ -24,7 +24,7 @@ build() { read -r -a hooks <<< "$HOOKS" { - (( ${#modules[*]} )) && printf 'MODULES="%s"\n' "${modules[*]}" + (( ${#modules[*]} )) && printf 'MODULES="%s"\n' "${modules[*]%\?}" (( ${#hooks[*]} )) && printf 'HOOKS="%s"\n' "${hooks[*]}" } >"$BUILDROOT/config" ) @@ -3,7 +3,7 @@ build() { MODULES=$(checked_modules "/drivers/firewire/") - [[ $MODULES ]] && MODULES+=" firewire-sbp2 sd_mod sr_mod" + [[ $MODULES ]] && MODULES+=" firewire-sbp2? sd_mod? sr_mod?" } help() { diff --git a/install/ide b/install/ide index 9443dd3..a8d9e97 100644 --- a/install/ide +++ b/install/ide @@ -3,7 +3,7 @@ build() { MODULES="$(checked_modules "/ide/" | grep -v "legacy")" - [[ $MODULES ]] && MODULES+=" ide-gd_mod" + [[ $MODULES ]] && MODULES+=" ide-gd_mod?" } help() { diff --git a/install/pata b/install/pata index c51356e..76f268c 100644 --- a/install/pata +++ b/install/pata @@ -5,7 +5,7 @@ build() { MODULES+=" $(checked_modules "$filter")" done - [[ $MODULES ]] && MODULES+=" sd_mod" + [[ $MODULES ]] && MODULES+=" sd_mod?" } help() { diff --git a/install/pcmcia b/install/pcmcia index b390497..2e9ac9a 100644 --- a/install/pcmcia +++ b/install/pcmcia @@ -4,9 +4,8 @@ build() { FILES="/etc/pcmcia/config.opts" MODULES=" $(checked_modules '/drivers/pcmcia/' | grep -ve 'sound' -e 'net') $(checked_modules '/ide/legacy')" - if [[ $MODULES ]]; then - MODULES+=" sd_mod" - fi + [[ $MODULES ]] MODULES+=" sd_mod?" + add_binary "/lib/udev/pcmcia-socket-startup" add_binary "/lib/udev/pcmcia-check-broken-cis" add_file "/lib/udev/rules.d/60-pcmcia.rules" diff --git a/install/sata b/install/sata index 39fe805..c9b67c3 100644 --- a/install/sata +++ b/install/sata @@ -6,7 +6,7 @@ build() { MODULES+=" $(checked_modules "$filter")" done - [[ $MODULES ]] && MODULES+=" sd_mod" + [[ $MODULES ]] && MODULES+=" sd_mod?" } help() { diff --git a/install/scsi b/install/scsi index fa9e5d9..4c2abc5 100644 --- a/install/scsi +++ b/install/scsi @@ -6,7 +6,7 @@ build(){ $(checked_modules "/block/" | grep -E '(cciss|cpqarray|DAC960)') $(checked_modules "/fusion/")" - [[ $MODULES ]] && MODULES+=" sd_mod" + [[ $MODULES ]] && MODULES+=" sd_mod?" } help() { diff --git a/install/usb b/install/usb index 61020ab..fcb2a47 100644 --- a/install/usb +++ b/install/usb @@ -1,10 +1,12 @@ #!/bin/bash build() { + local module= + MODULES="$(checked_modules "/usb/host" | grep -ve "_cs" -e "sl811_hcd" -e "isp116x_hcd")" if [[ $MODULES ]]; then - MODULES+=" usb_storage sd_mod sr_mod" + MODULES+=" usb_storage? sd_mod? sr_mod?" MODULES+=" $(checked_modules "drivers/usb/storage/ums-*")" fi } diff --git a/install/usbinput b/install/usbinput index aa4e1a6..f89d0bd 100644 --- a/install/usbinput +++ b/install/usbinput @@ -2,9 +2,7 @@ build() { MODULES=" $(checked_modules "/usb/host" | grep -ve "_cs" -e "sl811_hcd" -e "isp116x_hcd")" - MODULES+=" $(all_modules "/hid/hid-")" - - [[ $MODULES ]] && MODULES+=" usbhid" + MODULES+=" $(all_modules "/hid/hid-") usbhid?" } help() { |