summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorEaswar Hariharan <eahariha@microsoft.com>2020-12-16 18:51:36 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-20 00:03:04 +0000
commit77c3e43fc6cfa484f88b925007a04541abf216f6 (patch)
tree7f7e8e29cc87677472993a5e4c10b373c2060685 /meta/classes
parentbe137b89585221ec6924e02fbc89decd9750d7e1 (diff)
downloadpoky-77c3e43fc6cfa484f88b925007a04541abf216f6.tar.gz
classes/kernel-fitimage: make fitimage_emit_section_config more readable
fitimage_emit_section_config() has a number of arguments, add named variables to make the function a bit more readable. (From OE-Core rev: a82340eed3165825c129c1f2b1ebf250e0e699c2) Signed-off-by: Easwar Hariharan <eahariha@microsoft.com> Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/kernel-fitimage.bbclass53
1 files changed, 30 insertions, 23 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index f121eee274..f3d18e22cf 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -273,6 +273,13 @@ fitimage_emit_section_config() {
273 conf_sign_keyname="${UBOOT_SIGN_KEYNAME}" 273 conf_sign_keyname="${UBOOT_SIGN_KEYNAME}"
274 fi 274 fi
275 275
276 its_file="${1}"
277 kernel_id="${2}"
278 dtb_image="${3}"
279 ramdisk_id="${4}"
280 config_id="${5}"
281 default_flag="${6}"
282
276 # Test if we have any DTBs at all 283 # Test if we have any DTBs at all
277 sep="" 284 sep=""
278 conf_desc="" 285 conf_desc=""
@@ -285,49 +292,49 @@ fitimage_emit_section_config() {
285 292
286 # conf node name is selected based on dtb ID if it is present, 293 # conf node name is selected based on dtb ID if it is present,
287 # otherwise its selected based on kernel ID 294 # otherwise its selected based on kernel ID
288 if [ -n "${3}" ]; then 295 if [ -n "${dtb_image}" ]; then
289 conf_node=$conf_node${3} 296 conf_node=$conf_node${dtb_image}
290 else 297 else
291 conf_node=$conf_node${2} 298 conf_node=$conf_node${kernel_id}
292 fi 299 fi
293 300
294 if [ -n "${2}" ]; then 301 if [ -n "${kernel_id}" ]; then
295 conf_desc="Linux kernel" 302 conf_desc="Linux kernel"
296 sep=", " 303 sep=", "
297 kernel_line="kernel = \"kernel@${2}\";" 304 kernel_line="kernel = \"kernel@${kernel_id}\";"
298 fi 305 fi
299 306
300 if [ -n "${3}" ]; then 307 if [ -n "${dtb_image}" ]; then
301 conf_desc="${conf_desc}${sep}FDT blob" 308 conf_desc="${conf_desc}${sep}FDT blob"
302 sep=", " 309 sep=", "
303 fdt_line="fdt = \"fdt@${3}\";" 310 fdt_line="fdt = \"fdt@${dtb_image}\";"
304 fi 311 fi
305 312
306 if [ -n "${4}" ]; then 313 if [ -n "${ramdisk_id}" ]; then
307 conf_desc="${conf_desc}${sep}ramdisk" 314 conf_desc="${conf_desc}${sep}ramdisk"
308 sep=", " 315 sep=", "
309 ramdisk_line="ramdisk = \"ramdisk@${4}\";" 316 ramdisk_line="ramdisk = \"ramdisk@${ramdisk_id}\";"
310 fi 317 fi
311 318
312 if [ -n "${5}" ]; then 319 if [ -n "${config_id}" ]; then
313 conf_desc="${conf_desc}${sep}setup" 320 conf_desc="${conf_desc}${sep}setup"
314 setup_line="setup = \"setup@${5}\";" 321 setup_line="setup = \"setup@${config_id}\";"
315 fi 322 fi
316 323
317 if [ "${6}" = "1" ]; then 324 if [ "${default_flag}" = "1" ]; then
318 # default node is selected based on dtb ID if it is present, 325 # default node is selected based on dtb ID if it is present,
319 # otherwise its selected based on kernel ID 326 # otherwise its selected based on kernel ID
320 if [ -n "${3}" ]; then 327 if [ -n "${dtb_image}" ]; then
321 default_line="default = \"conf@${3}\";" 328 default_line="default = \"conf@${dtb_image}\";"
322 else 329 else
323 default_line="default = \"conf@${2}\";" 330 default_line="default = \"conf@${kernel_id}\";"
324 fi 331 fi
325 fi 332 fi
326 333
327 cat << EOF >> ${1} 334 cat << EOF >> ${its_file}
328 ${default_line} 335 ${default_line}
329 $conf_node { 336 $conf_node {
330 description = "${6} ${conf_desc}"; 337 description = "${default_flag} ${conf_desc}";
331 ${kernel_line} 338 ${kernel_line}
332 ${fdt_line} 339 ${fdt_line}
333 ${ramdisk_line} 340 ${ramdisk_line}
@@ -342,28 +349,28 @@ EOF
342 sign_line="sign-images = " 349 sign_line="sign-images = "
343 sep="" 350 sep=""
344 351
345 if [ -n "${2}" ]; then 352 if [ -n "${kernel_id}" ]; then
346 sign_line="${sign_line}${sep}\"kernel\"" 353 sign_line="${sign_line}${sep}\"kernel\""
347 sep=", " 354 sep=", "
348 fi 355 fi
349 356
350 if [ -n "${3}" ]; then 357 if [ -n "${dtb_image}" ]; then
351 sign_line="${sign_line}${sep}\"fdt\"" 358 sign_line="${sign_line}${sep}\"fdt\""
352 sep=", " 359 sep=", "
353 fi 360 fi
354 361
355 if [ -n "${4}" ]; then 362 if [ -n "${ramdisk_id}" ]; then
356 sign_line="${sign_line}${sep}\"ramdisk\"" 363 sign_line="${sign_line}${sep}\"ramdisk\""
357 sep=", " 364 sep=", "
358 fi 365 fi
359 366
360 if [ -n "${5}" ]; then 367 if [ -n "${config_id}" ]; then
361 sign_line="${sign_line}${sep}\"setup\"" 368 sign_line="${sign_line}${sep}\"setup\""
362 fi 369 fi
363 370
364 sign_line="${sign_line};" 371 sign_line="${sign_line};"
365 372
366 cat << EOF >> ${1} 373 cat << EOF >> ${its_file}
367 signature@1 { 374 signature@1 {
368 algo = "${conf_csum},${conf_sign_algo}"; 375 algo = "${conf_csum},${conf_sign_algo}";
369 key-name-hint = "${conf_sign_keyname}"; 376 key-name-hint = "${conf_sign_keyname}";
@@ -372,7 +379,7 @@ EOF
372EOF 379EOF
373 fi 380 fi
374 381
375 cat << EOF >> ${1} 382 cat << EOF >> ${its_file}
376 }; 383 };
377EOF 384EOF
378} 385}