From 86f1011af189aa8697c48f46925a2d727543052d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 13 Oct 2023 17:17:53 -0700 Subject: [PATCH 1/6] updater: Fix empty function in platform init for visionfive2 Fixes following during kernel initramfs boot ./platform: line73: syntax error: unexpected "} Signed-off-by: Khem Raj --- .../recipes-support/updater/files/visionfive2/platform | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/meta-yoe/recipes-support/updater/files/visionfive2/platform b/sources/meta-yoe/recipes-support/updater/files/visionfive2/platform index 867f16cfb..6b5e1bb32 100644 --- a/sources/meta-yoe/recipes-support/updater/files/visionfive2/platform +++ b/sources/meta-yoe/recipes-support/updater/files/visionfive2/platform @@ -67,8 +67,9 @@ MOUNT_BOOT=1 plat_init() { msg "Running $PLAT initializations ..." - cat /proc/cpuinfo | grep uarch | cut -d' ' -f 2 | head -1 > /etc/hwrevision + cat /proc/cpuinfo | grep uarch | cut -d' ' -f 2 | head -n1 > /etc/hwrevision } plat_bootloader_quirks() { + : } From fcbbaef632a02cb33acae892f3270f9570528ac2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 13 Oct 2023 19:11:40 -0700 Subject: [PATCH 2/6] updater: Enhance sd/emmc resizing function to not have hardcoded partition assumptions So far 1,2,3 were partition numbers for boot/root/data respectively, however this assumption is limiting, since some SBCs e.g. visionfive2 have 5 partitions ( don't ask why) and boot/root/data are 3/4/5 Therefore compute it at runtime so it can be used in varied situations Signed-off-by: Khem Raj --- .../updater/files/updater.installer | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/sources/meta-yoe/recipes-support/updater/files/updater.installer b/sources/meta-yoe/recipes-support/updater/files/updater.installer index d2dffdf9a..951c92365 100644 --- a/sources/meta-yoe/recipes-support/updater/files/updater.installer +++ b/sources/meta-yoe/recipes-support/updater/files/updater.installer @@ -1,6 +1,6 @@ #!/bin/sh -VERSION=21.3 +VERSION=21.4 . ./platform @@ -115,22 +115,32 @@ initialize() { mkdir -p $DATA_MOUNT_POINT } +# Pass device,partition e.g. $EMMC_DEVICE $EMMC_DATA_DEV +# Default is SD device if nothing is passed resize_sd() { - echo "Checking data partition size ..." || return 1 if [ -z "$1" ]; then DEVICE=$SD_DEVICE + PART=$SD_DATA_DEV else DEVICE=$1 + if [ -z "$2"]; then + echo "Please specify partition to resize e.g. /dev/mmcblk0p3" || return 1 + return 0 + fi + PART=$2 fi - DEVICE_NAME=$(basename ${DEVICE}) - PART_SIZE=$(cat "/sys/class/block/${DEVICE_NAME}p3/size") + PART_NAME=$(basename ${PART}) + PART_SIZE=$(cat "/sys/class/block/${PART_NAME}/size") + PART_NUM=$(cat "/sys/class/block/${PART_NAME}/partition") # only continue if partition size is 1MB + echo "Checking data partition size ..." || return 1 if [ $PART_SIZE -gt 2048 ]; then return 0 fi echo "Resizing data partition ..." || return 1 - echo "- +" | sfdisk -N 3 ${DEVICE} - resize2fs ${DEVICE}p3 + echo "- +" | sfdisk -N ${PART_NUM} ${DEVICE} + e2fsck -fy ${PART} + resize2fs ${PART} } partition_sd() { @@ -219,7 +229,7 @@ partition_emmc() { } resize_emmc() { - resize_sd $EMMC_DEVICE + resize_sd $EMMC_DEVICE $EMMC_DATA_DEV } format_emmc_boot() { From 6b2aaa93db5fbae26d4540828431cc2a9de4744f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 13 Oct 2023 18:31:13 -0700 Subject: [PATCH 3/6] visionfive2: Use kernel with initramfs Use kernel+initramfs in IMAGE_BOOT_FILES This helps in getting Yoe updater bundled into kernel for OTA functions Signed-off-by: Khem Raj --- conf/projects/visionfive2/config.conf | 3 +++ sources/meta-yoe/recipes-core/images/machines/visionfive2.inc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/projects/visionfive2/config.conf b/conf/projects/visionfive2/config.conf index 0b051f287..1277a7ab8 100644 --- a/conf/projects/visionfive2/config.conf +++ b/conf/projects/visionfive2/config.conf @@ -13,6 +13,9 @@ IMAGE_FSTYPES:append = " wic.xz wic.bmap ext4.xz" WKS_FILE:yoe = "yoe-visionfive2-sdimage.wks" # Use yoe-initramfs-image for initramfs INITRAMFS_IMAGE = "yoe-initramfs-image" +# Use kernel+initramfs image to boot +IMAGE_BOOT_FILES:remove = "${KERNEL_IMAGETYPE}" +IMAGE_BOOT_FILES:append = " ${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE};${KERNEL_IMAGETYPE}" # Needed for Running bitbake -ctestimage TEST_TARGET_IP = "10.0.0.86" diff --git a/sources/meta-yoe/recipes-core/images/machines/visionfive2.inc b/sources/meta-yoe/recipes-core/images/machines/visionfive2.inc index 71fc659d6..6ad433474 100644 --- a/sources/meta-yoe/recipes-core/images/machines/visionfive2.inc +++ b/sources/meta-yoe/recipes-core/images/machines/visionfive2.inc @@ -1,7 +1,7 @@ # We use updater to handle disk/SD management, therefore remove 96boards-tools IMAGE_INSTALL:remove = "96boards-tools" -KERNEL_IMAGE = "${KERNEL_IMAGETYPE}" +KERNEL_IMAGE = "${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE}" KERNEL_ARTEFACTS = "\ ${KERNEL_IMAGETYPE} \ From de301b1e86f4e7663c82208dfd0529be59f370b6 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 13 Oct 2023 19:19:32 -0700 Subject: [PATCH 4/6] CHANGELOG.md: Add Yoe updater support for Visionfive2 Signed-off-by: Khem Raj --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac464c1a8..d1a87ba15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to - Added recipes - tayga, ttyrun - Add bblock feature to core +- Add Yoe updater support for VisionFive2 board ### Removed From 5cd29b86375680255c10b730b0e7cc3933d6de14 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 13 Oct 2023 19:31:54 -0700 Subject: [PATCH 5/6] Layer Updates: sources/meta-arm sources/meta-openembedded * sources/meta-arm e914891e...bc4d2e41 (4): > CI: add sbsa-acs to recipe report > arm/linux-yocto: remove defconfig patch > arm-bsp/linux-yocto: add recipe for v6.4 kernel > trusted-firmware-a: fix build error when using ccache * sources/meta-openembedded eddc2571a7...d59f6c7529 (8): > meta-python: update ptests status for py-cpuinfo, pytest-mock > python3-pytest-mock: disable broken ptests > meta-perl: Add libtext-diff-perl to fast ptest list > python3-arrow: add from meta-patchtest > python3-py-cpuinfo: disable broken ptests > python-git-pw: add from meta-patchtest > libtext: add ptest > klibc/klibc.inc : Add DEBUG_PREFIX_MAP flag. Signed-off-by: Khem Raj --- sources/meta-arm | 2 +- sources/meta-openembedded | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/meta-arm b/sources/meta-arm index e914891ee..bc4d2e412 160000 --- a/sources/meta-arm +++ b/sources/meta-arm @@ -1 +1 @@ -Subproject commit e914891eee35aae5b7c4c9724af3cace16d3ea0c +Subproject commit bc4d2e41246905a9ba50249d579d85f7769594ad diff --git a/sources/meta-openembedded b/sources/meta-openembedded index eddc2571a..d59f6c752 160000 --- a/sources/meta-openembedded +++ b/sources/meta-openembedded @@ -1 +1 @@ -Subproject commit eddc2571a759f208cd8e3e05f3ca14457b9169dc +Subproject commit d59f6c752927f7846dc11c4aa00a2d0c9860e75c From 47fa1e030c00388143c658169b27b63d8c0334c7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 13 Oct 2023 19:33:51 -0700 Subject: [PATCH 6/6] CHANGELOG.md: Document changes Signed-off-by: Khem Raj --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1a87ba15..4b6a200d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,10 +26,12 @@ and this project adheres to - Upgrade linux-yocto recipes to v6.1.57, v6.5.7 - Upgrade go compiler to 1.20.10 - Upgrade curl to 8.4.0 +- Fix ptests for python3-py-cpuinfo and python3-pytest-mock +- Add ptest for libtext-diff-perl ### Added -- Added recipes - tayga, ttyrun +- Added recipes - tayga, ttyrun, python3-arrow, python-git-pw - Add bblock feature to core - Add Yoe updater support for VisionFive2 board