Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add yoe updater support for visionfive2 board #855

Merged
merged 6 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ 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

### Removed

Expand Down
3 changes: 3 additions & 0 deletions conf/projects/visionfive2/config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 <image>
TEST_TARGET_IP = "10.0.0.86"
Expand Down
Original file line number Diff line number Diff line change
@@ -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} \
Expand Down
24 changes: 17 additions & 7 deletions sources/meta-yoe/recipes-support/updater/files/updater.installer
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

VERSION=21.3
VERSION=21.4

. ./platform

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -219,7 +229,7 @@ partition_emmc() {
}

resize_emmc() {
resize_sd $EMMC_DEVICE
resize_sd $EMMC_DEVICE $EMMC_DATA_DEV
}

format_emmc_boot() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
:
}