From 1ac0adf4052ff7e0258fcf5f745f19551de3faa5 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 4 Mar 2012 16:46:55 -0500 Subject: mkinitcpio: dedupe MODPATHS array before installation The only reason this has to be done is because of the Kconfig option that reuses the ext4 module for ext[23], thereby aliasing ext[23] to ext4. This is (currently) the only case in the whole kernel where valid module names magically become aliases. Signed-off-by: Dave Reisner --- mkinitcpio | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkinitcpio b/mkinitcpio index 9f39d56..c6528e9 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -358,7 +358,8 @@ parse_hook trap '(( ++builderrors ))' ERR if (( ${#ADDED_MODULES[*]} )); then - cp "${MODPATHS[@]}" "$BUILDROOT/lib/modules/$KERNELVERSION/kernel" + printf '%s\0' "${MODPATHS[@]}" | sort -zu | + xargs -0 cp -t "$BUILDROOT/lib/modules/$KERNELVERSION/kernel" # unzip modules prior to recompression gzip -dr "$BUILDROOT/lib/modules/$KERNELVERSION/kernel" -- cgit v1.2.3-24-g4f1b