public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: vijai kumar <vijaikumar.kanagarajan@gmail.com>
To: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH v2] meta/classes: Make sure the files exists before copying
Date: Mon, 2 Dec 2019 21:33:11 -0800 (PST)	[thread overview]
Message-ID: <2f0e4ece-4ab7-4d5e-8db8-65d2fdb0ddc4@googlegroups.com> (raw)
In-Reply-To: <20191108174735.9998-1-Vijaikumar_Kangarajan@mentor.com>


[-- Attachment #1.1: Type: text/plain, Size: 1335 bytes --]

Can this be merged to next??

Thanks,
Vijai Kumar K

On Friday, November 8, 2019 at 11:17:45 PM UTC+5:30, vijai kumar wrote:
>
> From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com> 
>
> By default realpath doesnot check if the file exists and hence 
> might return an invalid path. 
>
> Check if file exists before copying. 
>
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com> 
> --- 
> Changes in v2: 
>   - Use -f in if condition instead of realpath -e to make code 
> more readable. 
>
>  meta/classes/image.bbclass | 4 ++-- 
>  1 file changed, 2 insertions(+), 2 deletions(-) 
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass 
> index 8384b71..c845eab 100644 
> --- a/meta/classes/image.bbclass 
> +++ b/meta/classes/image.bbclass 
> @@ -129,12 +129,12 @@ EOF 
>  do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}" 
>  do_copy_boot_files() { 
>      kernel="$(realpath -q '${IMAGE_ROOTFS}/${KERNEL_FILE}')" 
> -    if [ -n "$kernel" ]; then 
> +    if [ -f "$kernel" ]; then 
>          cp -f "$kernel" '${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}' 
>      fi 
>   
>      initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img')" 
> -    if [ -n "$initrd" ]; then 
> +    if [ -f "$initrd" ]; then 
>          cp -f "$initrd" '${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}' 
>      fi 
>   
> -- 
> 2.17.1 
>
>

[-- Attachment #1.2: Type: text/html, Size: 2334 bytes --]

  reply	other threads:[~2019-12-03  5:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 11:41 [PATCH] " vijaikumar.kanagarajan
2019-11-08 17:10 ` Henning Schild
2019-11-08 17:41   ` Vijai Kumar K
2019-11-08 17:47     ` [PATCH v2] " vijaikumar.kanagarajan
2019-12-03  5:33       ` vijai kumar [this message]
2019-12-05  9:36         ` Henning Schild
2019-12-05 12:55       ` Baurzhan Ismagulov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f0e4ece-4ab7-4d5e-8db8-65d2fdb0ddc4@googlegroups.com \
    --to=vijaikumar.kanagarajan@gmail.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox