[arch-projects] [mkinitcpio][PATCH 09/26] functions: specify the delimiter to xargs

Dave Reisner d at falconindy.com
Mon Sep 26 21:22:10 EDT 2011


Without specifying this, xargs will split arguments on whitespace as
well as newlines, and will interpret quoting and backslashes. When the
delimiter is specified, every character is taken literally and only the
given delimiter in honored.

This sidesteps issues with broken modalias files as evidenced by a
MacBookAir3,1 or the bbs thread below:

https://bbs.archlinux.org/viewtopic.php?pid=971853

Also fixes FS#25450.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 functions |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/functions b/functions
index 8ce24ea..7f9202f 100644
--- a/functions
+++ b/functions
@@ -117,7 +117,7 @@ auto_modules() {
 
     IFS=$'\n' read -rd '' -a mods < \
         <(find /sys/devices -name modalias -exec sort -u {} + |
-        xargs modprobe -d "$BASEDIR" -aRS "$KERNELVERSION" |
+        xargs -d $'\n' modprobe -d "$BASEDIR" -aRS "$KERNELVERSION" |
         sort -u)
 
     printf "%s\n" "${mods[@]//-/_}"
-- 
1.7.6.4



More information about the arch-projects mailing list