changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: /sys/lib/dist/mkfile: add pi.img target for raspi sdcard image

changeset 6842: ff28f1376a7a
parent 6841: abba5fd1c922
child 6843: 7db92ee68f7e
author: cinap_lenrek@felloff.net
date: Mon, 22 Oct 2018 00:16:04 +0200
files: sys/lib/dist/mkfile
description: /sys/lib/dist/mkfile: add pi.img target for raspi sdcard image
     1.1--- a/sys/lib/dist/mkfile
     1.2+++ b/sys/lib/dist/mkfile
     1.3@@ -21,6 +21,34 @@ cd:V:	/tmp/9front.386.iso.gz
     1.4 	mv $target.$pid.pc.iso $target
     1.5 	}
     1.6 
     1.7+%.pi.img:
     1.8+	@{
     1.9+	objtype=arm
    1.10+	bootcode=/sys/src/boot/bcm/^(bootcode.bin fixup_cd.dat start_cd.elf LICENCE.broadcom)
    1.11+	kernels=/n/src9/$objtype/^(9pi 9pi2)
    1.12+	> /env/config.txt {
    1.13+		echo '[pi0]'
    1.14+		echo 'kernel=9pi'
    1.15+		echo '[pi1]'
    1.16+		echo 'kernel=9pi'
    1.17+		echo '[pi2]'
    1.18+		echo 'kernel=9pi2'
    1.19+		echo '[pi3]'
    1.20+		echo 'kernel=9pi2'
    1.21+		echo 'core_freq=250'
    1.22+		echo '[all]'
    1.23+		echo 'gpu_mem=16'
    1.24+		echo 'enable_uart=1'
    1.25+	}
    1.26+	> /env/cmdline.txt {
    1.27+		echo 'console=0'
    1.28+	}
    1.29+	fatfiles=(/env/config.txt /env/cmdline.txt $bootcode $kernels)
    1.30+	mb=1919	# storage vendors idea of 2GB
    1.31+	mk $target.$pid.disk
    1.32+	mv $target.$pid.disk $target
    1.33+	}
    1.34+
    1.35 %.zynq.img:
    1.36 	@{
    1.37 	objtype=arm
    1.38@@ -72,9 +100,25 @@ cd:V:	/tmp/9front.386.iso.gz
    1.39 	disk/partfs -m /n/$s $target
    1.40 	d=/n/$s/sdXX
    1.41 	disk/mbr $d/data
    1.42-	disk/fdisk -baw $d/data
    1.43-	disk/prep -bw -a^(9fat nvram fs) $d/plan9
    1.44-	disk/format -d -r 2 $d/9fat $fatfiles
    1.45+	if(~ $target *.pi.img.*){
    1.46+		{
    1.47+			echo 'a p1 . .+100M'
    1.48+			echo 't p1 FAT32'
    1.49+			echo 'a p2 . $'
    1.50+			echo 't p2 PLAN9'
    1.51+			echo 'A p1'
    1.52+			echo 'p'
    1.53+			echo 'w'
    1.54+			echo 'q'
    1.55+		} | disk/fdisk -b $d/data
    1.56+		disk/prep -bw -a^(nvram fs) $d/plan9
    1.57+		disk/format -d $d/dos $fatfiles
    1.58+	}
    1.59+	if not {
    1.60+		disk/fdisk -baw $d/data
    1.61+		disk/prep -bw -a^(9fat nvram fs) $d/plan9
    1.62+		disk/format -d -r 2 $d/9fat $fatfiles
    1.63+	}
    1.64 	hjfs -f $d/fs -n $s -S -r
    1.65 	{
    1.66 		echo echo on