shithub: iso

ref: 053da17fb4dd47d127127b01728c31d825c46afb
dir: /bin/buildisos.rc/

View raw version
#!/bin/rc -e
rfork en

home=/usr/build
webfs

cd $home/code/plan9front

archs=(amd64 386 arm arm64 spim)

www=$home/www/9front

. ./sys/lib/rootstub
. ./sys/lib/rootbind

# preclean
cd /sys/src
mk clean
cd /sys/src/boot
mk clean
cd /sys/src/9
mk clean

# build for cputype
cd /sys/src
mk install

# build everything
for(i in $archs)@{
	rfork en

	objtype=$i
	bind -c /n/src9/$i /$i

	# user
	cd /sys/src
	mk nuke
	mk libs
	mk install

	# kernel
	switch($objtype){
	case amd64
		cd /sys/src/9/pc64
		mk clean
		mk install
		mk clean
	case 386
		cd /sys/src/9/pc
		mk clean
		mk install
		mk clean
	case arm
		cd /sys/src/9/bcm
		mk clean
		mk 'CONF=pi' install
		mk 'CONF=pi2' install
		mk clean
	case arm64
		cd /sys/src/9/bcm64
		mk clean
		mk 'CONF=pi3' install
		mk 'CONF=pi4' install
		mk clean
		cd /sys/src/9/imx8
		mk clean
		mk 'CONF=reform' install
		mk clean
	case spim
		cd /sys/src/9/mt7688/
		mk clean
		mk install
		mk clean
	}

	# bootloader
	switch($objtype){
	case 386 amd64
		cd /sys/src/boot/pc
		mk clean
		mk install
		mk clean
		cd /sys/src/boot/efi
		mk clean
		mk install
		mk clean
	case arm arm64
		cd /sys/src/boot/bcm
		mk clean
		mk
		mk clean
		cd /sys/src/boot/reform
		mk clean
		mk
		mk clean
	}
}

# postclean
cd /sys/src
mk clean
cd /sys/src/boot
mk clean
cd /sys/src/9
mk clean

# make manpage indices
cd /sys/man
mk

fn mkdist {
	cd /sys/lib/dist
	mk $www/$1.gz
}

for(a in $archs){
	switch($a){
	case amd64
		mkdist $release.amd64.iso
		mkdist $release.amd64.qcow2
	case 386
		mkdist $release.386.iso
	case arm
		mkdist $release.pi.img
	case arm64
		mkdist $release.pi3.img
		mkdist $release.reform.img
	}
}