summaryrefslogtreecommitdiffstats
path: root/meta/classes/uboot-sign.bbclass
diff options
context:
space:
mode:
authorAndrej Valek <andrej.valek@siemens.com>2021-10-16 22:01:46 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-18 13:48:17 +0100
commit2b5f5e295e9a2765809929fda4e0a76c77e4a6fe (patch)
tree0561d69533fac1d956285cf330bf0778c9b5fe43 /meta/classes/uboot-sign.bbclass
parentd3b5389e7dfe082b872ffbd290578ed216603cc3 (diff)
downloadpoky-2b5f5e295e9a2765809929fda4e0a76c77e4a6fe.tar.gz
featimage: refactor style
- use bash variable notation without {} where possible - just to make sure it looks like bash variable not bitbake variable one - fix indent style in "cat" commands - replace "! -z" -> "-n" - make debug info in ramdisk section creation more verbose (From OE-Core rev: f44bb458884da64356ee188917094b5515d3b159) Signed-off-by: Andrej Valek <andrej.valek@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/uboot-sign.bbclass')
-rw-r--r--meta/classes/uboot-sign.bbclass56
1 files changed, 28 insertions, 28 deletions
diff --git a/meta/classes/uboot-sign.bbclass b/meta/classes/uboot-sign.bbclass
index fdf153248c..bae8cada0a 100644
--- a/meta/classes/uboot-sign.bbclass
+++ b/meta/classes/uboot-sign.bbclass
@@ -162,8 +162,8 @@ concat_dtb() {
162 mkdir -p ${DEPLOYDIR} 162 mkdir -p ${DEPLOYDIR}
163 if [ -n "${UBOOT_CONFIG}" ]; then 163 if [ -n "${UBOOT_CONFIG}" ]; then
164 for config in ${UBOOT_MACHINE}; do 164 for config in ${UBOOT_MACHINE}; do
165 CONFIG_B_PATH="${config}" 165 CONFIG_B_PATH="$config"
166 cd ${B}/${config} 166 cd ${B}/$config
167 concat_dtb_helper 167 concat_dtb_helper
168 done 168 done
169 else 169 else
@@ -179,8 +179,8 @@ concat_spl_dtb() {
179 mkdir -p ${DEPLOYDIR} 179 mkdir -p ${DEPLOYDIR}
180 if [ -n "${UBOOT_CONFIG}" ]; then 180 if [ -n "${UBOOT_CONFIG}" ]; then
181 for config in ${UBOOT_MACHINE}; do 181 for config in ${UBOOT_MACHINE}; do
182 CONFIG_B_PATH="${config}" 182 CONFIG_B_PATH="$config"
183 cd ${B}/${config} 183 cd ${B}/$config
184 concat_spl_dtb_helper 184 concat_spl_dtb_helper
185 done 185 done
186 else 186 else
@@ -231,7 +231,7 @@ do_install:append() {
231 if [ "${PN}" = "${UBOOT_PN}" ]; then 231 if [ "${PN}" = "${UBOOT_PN}" ]; then
232 if [ -n "${UBOOT_CONFIG}" ]; then 232 if [ -n "${UBOOT_CONFIG}" ]; then
233 for config in ${UBOOT_MACHINE}; do 233 for config in ${UBOOT_MACHINE}; do
234 cd ${B}/${config} 234 cd ${B}/$config
235 if [ "${UBOOT_SIGN_ENABLE}" = "1" -o "${UBOOT_FITIMAGE_ENABLE}" = "1" ] && \ 235 if [ "${UBOOT_SIGN_ENABLE}" = "1" -o "${UBOOT_FITIMAGE_ENABLE}" = "1" ] && \
236 [ -n "${UBOOT_DTB_BINARY}" ]; then 236 [ -n "${UBOOT_DTB_BINARY}" ]; then
237 install_helper 237 install_helper
@@ -286,19 +286,19 @@ addtask uboot_generate_rsa_keys before do_uboot_assemble_fitimage after do_compi
286# Create a ITS file for the U-boot FIT, for use when 286# Create a ITS file for the U-boot FIT, for use when
287# we want to sign it so that the SPL can verify it 287# we want to sign it so that the SPL can verify it
288uboot_fitimage_assemble() { 288uboot_fitimage_assemble() {
289 uboot_its="${1}" 289 uboot_its="$1"
290 uboot_nodtb_bin="${2}" 290 uboot_nodtb_bin="$2"
291 uboot_dtb="${3}" 291 uboot_dtb="$3"
292 uboot_bin="${4}" 292 uboot_bin="$4"
293 spl_dtb="${5}" 293 spl_dtb="$5"
294 uboot_csum="${UBOOT_FIT_HASH_ALG}" 294 uboot_csum="${UBOOT_FIT_HASH_ALG}"
295 uboot_sign_algo="${UBOOT_FIT_SIGN_ALG}" 295 uboot_sign_algo="${UBOOT_FIT_SIGN_ALG}"
296 uboot_sign_keyname="${SPL_SIGN_KEYNAME}" 296 uboot_sign_keyname="${SPL_SIGN_KEYNAME}"
297 297
298 rm -f ${uboot_its} ${uboot_bin} 298 rm -f $uboot_its $uboot_bin
299 299
300 # First we create the ITS script 300 # First we create the ITS script
301 cat << EOF >> ${uboot_its} 301 cat << EOF >> $uboot_its
302/dts-v1/; 302/dts-v1/;
303 303
304/ { 304/ {
@@ -308,7 +308,7 @@ uboot_fitimage_assemble() {
308 images { 308 images {
309 uboot { 309 uboot {
310 description = "U-Boot image"; 310 description = "U-Boot image";
311 data = /incbin/("${uboot_nodtb_bin}"); 311 data = /incbin/("$uboot_nodtb_bin");
312 type = "standalone"; 312 type = "standalone";
313 os = "u-boot"; 313 os = "u-boot";
314 arch = "${UBOOT_ARCH}"; 314 arch = "${UBOOT_ARCH}";
@@ -318,34 +318,34 @@ uboot_fitimage_assemble() {
318EOF 318EOF
319 319
320 if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then 320 if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then
321 cat << EOF >> ${uboot_its} 321 cat << EOF >> $uboot_its
322 signature { 322 signature {
323 algo = "${uboot_csum},${uboot_sign_algo}"; 323 algo = "$uboot_csum,$uboot_sign_algo";
324 key-name-hint = "${uboot_sign_keyname}"; 324 key-name-hint = "$uboot_sign_keyname";
325 }; 325 };
326EOF 326EOF
327 fi 327 fi
328 328
329 cat << EOF >> ${uboot_its} 329 cat << EOF >> $uboot_its
330 }; 330 };
331 fdt { 331 fdt {
332 description = "U-Boot FDT"; 332 description = "U-Boot FDT";
333 data = /incbin/("${uboot_dtb}"); 333 data = /incbin/("$uboot_dtb");
334 type = "flat_dt"; 334 type = "flat_dt";
335 arch = "${UBOOT_ARCH}"; 335 arch = "${UBOOT_ARCH}";
336 compression = "none"; 336 compression = "none";
337EOF 337EOF
338 338
339 if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then 339 if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then
340 cat << EOF >> ${uboot_its} 340 cat << EOF >> $uboot_its
341 signature { 341 signature {
342 algo = "${uboot_csum},${uboot_sign_algo}"; 342 algo = "$uboot_csum,$uboot_sign_algo";
343 key-name-hint = "${uboot_sign_keyname}"; 343 key-name-hint = "$uboot_sign_keyname";
344 }; 344 };
345EOF 345EOF
346 fi 346 fi
347 347
348 cat << EOF >> ${uboot_its} 348 cat << EOF >> $uboot_its
349 }; 349 };
350 }; 350 };
351 351
@@ -365,8 +365,8 @@ EOF
365 # 365 #
366 ${UBOOT_MKIMAGE} \ 366 ${UBOOT_MKIMAGE} \
367 ${@'-D "${SPL_MKIMAGE_DTCOPTS}"' if len('${SPL_MKIMAGE_DTCOPTS}') else ''} \ 367 ${@'-D "${SPL_MKIMAGE_DTCOPTS}"' if len('${SPL_MKIMAGE_DTCOPTS}') else ''} \
368 -f ${uboot_its} \ 368 -f $uboot_its \
369 ${uboot_bin} 369 $uboot_bin
370 370
371 if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then 371 if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then
372 # 372 #
@@ -375,8 +375,8 @@ EOF
375 ${UBOOT_MKIMAGE_SIGN} \ 375 ${UBOOT_MKIMAGE_SIGN} \
376 ${@'-D "${SPL_MKIMAGE_DTCOPTS}"' if len('${SPL_MKIMAGE_DTCOPTS}') else ''} \ 376 ${@'-D "${SPL_MKIMAGE_DTCOPTS}"' if len('${SPL_MKIMAGE_DTCOPTS}') else ''} \
377 -F -k "${SPL_SIGN_KEYDIR}" \ 377 -F -k "${SPL_SIGN_KEYDIR}" \
378 -K "${spl_dtb}" \ 378 -K "$spl_dtb" \
379 -r ${uboot_bin} \ 379 -r $uboot_bin \
380 ${SPL_MKIMAGE_SIGN_ARGS} 380 ${SPL_MKIMAGE_SIGN_ARGS}
381 fi 381 fi
382 382
@@ -408,8 +408,8 @@ do_uboot_assemble_fitimage() {
408 kernel_uboot_fitimage_name=`basename ${STAGING_DATADIR}/u-boot-fitImage-*` 408 kernel_uboot_fitimage_name=`basename ${STAGING_DATADIR}/u-boot-fitImage-*`
409 kernel_uboot_its_name=`basename ${STAGING_DATADIR}/u-boot-its-*` 409 kernel_uboot_its_name=`basename ${STAGING_DATADIR}/u-boot-its-*`
410 cd ${B} 410 cd ${B}
411 uboot_fitimage_assemble ${kernel_uboot_its_name} ${UBOOT_NODTB_BINARY} \ 411 uboot_fitimage_assemble $kernel_uboot_its_name ${UBOOT_NODTB_BINARY} \
412 ${UBOOT_DTB_BINARY} ${kernel_uboot_fitimage_name} \ 412 ${UBOOT_DTB_BINARY} $kernel_uboot_fitimage_name \
413 ${SPL_DTB_BINARY} 413 ${SPL_DTB_BINARY}
414 fi 414 fi
415} 415}