u-boot: Allow for customizing installed/deployed file names
PATCH 1/1 u-boot: Allow for customizing installed/deployed file names
When assembling all of the various filenames that are installed/deployed from u-boot, we have been including the PV and PR in the filenames. This change introduces a simple variable indirection for those places so that the values for PV and PR can be modified if desired.
In this case, we are wanting to use the value for PKGV instead of PV so that we can pick up the git commit, but a change of that magnitude in a bbappend would be impossible with all of the places where PV is hard-coded.
This change should not be disruptive since the default value for the new UBOOT_PV and UBOOT_PR are just PV and PR respectively.
--- meta/classes-recipe/uboot-config.bbclass | 15 +++-- meta/recipes-bsp/u-boot/u-boot.inc | 80 ++++++++++++------------ 2 files changed, 50 insertions(+), 45 deletions(-)
meta/classes-recipe/uboot-config.bbclass +10 -5
@@ -22,12 +22,17 @@ def removesuffix(s, suffix): UBOOT_ENTRYPOINT ?= "0x20008000" UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" +# When naming the files we install/deploy, the package version and revision +# are part of the filename. Allow these to be customized if desired. +UBOOT_PV ?= "${PV}" +UBOOT_PR ?= "${PR}" + # Some versions of u-boot use .bin and others use .img. By default use .bin # but enable individual recipes to change this value. UBOOT_SUFFIX ??= "bin" UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" UBOOT_BINARYNAME ?= "${@os.path.splitext(d.getVar("UBOOT_BINARY"))[0]}" -UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}" +UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${UBOOT_PV}-${UBOOT_PR}.${UBOOT_SUFFIX}" UBOOT_SYMLINK ?= "${UBOOT_BINARYNAME}-${MACHINE}.${UBOOT_SUFFIX}" UBOOT_MAKE_TARGET ?= "all"
@@ -36,7 +41,7 @@ UBOOT_MAKE_TARGET ?= "all" # purposes. UBOOT_ELF ?= "" UBOOT_ELF_SUFFIX ?= "elf" -UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}" +UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${UBOOT_PV}-${UBOOT_PR}.${UBOOT_ELF_SUFFIX}" UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}" UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}"
@@ -49,7 +54,7 @@ SPL_BINARY ?= "" SPL_DELIMITER ?= "${@'.' if d.getVar("SPL_SUFFIX") else ''}" SPL_BINARYFILE ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}" SPL_BINARYNAME ?= "${@removesuffix(d.getVar("SPL_BINARYFILE"), "." + d.getVar("SPL_SUFFIX"))}" -SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX}" +SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${UBOOT_PV}-${UBOOT_PR}${SPL_DELIMITER}${SPL_SUFFIX}" SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}${SPL_DELIMITER}${SPL_SUFFIX}" # Additional environment variables or a script can be installed alongside
@@ -62,14 +67,14 @@ UBOOT_ENV ?= "" UBOOT_ENV_SRC_SUFFIX ?= "cmd" UBOOT_ENV_SRC ?= "${UBOOT_ENV}.${UBOOT_ENV_SRC_SUFFIX}" UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}" -UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" +UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${UBOOT_PV}-${UBOOT_PR}.${UBOOT_ENV_SUFFIX}" UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" # U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf # to find EXTLINUX conf file. UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf" -UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}" +UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${UBOOT_PV}-${UBOOT_PR}" # Options for the device tree compiler passed to mkimage '-D' feature: UBOOT_MKIMAGE_DTCOPTS ??= ""
meta/recipes-bsp/u-boot/u-boot.inc +40 -40
145 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 27 lines · Ryan Eatmon via lists.openembedded.org
When assembling all of the various filenames that are installed/deployed from u-boot, we have been including the PV and PR in the filenames. This change introduces a simple variable indirection for those places so that the values for PV and PR can be modified if desired.
In this case, we are wanting to use the value for PKGV instead of PV so that we can pick up the git commit, but a change of that magnitude in a bbappend would be impossible with all of the places where PV is hard-coded.
This change should not be disruptive since the default value for the new
UBOOT_PVandUBOOT_PRare just PV and PR respectively.Signed-off-by Ryan Eatmon <[email protected]>---
meta/classes-recipe/uboot-config.bbclass | 15 +++--
meta/recipes-bsp/u-boot/u-boot.inc | 80 ++++++++++++------------2 files changed, 50 insertions(+), 45 deletions(-)meta/classes-recipe/uboot-config.bbclass +0
-0@@ -22,12 +22,17 @@ def removesuffix(s, suffix):
UBOOT_ENTRYPOINT?= "0x20008000"UBOOT_LOADADDRESS?= "${UBOOT_ENTRYPOINT}"
meta/classes-recipe/uboot-config.bbclass def removesuffix(s, suffix):
Quoted 7 lines
meta/classes-recipe/uboot-config.bbclass +5
-1+# When naming the files we install/deploy, the package version and revision +# are part of the filename. Allow these to be customized if desired. +UBOOT_PV ?= "${PV}" +UBOOT_PR ?= "${PR}" -UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}" +UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${UBOOT_PV}-${UBOOT_PR}.${UBOOT_SUFFIX}”
Every instance of this is PV-PR, so why not have a single “UBOOT_VERSION” variable that defaults to PV-PR?
Putting the PR in the filenames seems wrong, but that can be a follow-up patch.
Ross
Quoted 33 lines · Ross Burton
Quoted 31 lines · Ryan Eatmon via lists.openembedded.org
When assembling all of the various filenames that are installed/deployed from u-boot, we have been including the PV and PR in the filenames. This change introduces a simple variable indirection for those places so that the values for PV and PR can be modified if desired.
In this case, we are wanting to use the value for PKGV instead of PV so that we can pick up the git commit, but a change of that magnitude in a bbappend would be impossible with all of the places where PV is hard-coded.
This change should not be disruptive since the default value for the new
UBOOT_PVandUBOOT_PRare just PV and PR respectively.Signed-off-by Ryan Eatmon <[email protected]>---
meta/classes-recipe/uboot-config.bbclass | 15 +++--
meta/recipes-bsp/u-boot/u-boot.inc | 80 ++++++++++++------------2 files changed, 50 insertions(+), 45 deletions(-)meta/classes-recipe/uboot-config.bbclass +0
-0@@ -22,12 +22,17 @@ def removesuffix(s, suffix):
UBOOT_ENTRYPOINT?= "0x20008000"UBOOT_LOADADDRESS?= "${UBOOT_ENTRYPOINT}"meta/classes-recipe/uboot-config.bbclass +4
-0+# When naming the files we install/deploy, the package version and revision +# are part of the filename. Allow these to be customized if desired. +UBOOT_PV ?= "${PV}" +UBOOT_PR ?= "${PR}"
Quoted 6 lines
meta/classes-recipe/uboot-config.bbclass
Quoted 2 lines
meta/classes-recipe/uboot-config.bbclass +1
-1-UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}" +UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${UBOOT_PV}-${UBOOT_PR}.${UBOOT_SUFFIX}”Every instance of this is PV-PR, so why not have a single “UBOOT_VERSION” variable that defaults to PV-PR?
Putting the PR in the filenames seems wrong, but that can be a follow-up patch.
I can make that change. I had thought about doing something like that, but decided for the more specific change. I'll take a stab at that and send in a v2. Thanks!
Quoted 1 line
Ross
Signature · 3 lines
Ryan Eatmon [email protected] ----------------------------------------- Texas Instruments, Inc. - LCPD - MGTS
Quoted 39 lines · Ryan Eatmon via lists.openembedded.org
Quoted 38 lines · Ross Burton
Quoted 27 lines · Ryan Eatmon via lists.openembedded.org
When assembling all of the various filenames that are installed/deployed from u-boot, we have been including the PV and PR in the filenames. This change introduces a simple variable indirection for those places so that the values for PV and PR can be modified if desired.
In this case, we are wanting to use the value for PKGV instead of PV so that we can pick up the git commit, but a change of that magnitude in a bbappend would be impossible with all of the places where PV is hard-coded.
This change should not be disruptive since the default value for the new
UBOOT_PVandUBOOT_PRare just PV and PR respectively.Signed-off-by Ryan Eatmon <[email protected]>---
meta/classes-recipe/uboot-config.bbclass | 15 +++-- meta/recipes-bsp/u-boot/u-boot.inc | 80 ++++++++++++------------2 files changed, 50 insertions(+), 45 deletions(-)meta/classes-recipe/uboot-config.bbclass +0
-0@@ -22,12 +22,17 @@ def removesuffix(s, suffix):
UBOOT_ENTRYPOINT?= "0x20008000"UBOOT_LOADADDRESS?= "${UBOOT_ENTRYPOINT}"meta/classes-recipe/uboot-config.bbclass def removesuffix(s, suffix):
Quoted 7 lines
meta/classes-recipe/uboot-config.bbclass +5
-1+# When naming the files we install/deploy, the package version and revision +# are part of the filename. Allow these to be customized if desired. +UBOOT_PV ?= "${PV}" +UBOOT_PR ?= "${PR}" -UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}" +UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${UBOOT_PV}-${UBOOT_PR}.${UBOOT_SUFFIX}”Every instance of this is PV-PR, so why not have a single “UBOOT_VERSION” variable that defaults to PV-PR?
Quoted 5 lines
Quoted 1 line
Putting the PR in the filenames seems wrong, but that can be a follow-up patch.
I can make that change. I had thought about doing something like that, but decided for the more specific change. I'll take a stab at that and send in a v2. Thanks!
FWIW I don't think we need/want PR in this, at least by default and I'd prefer to drop that as a follow up patch too, simplify things a bit. PR doesn't tend to change much now.
Cheers,
Richard