* [PATCH] uboot-sign: Fix build when UBOOT_DTB_BINARY is empty
@ 2019-04-17 18:31 Alex Kiernan
2019-05-02 17:16 ` Alex Kiernan
0 siblings, 1 reply; 2+ messages in thread
From: Alex Kiernan @ 2019-04-17 18:31 UTC (permalink / raw)
To: openembedded-core
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")
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
meta/classes/uboot-sign.bbclass | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/meta/classes/uboot-sign.bbclass b/meta/classes/uboot-sign.bbclass
index 2da43655aabb..6385a06c13ef 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}"
UBOOT_PN = "${@d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'}"
concat_dtb_helper() {
- if [ -e ${UBOOT_DTB_BINARY} ]; then
+ if [ -e "${UBOOT_DTB_BINARY}" ]; then
ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_BINARY}
ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_SYMLINK}
fi
- if [ -f ${UBOOT_NODTB_BINARY} ]; then
+ if [ -f "${UBOOT_NODTB_BINARY}" ]; then
install ${UBOOT_NODTB_BINARY} ${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}
ln -sf ${UBOOT_NODTB_IMAGE} ${UBOOT_NODTB_SYMLINK}
ln -sf ${UBOOT_NODTB_IMAGE} ${UBOOT_NODTB_BINARY}
@@ -67,13 +67,13 @@ concat_dtb_helper() {
elif [ -e "${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}" -a -e "$deployed_uboot_dtb_binary" ]; then
cd ${DEPLOYDIR}
cat ${UBOOT_NODTB_IMAGE} $deployed_uboot_dtb_binary | tee ${UBOOT_BINARY} > ${UBOOT_IMAGE}
- elif [ -n "${UBOOT_DTB_BINARY}" ]; then
+ else
bbwarn "Failure while adding public key to u-boot binary. Verified boot won't be available."
fi
}
concat_dtb() {
- if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" ]; then
+ if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" -a -n "${UBOOT_DTB_BINARY}" ]; then
mkdir -p ${DEPLOYDIR}
if [ -n "${UBOOT_CONFIG}" ]; then
for config in ${UBOOT_MACHINE}; do
@@ -90,19 +90,19 @@ concat_dtb() {
# Install UBOOT_DTB_BINARY to datadir, so that kernel can use it for
# signing, and kernel will deploy UBOOT_DTB_BINARY after signs it.
install_helper() {
- if [ -f ${UBOOT_DTB_BINARY} ]; then
+ if [ -f "${UBOOT_DTB_BINARY}" ]; then
install -d ${D}${datadir}
# UBOOT_DTB_BINARY is a symlink to UBOOT_DTB_IMAGE, so we
# need both of them.
install ${UBOOT_DTB_BINARY} ${D}${datadir}/${UBOOT_DTB_IMAGE}
ln -sf ${UBOOT_DTB_IMAGE} ${D}${datadir}/${UBOOT_DTB_BINARY}
- elif [ -n "${UBOOT_DTB_BINARY}" ]; then
+ else
bbwarn "${UBOOT_DTB_BINARY} not found"
fi
}
do_install_append() {
- if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" ]; then
+ if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${PN}" = "${UBOOT_PN}" -a -n "${UBOOT_DTB_BINARY}" ]; then
if [ -n "${UBOOT_CONFIG}" ]; then
for config in ${UBOOT_MACHINE}; do
cd ${B}/${config}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] uboot-sign: Fix build when UBOOT_DTB_BINARY is empty
2019-04-17 18:31 [PATCH] uboot-sign: Fix build when UBOOT_DTB_BINARY is empty Alex Kiernan
@ 2019-05-02 17:16 ` Alex Kiernan
0 siblings, 0 replies; 2+ messages in thread
From: Alex Kiernan @ 2019-05-02 17:16 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Wed, Apr 17, 2019 at 7:31 PM Alex Kiernan <alex.kiernan@gmail.com> wrote:
>
> 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")
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> ---
Ping?
--
Alex Kiernan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-02 17:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 18:31 [PATCH] uboot-sign: Fix build when UBOOT_DTB_BINARY is empty Alex Kiernan
2019-05-02 17:16 ` Alex Kiernan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.