public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta/classes: Make sure the files exists before copying
@ 2019-11-08 11:41 vijaikumar.kanagarajan
  2019-11-08 17:10 ` Henning Schild
  0 siblings, 1 reply; 7+ messages in thread
From: vijaikumar.kanagarajan @ 2019-11-08 11:41 UTC (permalink / raw)
  To: isar-users; +Cc: Vijai Kumar K

From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>

By default realpath doesnot check if the file exists and hence
might return an invalid path. Use -e to check if the file actually
exists.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
 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..5b2eee0 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -128,12 +128,12 @@ EOF
 
 do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
 do_copy_boot_files() {
-    kernel="$(realpath -q '${IMAGE_ROOTFS}/${KERNEL_FILE}')"
+    kernel="$(realpath -eq '${IMAGE_ROOTFS}/${KERNEL_FILE}')"
     if [ -n "$kernel" ]; then
         cp -f "$kernel" '${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}'
     fi
 
-    initrd="$(realpath -q '${IMAGE_ROOTFS}/initrd.img')"
+    initrd="$(realpath -eq '${IMAGE_ROOTFS}/initrd.img')"
     if [ -n "$initrd" ]; then
         cp -f "$initrd" '${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}'
     fi
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-12-05 12:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 11:41 [PATCH] meta/classes: Make sure the files exists before copying 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
2019-12-05  9:36         ` Henning Schild
2019-12-05 12:55       ` Baurzhan Ismagulov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox