summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2019-04-17 18:31:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-03 06:11:57 +0100
commitd9e8b11b6c04445512de0739632ce9a8b5b1f653 (patch)
treeb8cb970965e03bd8815e1f2a27327d47690a64a3 /meta/classes
parent0552d9536be8354114a6a7e25c5205a5ca7a24b4 (diff)
downloadpoky-d9e8b11b6c04445512de0739632ce9a8b5b1f653.tar.gz
uboot-sign: Fix build when UBOOT_DTB_BINARY is empty
When UBOOT_DTB_BINARY is empty and because the code now changes directory into ${B}, the test for the existence becomes `[ -f ]` which succeeds and subsequently the install fails. Reorder the code so it's clear that UBOOT_DTB_BINARY empty is an expected configuration and then quote UBOOT_DTB_BINARY everywhere so no one trips over this again. Fixes: bacb59079eb6 ("uboot-sign: add support for different u-boot configurations") (From OE-Core rev: e79f0db0745625b35dd83483747e486d08eebfde) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/uboot-sign.bbclass14
1 files changed, 7 insertions, 7 deletions
diff --git a/meta/classes/uboot-sign.bbclass b/meta/classes/uboot-sign.bbclass
index 2da43655aa..6385a06c13 100644
--- a/meta/classes/uboot-sign.bbclass
+++ b/meta/classes/uboot-sign.bbclass
@@ -46,12 +46,12 @@ UBOOT_NODTB_SYMLINK ?= "u-boot-nodtb-${MACHINE}.${UBOOT_SUFFIX}"
46UBOOT_PN = "${@d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'}" 46UBOOT_PN = "${@d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'}"
47 47
48concat_dtb_helper() { 48concat_dtb_helper() {
49 if [ -e ${UBOOT_DTB_BINARY} ]; then 49 if [ -e "${UBOOT_DTB_BINARY}" ]; then
50 ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_BINARY} 50 ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_BINARY}
51 ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_SYMLINK} 51 ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_SYMLINK}
52 fi 52 fi
53 53
54 if [ -f ${UBOOT_NODTB_BINARY} ]; then 54 if [ -f "${UBOOT_NODTB_BINARY}" ]; then
55 install ${UBOOT_NODTB_BINARY} ${DEPLOYDIR}/${UBOOT_NODTB_IMAGE} 55 install ${UBOOT_NODTB_BINARY} ${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}
56 ln -sf ${UBOOT_NODTB_IMAGE} ${UBOOT_NODTB_SYMLINK} 56 ln -sf ${UBOOT_NODTB_IMAGE} ${UBOOT_NODTB_SYMLINK}
57 ln -sf ${UBOOT_NODTB_IMAGE} ${UBOOT_NODTB_BINARY} 57 ln -sf ${UBOOT_NODTB_IMAGE} ${UBOOT_NODTB_BINARY}
@@ -67,13 +67,13 @@ concat_dtb_helper() {
67 elif [ -e "${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}" -a -e "$deployed_uboot_dtb_binary" ]; then 67 elif [ -e "${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}" -a -e "$deployed_uboot_dtb_binary" ]; then
68 cd ${DEPLOYDIR} 68 cd ${DEPLOYDIR}
69 cat ${UBOOT_NODTB_IMAGE} $deployed_uboot_dtb_binary | tee ${UBOOT_BINARY} > ${UBOOT_IMAGE} 69 cat ${UBOOT_NODTB_IMAGE} $deployed_uboot_dtb_binary | tee ${UBOOT_BINARY} > ${UBOOT_IMAGE}
70 elif [ -n "${UBOOT_DTB_BINARY}" ]; then 70 else
71 bbwarn "Failure while adding public key to u-boot binary. Verified boot won't be available." 71 bbwarn "Failure while adding public key to u-boot binary. Verified boot won't be available."
72 fi 72 fi
73} 73}
74 74
75concat_dtb() { 75concat_dtb() {
76 if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" ]; then 76 if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" -a -n "${UBOOT_DTB_BINARY}" ]; then
77 mkdir -p ${DEPLOYDIR} 77 mkdir -p ${DEPLOYDIR}
78 if [ -n "${UBOOT_CONFIG}" ]; then 78 if [ -n "${UBOOT_CONFIG}" ]; then
79 for config in ${UBOOT_MACHINE}; do 79 for config in ${UBOOT_MACHINE}; do
@@ -90,19 +90,19 @@ concat_dtb() {
90# Install UBOOT_DTB_BINARY to datadir, so that kernel can use it for 90# Install UBOOT_DTB_BINARY to datadir, so that kernel can use it for
91# signing, and kernel will deploy UBOOT_DTB_BINARY after signs it. 91# signing, and kernel will deploy UBOOT_DTB_BINARY after signs it.
92install_helper() { 92install_helper() {
93 if [ -f ${UBOOT_DTB_BINARY} ]; then 93 if [ -f "${UBOOT_DTB_BINARY}" ]; then
94 install -d ${D}${datadir} 94 install -d ${D}${datadir}
95 # UBOOT_DTB_BINARY is a symlink to UBOOT_DTB_IMAGE, so we 95 # UBOOT_DTB_BINARY is a symlink to UBOOT_DTB_IMAGE, so we
96 # need both of them. 96 # need both of them.
97 install ${UBOOT_DTB_BINARY} ${D}${datadir}/${UBOOT_DTB_IMAGE} 97 install ${UBOOT_DTB_BINARY} ${D}${datadir}/${UBOOT_DTB_IMAGE}
98 ln -sf ${UBOOT_DTB_IMAGE} ${D}${datadir}/${UBOOT_DTB_BINARY} 98 ln -sf ${UBOOT_DTB_IMAGE} ${D}${datadir}/${UBOOT_DTB_BINARY}
99 elif [ -n "${UBOOT_DTB_BINARY}" ]; then 99 else
100 bbwarn "${UBOOT_DTB_BINARY} not found" 100 bbwarn "${UBOOT_DTB_BINARY} not found"
101 fi 101 fi
102} 102}
103 103
104do_install_append() { 104do_install_append() {
105 if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" ]; then 105 if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" -a -n "${UBOOT_DTB_BINARY}" ]; then
106 if [ -n "${UBOOT_CONFIG}" ]; then 106 if [ -n "${UBOOT_CONFIG}" ]; then
107 for config in ${UBOOT_MACHINE}; do 107 for config in ${UBOOT_MACHINE}; do
108 cd ${B}/${config} 108 cd ${B}/${config}