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