shithub: riscv

Download patch

ref: 7bae48c452c75115a965aa13243c886a99cbf192
parent: ff7aa0671d8bcb65bc33df25f99b1c886c672df5
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jun 18 14:23:22 EDT 2022

generate boot.scr in /sys/src/boot/reform

--- a/sys/lib/dist/mkfile
+++ b/sys/lib/dist/mkfile
@@ -77,7 +77,7 @@
 	mv $target.$pid.disk $target
 	}
 
-%.zynq.img:
+%.zynq.img:D:
 	@{
 	objtype=arm
 	kernel=/n/src9/$objtype/9zynq
@@ -88,13 +88,11 @@
 	mv $target.$pid.disk $target
 	}
 
-%.reform.img:	/n/src9/sys/src/boot/reform/flash.bin
+%.reform.img:D:	/n/src9/sys/src/boot/reform/flash.bin /n/src9/sys/src/boot/reform/boot.scr
 	@{
 	objtype=arm64
 	kernel=/n/src9/$objtype/9reform.u
-	echo 'load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} ${prefix}9reform.u; bootm ${kernel_addr_r}' > /env/boot.txt
-	aux/txt2uimage -o /env/boot.scr /env/boot.txt
-	fatfiles=(/env/boot.scr $kernel)
+	fatfiles=(/n/src9/sys/src/boot/reform/boot.scr $kernel)
 	mb=1885	# storage vendors idea of 2GB
 	mk $target.$pid.disk
 	mv $target.$pid.disk $target && dd -trunc 0 -bs 1024 -oseek 33 -if /n/src9/sys/src/boot/reform/flash.bin -of $target 
--- /dev/null
+++ b/sys/src/boot/reform/boot.txt
@@ -1,0 +1,2 @@
+load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} ${prefix}9reform.u
+bootm ${kernel_addr_r}
--- a/sys/src/boot/reform/mkfile
+++ b/sys/src/boot/reform/mkfile
@@ -1,6 +1,6 @@
-FILES=flash.bin
+FILES=flash.bin boot.scr
 
-all:V:	flash.bin
+all:V:	$FILES
 
 clean:V:
 	rm -f $FILES
@@ -7,3 +7,6 @@
 
 flash.bin:
 	hget -o flash.bin 'https://source.mnt.re/reform/reform-boundary-uboot/-/jobs/artifacts/v3/raw/flash.bin?job=build'
+
+boot.scr:	boot.txt
+	aux/txt2uimage -o $target $prereq