diff options
author | Saqib Khan <khansa@us.ibm.com> | 2017-09-22 10:21:30 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-11-16 03:32:03 +0000 |
commit | 417234737e4238a6f2315188c10d1e16f65e9664 (patch) | |
tree | ade1ca36741a5b8b700f6d19eef4c673e3722a57 /meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc | |
parent | 10721e62693599aa11d82588dfe5d5c89b2e108e (diff) | |
download | talos-openbmc-417234737e4238a6f2315188c10d1e16f65e9664.tar.gz talos-openbmc-417234737e4238a6f2315188c10d1e16f65e9664.zip |
Calculate the version ID of BMC UBI volumes during build time.
- When the new ubi layout is flashed onto the BMC, the volumes
were named kernel-0 and rofs-0 by default. This tends to be
misleading as we can't differentiate between two different BMC
versions.
- Now the ubi volumes will be named kernel-<versionID> and
rofs-<versionID> calculated by getting the hash(SHA-512) of
the version and taking the first 8 characters.
- The Uboot env needs to be updated to point to the correct
kernelname which has now changed from kernel-0 to
kernel-<versionID> calculated by getting the HASH(SHA-512)
of the version and taking the first 8 characters.
Resolves openbmc/openbmc#2323
Change-Id: I258d165b399d1ff59ea86f410006f6d03fe13a2e
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc')
-rw-r--r-- | meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc b/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc index 6eac53309..5cc320fbc 100644 --- a/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc +++ b/meta-phosphor/common/recipes-bsp/u-boot/u-boot.inc @@ -4,10 +4,26 @@ SRCREV = "16f997c564f873b4fdf12fc90ee8a9f6f6080961" UBRANCH = "v2016.07-aspeed-openbmc" SRC_URI = "git://git@github.com/openbmc/u-boot.git;branch=${UBRANCH};protocol=https" +inherit image_version + SRC_URI += "file://0001-configs-ast-Add-redundnant-env.patch" SRC_URI += "${@bb.utils.contains('MACHINE_FEATURES', 'obmc-ubi-fs', \ 'file://0001-config-ast-common-hack-bootopts.patch \ file://0004-config-ast-common-ubi-bootops.patch', '', d)}" +python do_configure () { + if ((d.getVar("MACHINE_FEATURES", True)) == "obmc-ubi-fs"): + version_id=do_get_versionID(d) + d.setVar('VERSION_ID', version_id) + bb.build.exec_func("patch_uboot", d) +} + +patch_uboot () { + sed -i "s/kernel-0/kernel-${VERSION_ID}/g" \ + ${S}/patches/0004-config-ast-common-ubi-bootops.patch &> /dev/null + sed -i "s/kernel-0/kernel-${VERSION_ID}/g" \ + ${S}/include/configs/ast-common.h &> /dev/null +} + PV = "v2016.07+git${SRCPV}" |