u-boot-starfive does not contain a postinst script to update the board after package installation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
u-boot (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
u-boot-starfive distributes updates to SPL and U-Boot, but it does not flash them to the board. I think it would be useful if it followed the pattern of u-boot-sifive and included a postinst script to update the board.
The script could look something like this. NB: I only have access to a StarFive VisionFive 2 v1.3B board. Not sure if the other revisions are compatible with the SPL and U-Boot images in the u-boot-starfive package:
#!/bin/sh
##
set -e
case "$1" in
configure)
target=""
if grep -q '^StarFive VisionFive 2 v1.3B$' /sys/firmware/
fi
if [ -n "$target" ] && [ -e /dev/mtd/
flashcp -v /usr/lib/
flashcp -v /usr/lib/
fi
;;
esac
exit 0
Hello Scott,
thanks for taking a look at the u-boot-starfive.
The StarFive board has multiple boot options. The vendor U-Boot is typically installed on SPI-flash. But you could also have U-Boot on the eMMC or on the SD-card. I would assume that the GPIOs determining the boot source could also be read in Linux.
When booting into Ubuntu 24.04 I see no /dev/mtd/by-name/ directory. We don't have a udev rule for it.
In /proc/dev I find:
$ cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00001000 "spl"
mtd1: 00010000 00001000 "uboot-env"
mtd2: 00400000 00001000 "uboot"
mtd3: 00a00000 00001000 "reserved-data"
These partitions seem to be derived from the device-tree (cf. arch/riscv/ boot/dts/ starfive/ jh7110- starfive- visionfive- 2.dtsi) .
Best regards
Heinrich