Skip to content

Commit

Permalink
vf2: move to newer kernel and new partition schema - wip
Browse files Browse the repository at this point in the history
moving over to the kernel version used in the 202302 starfive debian
image, to its boot block setup and partitioning ... if things go well
this will give working pure sd card booting and no more /boot/boot chaos

all this is not tested yet ...
  • Loading branch information
hexdump0815 committed Mar 21, 2023
1 parent 0336ffb commit b821351
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 21 deletions.
12 changes: 6 additions & 6 deletions scripts/create-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,14 @@ if [ "$PMOSKERNEL" != "true" ]; then
export KERNEL_VERSION=`ls ${BUILD_ROOT}/boot/vmlinuz-* | sed 's,.*vmlinuz-,,g' | sort -u`
if [ "$PARTUUID_ROOT" = "YES" ]; then
ROOT_PARTUUID=$(blkid | grep "/dev/loop0p$ROOTPART" | awk '{print $5}' | sed 's,",,g')
if [ -f ${MOUNT_POINT}/boot/boot/extlinux/extlinux.conf ]; then
sed -i "s,ROOT_PARTUUID,$ROOT_PARTUUID,g" ${MOUNT_POINT}/boot/boot/extlinux/extlinux.conf
sed -i "s,KERNEL_VERSION,$KERNEL_VERSION,g" ${MOUNT_POINT}/boot/boot/extlinux/extlinux.conf
if [ -f ${MOUNT_POINT}/boot/extlinux/extlinux.conf ]; then
sed -i "s,ROOT_PARTUUID,$ROOT_PARTUUID,g" ${MOUNT_POINT}/boot/extlinux/extlinux.conf
sed -i "s,KERNEL_VERSION,$KERNEL_VERSION,g" ${MOUNT_POINT}/boot/extlinux/extlinux.conf
fi
else
if [ -f ${MOUNT_POINT}/boot/boot/extlinux/extlinux.conf ]; then
sed -i "s,ROOT_PARTUUID,LABEL=$ROOTPARTLABEL,g" ${MOUNT_POINT}/boot/boot/extlinux/extlinux.conf
sed -i "s,KERNEL_VERSION,$KERNEL_VERSION,g" ${MOUNT_POINT}/boot/boot/extlinux/extlinux.conf
if [ -f ${MOUNT_POINT}/boot/extlinux/extlinux.conf ]; then
sed -i "s,ROOT_PARTUUID,LABEL=$ROOTPARTLABEL,g" ${MOUNT_POINT}/boot/extlinux/extlinux.conf
sed -i "s,KERNEL_VERSION,$KERNEL_VERSION,g" ${MOUNT_POINT}/boot/extlinux/extlinux.conf
fi
fi
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MENU TITLE starfive visionfive2 boot options

LABEL visionfive2
MENU LABEL visionfive2
LINUX ../../vmlinuz-KERNEL_VERSION
INITRD ../../initrd.img-KERNEL_VERSION
FDTDIR ../../dtb-KERNEL_VERSION
LINUX ../vmlinuz-KERNEL_VERSION
INITRD ../initrd.img-KERNEL_VERSION
FDTDIR ../dtb-KERNEL_VERSION
APPEND root=ROOT_PARTUUID rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 apparmor=0
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ boot_targets=distro mmc0 dhcp
# Fix wrong fdtfile name
fdtfile=starfive/jh7110-visionfive-v2.dtb
# Fix missing bootcmd
bootcmd=run bootcmd_distro
bootcmd=run load_distro_uenv;run bootcmd_distro
6 changes: 5 additions & 1 deletion systems/starfive_visionfive2/get-files.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# this file is supposed to be sourced by the get-files shell script

starfive_visionfive2_release_version="5.15.0-vf2-280%2B"
starfive_visionfive2_release_version="5.15.0-vf2-104%2B"
starfive_visionfive2_boot_version="202302"

rm -f ${DOWNLOAD_DIR}/kernel-starfive_visionfive2-${2}.tar.gz
wget -v https://github.com/hexdump0815/linux-starfive-visionfive2-kernel/releases/download/${starfive_visionfive2_release_version}/${starfive_visionfive2_release_version}.tar.gz -O ${DOWNLOAD_DIR}/kernel-starfive_visionfive2-${2}.tar.gz

rm -f ${DOWNLOAD_DIR}/boot-starfive_visionfive2-${2}.dd
wget -v https://github.com/hexdump0815/linux-starfive-visionfive2-kernel/raw/${starfive_visionfive2_release_version}/misc.vf2/misc/boot-vf2-${starfive_visionfive2_boot_version}.dd.gz -O - | gunzip -c | dd bs=512 seek=34 skip=34 of=${DOWNLOAD_DIR}/boot-starfive_visionfive2-${2}.dd
23 changes: 15 additions & 8 deletions systems/starfive_visionfive2/gpt-partitions.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
g
n
1
2048
+16M
4096
+2M
t
20
198
n
2
34816
+512M
8192
+4M
t
2
1
197
n
3
1083392

16384
+512M
t
3
1
n
4
1064960

t
4
20
p
w
Expand Down
4 changes: 2 additions & 2 deletions systems/starfive_visionfive2/partition-mapping.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BOOTFS=fat
ROOTFS=btrfs
BOOTPART=2
ROOTPART=3
BOOTPART=3
ROOTPART=4

0 comments on commit b821351

Please sign in to comment.