summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
authorJacob Moody <moody@posixcafe.org>2023-04-01 18:05:27 +0000
committerJacob Moody <moody@posixcafe.org>2023-04-01 18:05:27 +0000
commit218f7a9ec7773484202d6fffb43b53f33524104c (patch)
tree2189d53481e990e9ebe239c15241861b78fcda71 /sys/lib
parent75d6267a5f788162d92e7a5ae126cd8b0770aa8a (diff)
qcowfs(8)
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/dist/mkfile27
1 files changed, 25 insertions, 2 deletions
diff --git a/sys/lib/dist/mkfile b/sys/lib/dist/mkfile
index 045f4560c..07097a4e9 100644
--- a/sys/lib/dist/mkfile
+++ b/sys/lib/dist/mkfile
@@ -21,6 +21,17 @@ cd:V: /tmp/9front.386.iso.gz
mv $target.$pid.pc.iso $target
}
+%.amd64.qcow2:
+ @{
+ objtype=amd64
+ kernel=/n/src9/$objtype/9pc64
+ echo 'bootfile='^`{basename $kernel} > /env/plan9.ini
+ fatfiles=(/386/9bootfat /env/plan9.ini $kernel)
+ mb=3770
+ mk $target.$pid.disk
+ mv $target.$pid.disk $target
+ }
+
%.pi.img:
@{
objtype=arm
@@ -136,9 +147,15 @@ cd:V: /tmp/9front.386.iso.gz
@{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
+ if(~ $target *.amd64.qcow2.*){
+ disk/qcowfs -n `{echo $mb '*1048576' | pc} $target
+ disk/partfs -m /n/$s /mnt/qcow/data
+ }
+ if not {
+ dd -if /dev/zero -of $target -bs 1048576 -oseek $mb -count 1
+ disk/partfs -m /n/$s $target
+ }
d=/n/$s/sdXX
disk/mbr $d/data
if(~ $target *.pi.img.* *.pi3.img.*){
@@ -169,6 +186,12 @@ cd:V: /tmp/9front.386.iso.gz
disk/prep -bw -a^(nvram fs) $d/plan9
disk/format -d $d/dos $fatfiles
}
+ if not if(~ $target *.amd64.qcow2.*){
+ disk/mbr -m /386/mbr $d/data
+ disk/fdisk -baw $d/data
+ disk/prep -bw -a^(9fat nvram fs) $d/plan9
+ disk/format -b /386/pbs -d -r 2 $d/9fat $fatfiles
+ }
if not {
disk/fdisk -baw $d/data
disk/prep -bw -a^(9fat nvram fs) $d/plan9