summaryrefslogtreecommitdiff
path: root/meta-phosphor/classes
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2020-11-12 00:06:50 +0300
committerAndrew Geissler <geissonator@yahoo.com>2020-11-17 04:08:04 +0300
commit55681e46e3577b449eda0b6faef53b79e8e4b2b7 (patch)
tree8b60eaeb3367ab683fb15a518e97553b6aa92e68 /meta-phosphor/classes
parentb0ccade87db5b72b0e55b565b1e735526e74d83d (diff)
downloadopenbmc-55681e46e3577b449eda0b6faef53b79e8e4b2b7.tar.xz
image_types_phosphor: mmc: Fill empty image with zeros
There are errors seeing in the eMMC when the empty space of an image is filled with 0xff like it's done for NOR chips instead of 0s. Create a function to create empty images with 0s. Also create an empty image for u-boot of 1MB (twice its current size) so if the u-boot image that is flashed on a system is smaller than what the system has, there's no leftover data at the end that can cause issues. Tested: Booted the new image-u-boot file on HW. (From meta-phosphor rev: e4c3d766a0cda490758636f563572152a6ddfaa1) Change-Id: I27f31f76c38bc256b84cad566afa1e98471695db Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-phosphor/classes')
-rw-r--r--meta-phosphor/classes/image_types_phosphor.bbclass10
1 files changed, 9 insertions, 1 deletions
diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass
index 39801204b..e4663471c 100644
--- a/meta-phosphor/classes/image_types_phosphor.bbclass
+++ b/meta-phosphor/classes/image_types_phosphor.bbclass
@@ -55,6 +55,7 @@ FLASH_UBI_RWFS_TXT_SIZE ?= "6MiB"
FLASH_UBI_RWFS_TXT_SIZE_flash-131072 ?= "32MiB"
# eMMC sizes in KB unless otherwise noted.
+MMC_UBOOT_SIZE ?= "1024"
MMC_BOOT_PARTITION_SIZE ?= "65536"
SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv"
@@ -104,6 +105,12 @@ mk_empty_image() {
| tr '\000' '\377' > $image_dst
}
+mk_empty_image_zeros() {
+ image_dst="$1"
+ image_size_kb=$2
+ dd if=/dev/zero of=$image_dst bs=1k count=$image_size_kb
+}
+
clean_rwfs() {
type=$1
shift
@@ -423,13 +430,14 @@ do_generate_ubi_tar[depends] += " \
do_generate_ext4_tar() {
# Generate the U-Boot image
+ mk_empty_image_zeros image-u-boot ${MMC_UBOOT_SIZE}
do_generate_image_uboot_file image-u-boot
# Generate a compressed ext4 filesystem with the fitImage file in it to be
# flashed to the boot partition of the eMMC
install -d boot-image
install -m 644 ${DEPLOY_DIR_IMAGE}/${FLASH_KERNEL_IMAGE} boot-image/fitImage
- mk_empty_image boot-image.${FLASH_EXT4_BASETYPE} ${MMC_BOOT_PARTITION_SIZE}
+ mk_empty_image_zeros boot-image.${FLASH_EXT4_BASETYPE} ${MMC_BOOT_PARTITION_SIZE}
mkfs.ext4 -F -i 4096 -d boot-image boot-image.${FLASH_EXT4_BASETYPE}
# Error codes 0-3 indicate successfull operation of fsck
fsck.ext4 -pvfD boot-image.${FLASH_EXT4_BASETYPE} || [ $? -le 3 ]