summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-03-13 03:35:40 +0100
committerDave Reisner <dreisner@archlinux.org>2013-03-13 03:35:40 +0100
commit366bb180aa44bd8b4478e0dee94bf17be0dd82d8 (patch)
tree476e86bd161756dc30715597108ec7152275e6b5
parent2817345084849fcc0231910b52146f206164bdd6 (diff)
downloadmkinitcpio-366bb180aa44bd8b4478e0dee94bf17be0dd82d8.tar.gz
mkinitcpio-366bb180aa44bd8b4478e0dee94bf17be0dd82d8.tar.xz
autodetect: allow whitelisting by MODULE_FS_ALIAS
Linux 3.9 adds a filesystem alias in the supporting module in the form of fs-$filesystem. While this is mainly aimed at security/paranoia, it does mean that we can make better use of the fact that we always resolve filesystem as aliases to filesystem modules. Do an additional lookup in add_if_avail to resolve the new alias in addition to the filesystem name itself. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--install/autodetect8
1 files changed, 5 insertions, 3 deletions
diff --git a/install/autodetect b/install/autodetect
index 907a85a..d6e9e29 100644
--- a/install/autodetect
+++ b/install/autodetect
@@ -5,11 +5,13 @@ build() {
local -a md_devs mods
add_if_avail() {
- local r= resolved=
+ local r= resolved=()
- # treat this as an alias, since ext3 might be aliased to ext4.
+ # treat this as an alias, since ext3 might be aliased to ext4. also, as
+ # of linux 3.9, we can find any filesystem by the alias "fs-$name"
+ # rather than having to guess at the corresponding module name.
IFS=$'\n' read -rd '' -a resolved < \
- <(modprobe -d "$_optmoduleroot" -S "$KERNELVERSION" -R "$1" 2>/dev/null)
+ <(modprobe -d "$_optmoduleroot" -S "$KERNELVERSION" -Ra {fs-,}"$1" 2>/dev/null)
for r in "${resolved[@]}"; do
_autodetect_cache["$r"]=1