/sys/lib/dist/mkfile: add pi.img target for raspi sdcard image

This commit is contained in:
cinap_lenrek 2018-10-22 00:16:04 +02:00
parent f059563b9d
commit b65a5a1ca5

50
sys/lib/dist/mkfile vendored
View file

@ -21,6 +21,34 @@ cd:V: /tmp/9front.386.iso.gz
mv $target.$pid.pc.iso $target
}
%.pi.img:
@{
objtype=arm
bootcode=/sys/src/boot/bcm/^(bootcode.bin fixup_cd.dat start_cd.elf LICENCE.broadcom)
kernels=/n/src9/$objtype/^(9pi 9pi2)
> /env/config.txt {
echo '[pi0]'
echo 'kernel=9pi'
echo '[pi1]'
echo 'kernel=9pi'
echo '[pi2]'
echo 'kernel=9pi2'
echo '[pi3]'
echo 'kernel=9pi2'
echo 'core_freq=250'
echo '[all]'
echo 'gpu_mem=16'
echo 'enable_uart=1'
}
> /env/cmdline.txt {
echo 'console=0'
}
fatfiles=(/env/config.txt /env/cmdline.txt $bootcode $kernels)
mb=1919 # storage vendors idea of 2GB
mk $target.$pid.disk
mv $target.$pid.disk $target
}
%.zynq.img:
@{
objtype=arm
@ -72,9 +100,25 @@ cd:V: /tmp/9front.386.iso.gz
disk/partfs -m /n/$s $target
d=/n/$s/sdXX
disk/mbr $d/data
disk/fdisk -baw $d/data
disk/prep -bw -a^(9fat nvram fs) $d/plan9
disk/format -d -r 2 $d/9fat $fatfiles
if(~ $target *.pi.img.*){
{
echo 'a p1 . .+100M'
echo 't p1 FAT32'
echo 'a p2 . $'
echo 't p2 PLAN9'
echo 'A p1'
echo 'p'
echo 'w'
echo 'q'
} | disk/fdisk -b $d/data
disk/prep -bw -a^(nvram fs) $d/plan9
disk/format -d $d/dos $fatfiles
}
if not {
disk/fdisk -baw $d/data
disk/prep -bw -a^(9fat nvram fs) $d/plan9
disk/format -d -r 2 $d/9fat $fatfiles
}
hjfs -f $d/fs -n $s -S -r
{
echo echo on