From 84226d26c065b3c1eb6f2dcf551f416d284278d5 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 7 Aug 2011 10:17:01 -0400 Subject: functions: specify the delimiter to xargs 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 --- functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions b/functions index 8ce24ea..8eef5b8 100644 --- a/functions +++ b/functions @@ -117,7 +117,8 @@ auto_modules() { IFS=$'\n' read -rd '' -a mods < \ <(find /sys/devices -name modalias -exec sort -u {} + | - xargs modprobe -d "$BASEDIR" -aRS "$KERNELVERSION" | + # delimit each input by a newline, expanded in place + xargs -d $'\n' modprobe -d "$BASEDIR" -aRS "$KERNELVERSION" | sort -u) printf "%s\n" "${mods[@]//-/_}" -- cgit v1.2.3-24-g4f1b