Parcourir la source

u-boot: Check if ${UBOOT_ENV}.txt exists before using it

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Alistair Francis il y a 5 ans
Parent
commit
15696914b9
1 fichiers modifiés avec 8 ajouts et 4 suppressions
  1. 8 4
      recipes-bsp/u-boot/u-boot_2019.04.bbappend

+ 8 - 4
recipes-bsp/u-boot/u-boot_2019.04.bbappend

@@ -32,13 +32,17 @@ TFTP_SERVER_IP ?= "127.0.0.1"
 do_configure_prepend() {
     sed -i -e 's,@SERVERIP@,${TFTP_SERVER_IP},g' ${S}/include/configs/sifive-fu540.h
 
-    mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" \
-        -d ${WORKDIR}/${UBOOT_ENV}.txt ${WORKDIR}/boot.scr.uimg
+    if [ -f "${WORKDIR}/${UBOOT_ENV}.txt" ]; then
+        mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" \
+            -d ${WORKDIR}/${UBOOT_ENV}.txt ${WORKDIR}/boot.scr.uimg
+    fi
 }
 
 do_deploy_append () {
-      install -d ${DEPLOY_DIR_IMAGE}
-      install -m 755 ${WORKDIR}/boot.scr.uimg ${DEPLOY_DIR_IMAGE}/
+    if [ -f "${WORKDIR}/boot.scr.uimg" ]; then
+        install -d ${DEPLOY_DIR_IMAGE}
+        install -m 755 ${WORKDIR}/boot.scr.uimg ${DEPLOY_DIR_IMAGE}
+    fi
 }
 
 addtask deploy after do_install