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

Brian C. Lane bcl at redhat.com
Thu Feb 28 18:35:43 UTC 2013


On Thu, Feb 28, 2013 at 11:44:46AM -0500, Will Woods wrote:
> 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/

You don't really need that -e there since it's iterating over what's in
the directory.

> +done
> +[ -e /etc/cmdline ] && cp /etc/cmdline /run/install/
> -- 
> 1.8.1.2

Ack otherwise.


-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20130228/e1daca0a/attachment.sig>


More information about the anaconda-patches mailing list