[PATCH] Silence "cp: cannot stat '/etc/cmdline'..." error message

Will Woods wwoods at redhat.com
Thu Feb 28 16:44:46 UTC 2013


These files may or may not exist; check to see if they exist before
copying them!
---
 dracut/anaconda-copy-cmdline.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dracut/anaconda-copy-cmdline.sh b/dracut/anaconda-copy-cmdline.sh
index 26aa340..2731d6c 100755
--- a/dracut/anaconda-copy-cmdline.sh
+++ b/dracut/anaconda-copy-cmdline.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 # Copy over cmdline(.d) files from the initrd to /run before pivot
 mkdir -p /run/install/cmdline.d
-cp /etc/cmdline.d/* /run/install/cmdline.d/
-cp /etc/cmdline /run/install/
+for f in /etc/cmdline.d/*; do
+    [ -e $f ] && cp $f /run/install/cmdline.d/
+done
+[ -e /etc/cmdline ] && cp /etc/cmdline /run/install/
-- 
1.8.1.2



More information about the anaconda-patches mailing list