diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes/kernel-fitimage.bbclass | 40 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/fitimage.py | 36 |
2 files changed, 38 insertions, 38 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass index 2414870817..f5082c93df 100644 --- a/meta/classes/kernel-fitimage.bbclass +++ b/meta/classes/kernel-fitimage.bbclass | |||
| @@ -161,7 +161,7 @@ fitimage_emit_section_kernel() { | |||
| 161 | fi | 161 | fi |
| 162 | 162 | ||
| 163 | cat << EOF >> ${1} | 163 | cat << EOF >> ${1} |
| 164 | kernel@${2} { | 164 | kernel-${2} { |
| 165 | description = "Linux kernel"; | 165 | description = "Linux kernel"; |
| 166 | data = /incbin/("${3}"); | 166 | data = /incbin/("${3}"); |
| 167 | type = "kernel"; | 167 | type = "kernel"; |
| @@ -170,7 +170,7 @@ fitimage_emit_section_kernel() { | |||
| 170 | compression = "${4}"; | 170 | compression = "${4}"; |
| 171 | load = <${UBOOT_LOADADDRESS}>; | 171 | load = <${UBOOT_LOADADDRESS}>; |
| 172 | entry = <${ENTRYPOINT}>; | 172 | entry = <${ENTRYPOINT}>; |
| 173 | hash@1 { | 173 | hash-1 { |
| 174 | algo = "${kernel_csum}"; | 174 | algo = "${kernel_csum}"; |
| 175 | }; | 175 | }; |
| 176 | }; | 176 | }; |
| @@ -179,7 +179,7 @@ EOF | |||
| 179 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${kernel_sign_keyname}" ] ; then | 179 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${kernel_sign_keyname}" ] ; then |
| 180 | sed -i '$ d' ${1} | 180 | sed -i '$ d' ${1} |
| 181 | cat << EOF >> ${1} | 181 | cat << EOF >> ${1} |
| 182 | signature@1 { | 182 | signature-1 { |
| 183 | algo = "${kernel_csum},${kernel_sign_algo}"; | 183 | algo = "${kernel_csum},${kernel_sign_algo}"; |
| 184 | key-name-hint = "${kernel_sign_keyname}"; | 184 | key-name-hint = "${kernel_sign_keyname}"; |
| 185 | }; | 185 | }; |
| @@ -210,14 +210,14 @@ fitimage_emit_section_dtb() { | |||
| 210 | dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;" | 210 | dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;" |
| 211 | fi | 211 | fi |
| 212 | cat << EOF >> ${1} | 212 | cat << EOF >> ${1} |
| 213 | fdt@${2} { | 213 | fdt-${2} { |
| 214 | description = "Flattened Device Tree blob"; | 214 | description = "Flattened Device Tree blob"; |
| 215 | data = /incbin/("${3}"); | 215 | data = /incbin/("${3}"); |
| 216 | type = "flat_dt"; | 216 | type = "flat_dt"; |
| 217 | arch = "${UBOOT_ARCH}"; | 217 | arch = "${UBOOT_ARCH}"; |
| 218 | compression = "none"; | 218 | compression = "none"; |
| 219 | ${dtb_loadline} | 219 | ${dtb_loadline} |
| 220 | hash@1 { | 220 | hash-1 { |
| 221 | algo = "${dtb_csum}"; | 221 | algo = "${dtb_csum}"; |
| 222 | }; | 222 | }; |
| 223 | }; | 223 | }; |
| @@ -226,7 +226,7 @@ EOF | |||
| 226 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${dtb_sign_keyname}" ] ; then | 226 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${dtb_sign_keyname}" ] ; then |
| 227 | sed -i '$ d' ${1} | 227 | sed -i '$ d' ${1} |
| 228 | cat << EOF >> ${1} | 228 | cat << EOF >> ${1} |
| 229 | signature@1 { | 229 | signature-1 { |
| 230 | algo = "${dtb_csum},${dtb_sign_algo}"; | 230 | algo = "${dtb_csum},${dtb_sign_algo}"; |
| 231 | key-name-hint = "${dtb_sign_keyname}"; | 231 | key-name-hint = "${dtb_sign_keyname}"; |
| 232 | }; | 232 | }; |
| @@ -283,7 +283,7 @@ fitimage_emit_section_setup() { | |||
| 283 | setup_csum="${FIT_HASH_ALG}" | 283 | setup_csum="${FIT_HASH_ALG}" |
| 284 | 284 | ||
| 285 | cat << EOF >> ${1} | 285 | cat << EOF >> ${1} |
| 286 | setup@${2} { | 286 | setup-${2} { |
| 287 | description = "Linux setup.bin"; | 287 | description = "Linux setup.bin"; |
| 288 | data = /incbin/("${3}"); | 288 | data = /incbin/("${3}"); |
| 289 | type = "x86_setup"; | 289 | type = "x86_setup"; |
| @@ -292,7 +292,7 @@ fitimage_emit_section_setup() { | |||
| 292 | compression = "none"; | 292 | compression = "none"; |
| 293 | load = <0x00090000>; | 293 | load = <0x00090000>; |
| 294 | entry = <0x00090000>; | 294 | entry = <0x00090000>; |
| 295 | hash@1 { | 295 | hash-1 { |
| 296 | algo = "${setup_csum}"; | 296 | algo = "${setup_csum}"; |
| 297 | }; | 297 | }; |
| 298 | }; | 298 | }; |
| @@ -321,7 +321,7 @@ fitimage_emit_section_ramdisk() { | |||
| 321 | fi | 321 | fi |
| 322 | 322 | ||
| 323 | cat << EOF >> ${1} | 323 | cat << EOF >> ${1} |
| 324 | ramdisk@${2} { | 324 | ramdisk-${2} { |
| 325 | description = "${INITRAMFS_IMAGE}"; | 325 | description = "${INITRAMFS_IMAGE}"; |
| 326 | data = /incbin/("${3}"); | 326 | data = /incbin/("${3}"); |
| 327 | type = "ramdisk"; | 327 | type = "ramdisk"; |
| @@ -330,7 +330,7 @@ fitimage_emit_section_ramdisk() { | |||
| 330 | compression = "none"; | 330 | compression = "none"; |
| 331 | ${ramdisk_loadline} | 331 | ${ramdisk_loadline} |
| 332 | ${ramdisk_entryline} | 332 | ${ramdisk_entryline} |
| 333 | hash@1 { | 333 | hash-1 { |
| 334 | algo = "${ramdisk_csum}"; | 334 | algo = "${ramdisk_csum}"; |
| 335 | }; | 335 | }; |
| 336 | }; | 336 | }; |
| @@ -339,7 +339,7 @@ EOF | |||
| 339 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${ramdisk_sign_keyname}" ] ; then | 339 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${ramdisk_sign_keyname}" ] ; then |
| 340 | sed -i '$ d' ${1} | 340 | sed -i '$ d' ${1} |
| 341 | cat << EOF >> ${1} | 341 | cat << EOF >> ${1} |
| 342 | signature@1 { | 342 | signature-1 { |
| 343 | algo = "${ramdisk_csum},${ramdisk_sign_algo}"; | 343 | algo = "${ramdisk_csum},${ramdisk_sign_algo}"; |
| 344 | key-name-hint = "${ramdisk_sign_keyname}"; | 344 | key-name-hint = "${ramdisk_sign_keyname}"; |
| 345 | }; | 345 | }; |
| @@ -377,7 +377,7 @@ fitimage_emit_section_config() { | |||
| 377 | # Test if we have any DTBs at all | 377 | # Test if we have any DTBs at all |
| 378 | sep="" | 378 | sep="" |
| 379 | conf_desc="" | 379 | conf_desc="" |
| 380 | conf_node="conf@" | 380 | conf_node="conf-" |
| 381 | kernel_line="" | 381 | kernel_line="" |
| 382 | fdt_line="" | 382 | fdt_line="" |
| 383 | ramdisk_line="" | 383 | ramdisk_line="" |
| @@ -396,19 +396,19 @@ fitimage_emit_section_config() { | |||
| 396 | if [ -n "${kernel_id}" ]; then | 396 | if [ -n "${kernel_id}" ]; then |
| 397 | conf_desc="Linux kernel" | 397 | conf_desc="Linux kernel" |
| 398 | sep=", " | 398 | sep=", " |
| 399 | kernel_line="kernel = \"kernel@${kernel_id}\";" | 399 | kernel_line="kernel = \"kernel-${kernel_id}\";" |
| 400 | fi | 400 | fi |
| 401 | 401 | ||
| 402 | if [ -n "${dtb_image}" ]; then | 402 | if [ -n "${dtb_image}" ]; then |
| 403 | conf_desc="${conf_desc}${sep}FDT blob" | 403 | conf_desc="${conf_desc}${sep}FDT blob" |
| 404 | sep=", " | 404 | sep=", " |
| 405 | fdt_line="fdt = \"fdt@${dtb_image}\";" | 405 | fdt_line="fdt = \"fdt-${dtb_image}\";" |
| 406 | fi | 406 | fi |
| 407 | 407 | ||
| 408 | if [ -n "${ramdisk_id}" ]; then | 408 | if [ -n "${ramdisk_id}" ]; then |
| 409 | conf_desc="${conf_desc}${sep}ramdisk" | 409 | conf_desc="${conf_desc}${sep}ramdisk" |
| 410 | sep=", " | 410 | sep=", " |
| 411 | ramdisk_line="ramdisk = \"ramdisk@${ramdisk_id}\";" | 411 | ramdisk_line="ramdisk = \"ramdisk-${ramdisk_id}\";" |
| 412 | fi | 412 | fi |
| 413 | 413 | ||
| 414 | if [ -n "${bootscr_id}" ]; then | 414 | if [ -n "${bootscr_id}" ]; then |
| @@ -419,16 +419,16 @@ fitimage_emit_section_config() { | |||
| 419 | 419 | ||
| 420 | if [ -n "${config_id}" ]; then | 420 | if [ -n "${config_id}" ]; then |
| 421 | conf_desc="${conf_desc}${sep}setup" | 421 | conf_desc="${conf_desc}${sep}setup" |
| 422 | setup_line="setup = \"setup@${config_id}\";" | 422 | setup_line="setup = \"setup-${config_id}\";" |
| 423 | fi | 423 | fi |
| 424 | 424 | ||
| 425 | if [ "${default_flag}" = "1" ]; then | 425 | if [ "${default_flag}" = "1" ]; then |
| 426 | # default node is selected based on dtb ID if it is present, | 426 | # default node is selected based on dtb ID if it is present, |
| 427 | # otherwise its selected based on kernel ID | 427 | # otherwise its selected based on kernel ID |
| 428 | if [ -n "${dtb_image}" ]; then | 428 | if [ -n "${dtb_image}" ]; then |
| 429 | default_line="default = \"conf@${dtb_image}\";" | 429 | default_line="default = \"conf-${dtb_image}\";" |
| 430 | else | 430 | else |
| 431 | default_line="default = \"conf@${kernel_id}\";" | 431 | default_line="default = \"conf-${kernel_id}\";" |
| 432 | fi | 432 | fi |
| 433 | fi | 433 | fi |
| 434 | 434 | ||
| @@ -441,7 +441,7 @@ fitimage_emit_section_config() { | |||
| 441 | ${ramdisk_line} | 441 | ${ramdisk_line} |
| 442 | ${bootscr_line} | 442 | ${bootscr_line} |
| 443 | ${setup_line} | 443 | ${setup_line} |
| 444 | hash@1 { | 444 | hash-1 { |
| 445 | algo = "${conf_csum}"; | 445 | algo = "${conf_csum}"; |
| 446 | }; | 446 | }; |
| 447 | EOF | 447 | EOF |
| @@ -478,7 +478,7 @@ EOF | |||
| 478 | sign_line="${sign_line};" | 478 | sign_line="${sign_line};" |
| 479 | 479 | ||
| 480 | cat << EOF >> ${its_file} | 480 | cat << EOF >> ${its_file} |
| 481 | signature@1 { | 481 | signature-1 { |
| 482 | algo = "${conf_csum},${conf_sign_algo}"; | 482 | algo = "${conf_csum},${conf_sign_algo}"; |
| 483 | key-name-hint = "${conf_sign_keyname}"; | 483 | key-name-hint = "${conf_sign_keyname}"; |
| 484 | ${sign_line} | 484 | ${sign_line} |
diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 0958036a6f..02692de822 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py | |||
| @@ -69,9 +69,9 @@ FIT_DESC = "A model description" | |||
| 69 | 'type = "ramdisk";', | 69 | 'type = "ramdisk";', |
| 70 | 'load = <0x88000000>;', | 70 | 'load = <0x88000000>;', |
| 71 | 'entry = <0x88000000>;', | 71 | 'entry = <0x88000000>;', |
| 72 | 'default = "conf@1";', | 72 | 'default = "conf-1";', |
| 73 | 'kernel = "kernel@1";', | 73 | 'kernel = "kernel-1";', |
| 74 | 'ramdisk = "ramdisk@1";' | 74 | 'ramdisk = "ramdisk-1";' |
| 75 | ] | 75 | ] |
| 76 | 76 | ||
| 77 | with open(fitimage_its_path) as its_file: | 77 | with open(fitimage_its_path) as its_file: |
| @@ -137,12 +137,12 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" | |||
| 137 | "%s FIT image doesn't exist" % (fitimage_path)) | 137 | "%s FIT image doesn't exist" % (fitimage_path)) |
| 138 | 138 | ||
| 139 | req_itspaths = [ | 139 | req_itspaths = [ |
| 140 | ['/', 'images', 'kernel@1'], | 140 | ['/', 'images', 'kernel-1'], |
| 141 | ['/', 'images', 'kernel@1', 'signature@1'], | 141 | ['/', 'images', 'kernel-1', 'signature-1'], |
| 142 | ['/', 'images', 'fdt@am335x-boneblack.dtb'], | 142 | ['/', 'images', 'fdt-am335x-boneblack.dtb'], |
| 143 | ['/', 'images', 'fdt@am335x-boneblack.dtb', 'signature@1'], | 143 | ['/', 'images', 'fdt-am335x-boneblack.dtb', 'signature-1'], |
| 144 | ['/', 'configurations', 'conf@am335x-boneblack.dtb'], | 144 | ['/', 'configurations', 'conf-am335x-boneblack.dtb'], |
| 145 | ['/', 'configurations', 'conf@am335x-boneblack.dtb', 'signature@1'], | 145 | ['/', 'configurations', 'conf-am335x-boneblack.dtb', 'signature-1'], |
| 146 | ] | 146 | ] |
| 147 | 147 | ||
| 148 | itspath = [] | 148 | itspath = [] |
| @@ -158,7 +158,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" | |||
| 158 | elif line.endswith('{'): | 158 | elif line.endswith('{'): |
| 159 | itspath.append(line[:-1].strip()) | 159 | itspath.append(line[:-1].strip()) |
| 160 | itspaths.append(itspath[:]) | 160 | itspaths.append(itspath[:]) |
| 161 | elif itspath and itspath[-1] == 'signature@1': | 161 | elif itspath and itspath[-1] == 'signature-1': |
| 162 | itsdotpath = '.'.join(itspath) | 162 | itsdotpath = '.'.join(itspath) |
| 163 | if not itsdotpath in sigs: | 163 | if not itsdotpath in sigs: |
| 164 | sigs[itsdotpath] = {} | 164 | sigs[itsdotpath] = {} |
| @@ -182,7 +182,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" | |||
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | for itspath, values in sigs.items(): | 184 | for itspath, values in sigs.items(): |
| 185 | if 'conf@' in itspath: | 185 | if 'conf-' in itspath: |
| 186 | reqsigvalues = reqsigvalues_config | 186 | reqsigvalues = reqsigvalues_config |
| 187 | else: | 187 | else: |
| 188 | reqsigvalues = reqsigvalues_image | 188 | reqsigvalues = reqsigvalues_image |
| @@ -210,9 +210,9 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" | |||
| 210 | signed_sections[in_signed] = {} | 210 | signed_sections[in_signed] = {} |
| 211 | key, value = line.split(':', 1) | 211 | key, value = line.split(':', 1) |
| 212 | signed_sections[in_signed][key.strip()] = value.strip() | 212 | signed_sections[in_signed][key.strip()] = value.strip() |
| 213 | self.assertIn('kernel@1', signed_sections) | 213 | self.assertIn('kernel-1', signed_sections) |
| 214 | self.assertIn('fdt@am335x-boneblack.dtb', signed_sections) | 214 | self.assertIn('fdt-am335x-boneblack.dtb', signed_sections) |
| 215 | self.assertIn('conf@am335x-boneblack.dtb', signed_sections) | 215 | self.assertIn('conf-am335x-boneblack.dtb', signed_sections) |
| 216 | for signed_section, values in signed_sections.items(): | 216 | for signed_section, values in signed_sections.items(): |
| 217 | value = values.get('Sign algo', None) | 217 | value = values.get('Sign algo', None) |
| 218 | self.assertEqual(value, 'sha256,rsa2048:oe-selftest', 'Signature algorithm for %s not expected value' % signed_section) | 218 | self.assertEqual(value, 'sha256,rsa2048:oe-selftest', 'Signature algorithm for %s not expected value' % signed_section) |
| @@ -298,7 +298,7 @@ FIT_HASH_ALG = "sha256" | |||
| 298 | its_lines = [line.strip() for line in its_file.readlines()] | 298 | its_lines = [line.strip() for line in its_file.readlines()] |
| 299 | 299 | ||
| 300 | exp_node_lines = [ | 300 | exp_node_lines = [ |
| 301 | 'kernel@1 {', | 301 | 'kernel-1 {', |
| 302 | 'description = "Linux kernel";', | 302 | 'description = "Linux kernel";', |
| 303 | 'data = /incbin/("' + initramfs_bundle + '");', | 303 | 'data = /incbin/("' + initramfs_bundle + '");', |
| 304 | 'type = "kernel";', | 304 | 'type = "kernel";', |
| @@ -307,7 +307,7 @@ FIT_HASH_ALG = "sha256" | |||
| 307 | 'compression = "none";', | 307 | 'compression = "none";', |
| 308 | 'load = <' + kernel_load + '>;', | 308 | 'load = <' + kernel_load + '>;', |
| 309 | 'entry = <' + kernel_entry + '>;', | 309 | 'entry = <' + kernel_entry + '>;', |
| 310 | 'hash@1 {', | 310 | 'hash-1 {', |
| 311 | 'algo = "' + fit_hash_alg +'";', | 311 | 'algo = "' + fit_hash_alg +'";', |
| 312 | '};', | 312 | '};', |
| 313 | '};' | 313 | '};' |
| @@ -327,7 +327,7 @@ FIT_HASH_ALG = "sha256" | |||
| 327 | else: | 327 | else: |
| 328 | self.assertTrue(test_passed == True,"kernel node does not match expectation") | 328 | self.assertTrue(test_passed == True,"kernel node does not match expectation") |
| 329 | 329 | ||
| 330 | rx_configs = re.compile("^conf@.*") | 330 | rx_configs = re.compile("^conf-.*") |
| 331 | its_configs = list(filter(rx_configs.match, its_lines)) | 331 | its_configs = list(filter(rx_configs.match, its_lines)) |
| 332 | 332 | ||
| 333 | for cfg_str in its_configs: | 333 | for cfg_str in its_configs: |
| @@ -348,7 +348,7 @@ FIT_HASH_ALG = "sha256" | |||
| 348 | else: | 348 | else: |
| 349 | print("kernel keyword found in the description line") | 349 | print("kernel keyword found in the description line") |
| 350 | 350 | ||
| 351 | if 'kernel = "kernel@1";' not in node: | 351 | if 'kernel = "kernel-1";' not in node: |
| 352 | self.assertTrue(test_passed == True,"kernel line not found") | 352 | self.assertTrue(test_passed == True,"kernel line not found") |
| 353 | break | 353 | break |
| 354 | else: | 354 | else: |
