Browse Source

sdcard.img: generate sdcard image file for visionfive2

Signed-off-by: Jianlong Huang <jianlong.huang@starfivetech.com>
Jianlong Huang 1 year ago
parent
commit
c4134b09f4
2 changed files with 41 additions and 1 deletions
  1. 35 0
      conf/genimage-vf2.cfg
  2. 6 1
      genimage.sh

+ 35 - 0
conf/genimage-vf2.cfg

@@ -0,0 +1,35 @@
+image sdcard.img {
+	hdimage {
+		gpt = true
+	}
+
+	partition spl {
+		# image = "u-boot-spl.bin.normal.out"
+		partition-type-uuid = 5B193300-FC78-40CD-8002-E86C45580B47
+		offset = 1M
+		size = 2M
+	}
+
+	partition uboot {
+		image = "work/visionfive2_fw_payload.img"
+		partition-type-uuid = 2E54B353-1271-4842-806F-E436D6AF6985
+		offset = 3M
+		size = 5M
+	}
+
+	partition image {
+		# partition-type = 0xC
+		partition-type-uuid = EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
+		image = "work/starfive-visionfive2-vfat.part"
+		offset = 8M
+		size = 292M
+	}
+
+	partition root {
+		# partition-type = 0x83
+		partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
+		image = "work/buildroot_rootfs/images/rootfs.ext4"
+		offset = 300M
+		bootable = true
+	}
+}

+ 6 - 1
genimage.sh

@@ -18,12 +18,17 @@ COLOR_GREEN="\033[1;32m"
 COLOR_YELLOW="\033[1;33m"
 COLOR_RED="\033[1;31m"
 COLOR_GREY="\033[1;30m"
+HWBOARD=visionfive2
 
 TOPDIR=`dirname $0`
 BUILD_DIR=$TOPDIR/work
 INPUT_DIR=$TOPDIR
 OUTPUT_DIR=$TOPDIR/work
-GENIMAGE_CFG=$TOPDIR/conf/genimage.cfg
+if [ $HWBOARD == "visionfive2" ]; then
+	GENIMAGE_CFG=$TOPDIR/conf/genimage-vf2.cfg
+else
+	GENIMAGE_CFG=$TOPDIR/conf/genimage.cfg
+fi
 GENIMAGE=$TOPDIR/work/buildroot_initramfs/host/bin/genimage
 
 if [ ! -f $GENIMAGE ]; then