plan9fox/sys/lib/dist/mkfile

83 lines
1.9 KiB
Text
Raw Normal View History

2011-06-09 05:53:13 +00:00
proto=/n/src9/sys/lib/sysconfig/proto/cdproto
iso=/tmp/9front.iso
cd:V: $iso
2011-04-11 19:47:05 +00:00
binds:V:
2011-06-09 23:15:09 +00:00
bind cfg /n/src9/cfg
2012-02-12 03:35:20 +00:00
bind mail/lib /n/src9/mail/lib
2011-06-09 23:15:09 +00:00
bind ndb /n/src9/lib/ndb
2011-09-20 04:14:15 +00:00
bind -a adm/timezone /n/src9/adm/timezone
2012-02-11 22:48:54 +00:00
bind usr /n/src9/usr
2011-06-09 05:53:13 +00:00
bind /n/src9 /n/src9/dist/plan9front
%.iso: $proto
@{rfork n
mk binds
2014-10-31 19:59:35 +00:00
disk/mk9660 -c9j -B 386/9bootiso -E 386/efiboot.fat -p $proto -s /n/src9 -v 'Plan 9 Front' $target
if(test -r /n/src9/386/9boothyb){
dd -if /dev/zero -bs 2048 -count 1024 >> $target
disk/partfs -m /n/partfs $target
disk=/n/partfs/sdXX
disk/mbr -m /n/src9/386/mbr $disk/data
@{echo a p1 '$-1' '$'
echo t p1 ESP
echo A p1
echo w
echo q} | disk/fdisk -b $disk/data
disk/format -b /n/src9/386/pbs -xd -t hard $disk/esp
s = esp.$pid
dossrv -f $disk/esp $s
mount -c /srv/$s /n/esp
cp /n/src9/386/9boothyb /n/esp/9bootfat
mkdir /n/esp/efi
mkdir /n/esp/efi/boot
cp /n/src9/386/boot*.efi /n/esp/efi/boot
unmount /n/esp
rm -f /srv/$s
}}
%.zynq.img:
@{
objtype=arm
kernel=/n/src9/$objtype/9zynq
echo 'bootfile='^`{basename $kernel} > /env/plan9.ini
fatfiles=(/env/plan9.ini $kernel)
mb=1919 # storage vendors idea of 2GB
mk $target.$pid.disk
mv $target.$pid.disk $target
}
%.disk:D: $proto $fatfiles
@{rfork n
mk binds
rm -f $target
dd -if /dev/zero -of $target -bs 1048576 -oseek $mb -count 1
s=`{basename $target}
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
hjfs -f $d/fs -n $s -S -r
{
echo echo on
echo create /dist sys sys 775 d
echo create /usr sys sys 775 d
user=glenda
echo newuser $user
echo newuser adm +$user
echo newuser sys +$user
echo newuser upas +$user
echo echo off
sleep 1
} >> /srv/$s.cmd
mount -N -c /srv/$s /n/newfs
disk/mkfs -z 4096 -U -s /n/src9 -d /n/newfs $proto
echo sync >> /srv/$s.cmd
echo halt >> /srv/$s.cmd
while(test -e /srv/$s.cmd) sleep 1
exit ''
}