Skip to content
Open
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
8 changes: 8 additions & 0 deletions conf/machine/beaglev-ahead.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ UBOOT_DTB_BINARY = "th1520-beaglev-ahead.dtb"
IMAGE_BOOT_FILES:remove = "boot.scr.uimg"
IMAGE_BOOT_FILES:append = "fw_payload.bin th1520-beaglev-ahead.dtb extlinux_sd.conf;extlinux/extlinux.conf"
WKS_FILE ?= "beaglev-ahead.wks"
# The rootfs must be sparsed
IMAGE_CLASSES += "image_types_sparse"
IMAGE_FSTYPES += "ext4.sparse"
#============================================

#============================================
Expand All @@ -42,3 +45,8 @@ PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-beaglev-ahead"
PREFERRED_PROVIDER_opensbi ?= "opensbi-revyos"
EXTRA_IMAGEDEPENDS += "u-boot-beaglev-ahead firmware-th1520"
#============================================

#============================================
# Some helpers
MACHINE_EXTRA_RRECOMMENDS += "flashing-script"
#============================================
9 changes: 7 additions & 2 deletions docs/BeagleV-Ahead.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ fastboot reboot
sleep 10
fastboot oem format
fastboot flash uboot ./u-boot-with-spl.bin
fastboot flash boot ./boot.ext4
fastboot flash root ./core-image-minimal-beaglev-ahead.rootfs.ext4
fastboot flash boot ./boot.ext4.sparse
fastboot flash root ./core-image-minimal-beaglev-ahead.rootfs.ext4.sparse
fastboot reboot
```

> **_NOTE:_** You can also use the helper script:
> ```shell
> ./flash.sh
> ```

Check Functionality
===================
Follow the Quickstart-Guide and connect an RS232-to-USB device, then connect to the UART console and login
Expand Down
8 changes: 7 additions & 1 deletion recipes-kernel/linux/linux-beaglev-dev.bb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ SRC_URI = " \

COMPATIBLE_MACHINE = "(beaglev-ahead)"

DEPENDS += "e2fsprogs-native firmware-th1520"
DEPENDS += "android-tools-native e2fsprogs-native firmware-th1520"

SPARSE_BLOCK_SIZE ??= "4096"
# package a separate partition boot.ext4 that can be flashed via fastboot to partition boot
do_deploy:append() {
[ -d ${DEPLOY_DIR_IMAGE}/.boot ] && rm -rf ${DEPLOY_DIR_IMAGE}/.boot
Expand Down Expand Up @@ -58,6 +59,11 @@ do_deploy:append() {

dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/boot.ext4 bs=1 count=0 seek=190M
mkfs.ext4 -F ${DEPLOY_DIR_IMAGE}/boot.ext4 -d ${DEPLOY_DIR_IMAGE}/.boot
# sparse the file so it can be flashed with flastboot without error
if [ -f ${DEPLOY_DIR_IMAGE}/boot.ext4.sparse]; then
rm ${DEPLOY_DIR_IMAGE}/boot.ext4.sparse
fi
img2simg -s ${DEPLOY_DIR_IMAGE}/boot.ext4 ${DEPLOY_DIR_IMAGE}/boot.ext4.sparse ${SPARSE_BLOCK_SIZE};
}

do_deploy[depends] += "opensbi:do_deploy"
29 changes: 29 additions & 0 deletions recipes-support/flashing-scripts/files/beaglev-ahead/flash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

IMAGE_TO_FLASH=${1:-core-image-minimal-beaglev-ahead.rootfs.ext4.sparse}

fastboot_wait_for_device() {
echo -n "Waiting for device "
while ! fastboot devices | grep -q .; do
sleep 1
echo -n "."
done
echo ""
}


echo "Please plug the BeagleV-Ahead board to your computer while maintaining the USB button"
echo "See: https://docs.beagleboard.org/boards/beaglev/ahead/02-quick-start.html#put-beaglev-ahead-in-usb-flash-mode"
fastboot_wait_for_device

echo "Flashing $IMAGE_TO_FLASH"
fastboot flash ram ./u-boot-with-spl.bin
fastboot reboot
fastboot_wait_for_device

fastboot oem format
fastboot flash uboot ./u-boot-with-spl.bin
fastboot flash boot ./boot.ext4.sparse
fastboot flash root ./${IMAGE_TO_FLASH}
echo "Flashing done"
fastboot reboot
1 change: 1 addition & 0 deletions recipes-support/flashing-scripts/files/flash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo "Generic flash.sh script that you can customize for your machine."
24 changes: 24 additions & 0 deletions recipes-support/flashing-scripts/flashing-script_1.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
DESCRIPTION = "Simple flashing script deployed to deploy/ dir"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit deploy

EXCLUDE_FROM_WORLD = "1"
INHIBIT_DEFAULT_DEPS = "1"
# Only one empty meta-package
PACKAGES = "${PN}"

SRC_URI = "file://flash.sh"

S = "${UNPACKDIR}"

do_deploy() {
install -D -m 0744 "${S}/flash.sh" "${DEPLOYDIR}/"
}
addtask deploy after do_patch

# Remove unnecessary tasks.
deltask do_configure
deltask do_compile
deltask do_install