From aaa3a807aea06c813781ddb665fba7d0785ccf50 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 3 Jul 2012 10:35:01 +0200 Subject: [PATCH] dracut: backport a patch to make xargs use -r and ignore empty input. --- .../dracut/patches/dracut-xarguments.patch | 76 +++++++++++++++++++ srcpkgs/dracut/template | 2 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/dracut/patches/dracut-xarguments.patch diff --git a/srcpkgs/dracut/patches/dracut-xarguments.patch b/srcpkgs/dracut/patches/dracut-xarguments.patch new file mode 100644 index 00000000000..da7a7deaf3f --- /dev/null +++ b/srcpkgs/dracut/patches/dracut-xarguments.patch @@ -0,0 +1,76 @@ +--- dracut.sh.orig 2012-07-03 10:08:45.753718694 +0200 ++++ dracut.sh 2012-07-03 10:08:53.968524889 +0200 +@@ -825,7 +825,7 @@ if [[ $kernel_only != yes ]]; then + find "$initdir" -type f \ + '(' -perm -0100 -or -perm -0010 -or -perm -0001 ')' \ + -not -path '*.ko' -print0 \ +- | xargs -0 dracut-install ${initdir+-D "$initdir"} -R ${DRACUT_FIPS_MODE+-H} ++ | xargs -r -0 dracut-install ${initdir+-D "$initdir"} -R ${DRACUT_FIPS_MODE+-H} + dinfo "*** Resolving executable dependencies done***" + fi + +@@ -849,7 +849,7 @@ fi + + # strip binaries + if [[ $do_strip = yes ]] ; then +- for p in strip xargs find; do ++ for p in strip xargs -r find; do + if ! type -P $p >/dev/null; then + derror "Could not find '$p'. You should run $0 with '--nostrip'." + do_strip=no +@@ -877,7 +877,7 @@ if [[ $do_strip = yes ]] ; then + find "$initdir" -type f \ + '(' -perm -0100 -or -perm -0010 -or -perm -0001 \ + -or -path '*/lib/modules/*.ko' ')' -print0 \ +- | xargs -0 strip -g 2>/dev/null ++ | xargs -r -0 strip -g 2>/dev/null + dinfo "*** Stripping files done ***" + fi + +--- dracut-functions.sh.orig 2012-07-03 10:09:04.056286970 +0200 ++++ dracut-functions.sh 2012-07-03 10:09:19.674415038 +0200 +@@ -1182,7 +1182,7 @@ dracut_kernel_post() { + local _moddirname=${srcmods%%/lib/modules/*} + + if [[ -f "$initdir/.kernelmodseen/lazylist" ]]; then +- xargs modprobe -a ${_moddirname+-d ${_moddirname}/} --ignore-install --show-depends \ ++ xargs -r modprobe -a ${_moddirname+-d ${_moddirname}/} --ignore-install --show-depends \ + < "$initdir/.kernelmodseen/lazylist" 2>/dev/null \ + | sort -u \ + | while read _cmd _modpath _options; do +@@ -1192,7 +1192,7 @@ dracut_kernel_post() { + + ( + if [[ -x /usr/bin/dracut-install ]] && [[ -z $_moddirname ]]; then +- xargs dracut-install ${initdir+-D "$initdir"} -a < "$initdir/.kernelmodseen/lazylist.dep" ++ xargs -r dracut-install ${initdir+-D "$initdir"} -a < "$initdir/.kernelmodseen/lazylist.dep" + else + while read _modpath; do + local _destpath=$_modpath +@@ -1205,14 +1205,14 @@ dracut_kernel_post() { + + + if [[ -x /usr/bin/dracut-install ]]; then +- xargs modinfo -k $kernel -F firmware < "$initdir/.kernelmodseen/lazylist.dep" \ ++ xargs -r modinfo -k $kernel -F firmware < "$initdir/.kernelmodseen/lazylist.dep" \ + | while read line; do + for _fwdir in $fw_dir; do + echo $_fwdir/$line; + done; +- done |xargs dracut-install ${initdir+-D "$initdir"} -a -o ++ done |xargs -r dracut-install ${initdir+-D "$initdir"} -a -o + else +- for _fw in $(xargs modinfo -k $kernel -F firmware < "$initdir/.kernelmodseen/lazylist.dep"); do ++ for _fw in $(xargs -r modinfo -k $kernel -F firmware < "$initdir/.kernelmodseen/lazylist.dep"); do + for _fwdir in $fw_dir; do + if [[ -d $_fwdir && -f $_fwdir/$_fw ]]; then + inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw" +@@ -1258,7 +1258,7 @@ find_kernel_modules_by_path () ( + IFS=$_OLDIFS + else + ( cd /sys/module; echo *; ) \ +- | xargs modinfo -F filename -k $kernel 2>/dev/null ++ | xargs -r modinfo -F filename -k $kernel 2>/dev/null + fi + return 0 + ) diff --git a/srcpkgs/dracut/template b/srcpkgs/dracut/template index 1928986ce90..b9aad28b9d5 100644 --- a/srcpkgs/dracut/template +++ b/srcpkgs/dracut/template @@ -1,7 +1,7 @@ # Template file for 'dracut' pkgname=dracut version=020 -revision=4 +revision=5 build_style=gnu-makefile make_build_args="sysconfdir=/etc systemdsystemunitdir=/lib/systemd/system" make_install_args="sysconfdir=/etc systemdsystemunitdir=/lib/systemd/system"