Skip to content

Commit dc267c7

Browse files
jamin-aspeedrpurdie
authored andcommitted
uboot-sign: Avoid symlink and install errors when SPL DTB is missing
Fix potential errors during do_deploy and deploy_spl_dtb when SPL_DTB_BINARY or SPL_BINARY is not present. Wrapped install command in deploy_spl_dtb() with a file existence check. Improved condition in do_deploy to check for actual existence of ${SPL_DIR}/${SPL_DTB_BINARY} instead of only relying on variable non-emptiness. Prevents "install: missing destination file operand" and invalid symlink creation. Signed-off-by: Jamin Lin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
1 parent bb9729c commit dc267c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

meta/classes-recipe/uboot-sign.bbclass

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ deploy_spl_dtb() {
275275
fi
276276

277277
# For backwards compatibility...
278-
install -Dm644 ${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
278+
if [ -e "${SPL_BINARY}" ]; then
279+
install -Dm644 ${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
280+
fi
279281
}
280282

281283
do_uboot_generate_rsa_keys() {
@@ -600,7 +602,7 @@ do_deploy:prepend() {
600602
ln -sf ${UBOOT_FITIMAGE_IMAGE} ${DEPLOYDIR}/${UBOOT_FITIMAGE_SYMLINK}
601603
fi
602604

603-
if [ "${SPL_SIGN_ENABLE}" = "1" -a -n "${SPL_DTB_BINARY}" ] ; then
605+
if [ "${SPL_SIGN_ENABLE}" = "1" -a -e "${SPL_DIR}/${SPL_DTB_BINARY}" ] ; then
604606
ln -sf ${SPL_DTB_IMAGE} ${DEPLOYDIR}/${SPL_DTB_SYMLINK}
605607
ln -sf ${SPL_DTB_IMAGE} ${DEPLOYDIR}/${SPL_DTB_BINARY}
606608
ln -sf ${SPL_NODTB_IMAGE} ${DEPLOYDIR}/${SPL_NODTB_SYMLINK}

0 commit comments

Comments
 (0)