diff options
| author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-03-15 18:23:53 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-16 10:31:41 +0000 |
| commit | 17166251233ed4c812ffee529246e13626cbdef6 (patch) | |
| tree | 66baeb2feb30658666a75723baffdddb79703558 /meta/classes/kernel-fitimage.bbclass | |
| parent | 11cfe076720495b38d61e6f5627fa886d0f8d423 (diff) | |
| download | poky-17166251233ed4c812ffee529246e13626cbdef6.tar.gz | |
kernel-fitimage: allow overriding FIT configuration prefix
The prefix was recently changed to play ball with the CVE-2021-27138
workaround in U-Boot. Already deployed bootloaders though may still
expect a configuration name containing @ or they may not be affected
by this issue.
Also, uses may want to customize it beyond the [@-] issue: When
device trees are built from a recipe using kernel-devicetree.bbclass
the configuration nodes will contain the parent directories, e.g.
KERNEL_DEVICETREE = "freescale/imx8mm-myboard.dtb"
will become "conf-freescale_imx8mm-myboard.dtb". When moving to
devicetree.bbclass, this prefix go away. With this change here,
users can restore it easily by setting FIT_CONF_PREFIX =
"conf-freescale_", ensuring backwards compatibility.
(From OE-Core rev: 7892ee3dc37d302c8eb9c13cd8bb4b7b6e103949)
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-fitimage.bbclass')
| -rw-r--r-- | meta/classes/kernel-fitimage.bbclass | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass index c16977c477..8a9b195d6e 100644 --- a/meta/classes/kernel-fitimage.bbclass +++ b/meta/classes/kernel-fitimage.bbclass | |||
| @@ -64,6 +64,9 @@ FIT_DESC ?= "Kernel fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" | |||
| 64 | # Sign individual images as well | 64 | # Sign individual images as well |
| 65 | FIT_SIGN_INDIVIDUAL ?= "0" | 65 | FIT_SIGN_INDIVIDUAL ?= "0" |
| 66 | 66 | ||
| 67 | FIT_CONF_PREFIX ?= "conf-" | ||
| 68 | FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name" | ||
| 69 | |||
| 67 | # Keys used to sign individually image nodes. | 70 | # Keys used to sign individually image nodes. |
| 68 | # The keys to sign image nodes must be different from those used to sign | 71 | # The keys to sign image nodes must be different from those used to sign |
| 69 | # configuration nodes, otherwise the "required" property, from | 72 | # configuration nodes, otherwise the "required" property, from |
| @@ -358,7 +361,7 @@ fitimage_emit_section_config() { | |||
| 358 | # Test if we have any DTBs at all | 361 | # Test if we have any DTBs at all |
| 359 | sep="" | 362 | sep="" |
| 360 | conf_desc="" | 363 | conf_desc="" |
| 361 | conf_node="conf-" | 364 | conf_node="${FIT_CONF_PREFIX}" |
| 362 | kernel_line="" | 365 | kernel_line="" |
| 363 | fdt_line="" | 366 | fdt_line="" |
| 364 | ramdisk_line="" | 367 | ramdisk_line="" |
| @@ -407,9 +410,9 @@ fitimage_emit_section_config() { | |||
| 407 | # default node is selected based on dtb ID if it is present, | 410 | # default node is selected based on dtb ID if it is present, |
| 408 | # otherwise its selected based on kernel ID | 411 | # otherwise its selected based on kernel ID |
| 409 | if [ -n "$dtb_image" ]; then | 412 | if [ -n "$dtb_image" ]; then |
| 410 | default_line="default = \"conf-$dtb_image\";" | 413 | default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";" |
| 411 | else | 414 | else |
| 412 | default_line="default = \"conf-$kernel_id\";" | 415 | default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";" |
| 413 | fi | 416 | fi |
| 414 | fi | 417 | fi |
| 415 | 418 | ||
