For those who are interested in upgrade from debian-69 to 202302 I’m sharing my notes:
Everything should be the same for SD card except fdisk (which will do online resize)
I booted older image with:
-
UART connected
-
ethernet and assigned IP
-
fan & heatsink, eMMC 32GB module, nvme
-
connected via IP and downloaded new image to PC and moved it via sftp to board, for bootloader and u-boot there are links to github, but not for debian image, please share it in future so it can be directly downloaded via command line with wget.
-
decompressing image:
bzip2 -d starfive-jh7110-202302-eMMC-minimal-desktop.img.bz2
- at this stage lsblk looks like this:
root@starfive:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mtdblock0 31:0 0 128K 0 disk
mtdblock1 31:1 0 3M 0 disk
mtdblock2 31:2 0 1M 0 disk
mmcblk1 179:0 0 29.1G 0 disk
|-mmcblk1p1 179:1 0 16M 0 part
|-mmcblk1p2 179:2 0 100M 0 part /boot
`-mmcblk1p3 179:3 0 15.5G 0 part
mmcblk0 179:8 0 28.9G 0 disk
|-mmcblk0p1 179:9 0 16M 0 part
|-mmcblk0p2 179:10 0 100M 0 part
`-mmcblk0p3 179:11 0 15.5G 0 part
mmcblk0boot0 179:16 0 4M 1 disk
mmcblk0boot1 179:24 0 4M 1 disk
nvme0n1 259:0 0 232.9G 0 disk
`-nvme0n1p1 259:1 0 232.9G 0 part /
(boot from sd card mmcblk1, eMMC as mmcblk0 with some earlier image, nvme not used at this time)
4. ok, lets burn eMMC new image:
root@starfive:~# sudo dd if=~/starfive-jh7110-202302-eMMC-minimal-desktop.img of=/dev/mmcblk0 bs=4M status=progress
2252341248 bytes (2.3 GB, 2.1 GiB) copied, 16 s, 140 MB/s
550+0 records in
550+0 records out
2306867200 bytes (2.3 GB, 2.1 GiB) copied, 39.4746 s, 58.4 MB/s
- sync drive information:
root@starfive:~# sync
- burned image is 2GB in size so last partition needs to be adjusted with fdisk, basically by deleting and recreating last (4) partition at same place with its signature:
root@starfive:~# fdisk /dev/mmcblk0
Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
GPT PMBR size mismatch (4505599 != 62929919) will be corrected by write.
Command (m for help): d
Partition number (1-4, default 4): 4
Partition 4 has been deleted.
Command (m for help): n
Partition number (4-128, default 4): 4
First sector (34-62929886, default 221184):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (221184-62929886, default 62928895):
Created a new partition 4 of type 'Linux filesystem' and of size 29.9 GiB.
Partition #4 contains a ext4 signature.
Do you want to remove the signature? [Y]es/[N]o: N
Command (m for help): w
The partition table has been altered.
Syncing disks.
- time to update mtd, I got utils earlier with
apt install mtd-utils
root@starfive:~# wget -q https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v2.10.4/u-boot-spl.bin.normal.out
root@starfive:~# wget -q https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v2.10.4/visionfive2_fw_payload.img
- checking image hashes:
root@starfive:~# curl -L https://github.com/starfive-tech/VisionFive2/releases/download/VF2_v2.10.4/sha256sum.md
...
f0a5677f8f6e69f33676a2342684d931854736af1a5fe7766a6a1a60dbfd4094 u-boot-spl.bin.normal.out
bdefd19f7488129a7599df4f5e4ee28ec32fd3b5347ecbbd8e8ec9cb771259f3 visionfive2_fw_payload.img
...
root@starfive:~# sha256sum u-boot-spl.bin.normal.out
f0a5677f8f6e69f33676a2342684d931854736af1a5fe7766a6a1a60dbfd4094 u-boot-spl.bin.normal.out
root@starfive:~# sha256sum visionfive2_fw_payload.img
bdefd19f7488129a7599df4f5e4ee28ec32fd3b5347ecbbd8e8ec9cb771259f3 visionfive2_fw_payload.img
- ok, so updating:
root@starfive:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00001000 "spl"
mtd1: 00300000 00001000 "uboot"
mtd2: 00100000 00001000 "data"
root@starfive:~# flashcp -v u-boot-spl.bin.normal.out /dev/mtd0
Erasing blocks: 32/32 (100%)
Writing data: 127k/127k (100%)
Verifying data: 127k/127k (100%)
root@starfive:~# flashcp -v visionfive2_fw_payload.img /dev/mtd1
Erasing blocks: 684/684 (100%)
Writing data: 2734k/2734k (100%)
Verifying data: 2734k/2734k (100%)
- after this - I just poweroff, unplugged sd card, changed boot priority dip switches and started board from eMMC.
It started successfully
Here I needed to tweak new installation, because of lack of ssh I needed to do so from UART (probably monitor + keyboard is another option), my steps were:
- fix apt:
root@starfive:~# wget -q https://deb.debian.org/debian-ports/pool/main/d/debian-ports-archive-keyring/debian-ports-archive-keyring_2023.02.01_all.deb
root@starfive:~# dpkg -i debian-ports-archive-keyring_2023.02.01_all.deb
root@starfive:~# echo -e "#`cat /etc/apt/sources.list`\ndeb http://ftp.ports.debian.org/debian-ports/ unstable main non-free" > /etc/apt/sources.list
root@starfive:~# apt update && apt upgrade -f && apt autoremove
- install needed tools + modify (/etc/ssh/sshd_config) to allow root login
root@starfive:~# apt install openssh-server screen -y
at this stage system is ready, of course I added more things and get rid of several things (like gui, using it headless only).
at the end lsblk look like this:
root@starfive:~# lsblk
[ 131.878423] mmc_host mmc0: Bus speed (slot 0) = 198000000Hz (slot req 400000Hz, actual 399193HZ div = 248)
[ 132.135122] mmc_host mmc0: Bus speed (slot 0) = 198000000Hz (slot req 100000000Hz, actual 99000000HZ div = 1)
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mtdblock0 31:0 0 128K 0 disk
mtdblock1 31:1 0 3M 0 disk
mtdblock2 31:2 0 1M 0 disk
mmcblk0 179:0 0 28.9G 0 disk
├─mmcblk0p1 179:1 0 2M 0 part
├─mmcblk0p2 179:2 0 4M 0 part
├─mmcblk0p3 179:3 0 100M 0 part /boot
└─mmcblk0p4 179:4 0 15.5G 0 part /
mmcblk0boot0 179:8 0 4M 1 disk
mmcblk0boot1 179:16 0 4M 1 disk
nvme0n1 259:0 0 232.9G 0 disk
└─nvme0n1p1 259:1 0 232.9G 0 part
on UART there are many messages about changing frequency of mmc. Also I noticed that it’s running in HS200 mode (my is capable of HS400). so far board hanged two times with some messages about stalled cpu, once I needed to do poweroff.
Everything went smooth on second board.
My impressions about this image:
- please share it in future via cli downloadable image, google/baidu needs full browser (or some combination to pass auth cookies)
- it’s fresh image and apt is already broken with old key and packages
- initial size 2GB is ok to do setup, but system takes 95% so if You forgot to resize then it will not allow to do any update - will run out of space quickly
- kernel of course is old, I expected something more decent
- lack of sshd is not helping - You need uart or monitor/keyboard to connect for first time,
- cli image would be great, now I needed to remove most of packages due to gui, that one could be about 2/3 smaller