shithub: riscv

Download patch

ref: 23b2128da14e62c073be633d159cd6005d23d78d
parent: 418d88fe3d151662634c50026cbd9565a7c10fcf
author: iru <devnull@localhost>
date: Sat Apr 16 13:50:51 EDT 2011

Oops, forgot to add port/bootfs.proto and port/mkbootfs.

--- /dev/null
+++ b/sys/src/9/port/bootfs.proto
@@ -1,0 +1,45 @@
+$cputype
+	bin
+		9660srv
+		awk
+		bind
+		bzfs
+		cat
+		dd
+		disk
+			fdisk
+			kfs
+			prep
+		dossrv
+		echo
+		fossil
+			fossil
+		grep
+		gunzip
+		hoc
+		ip
+			ipconfig
+		ls
+		mount
+		ramfs
+		rc
+		read
+		rm
+		sed
+		seq
+		srv
+		test
+		unmount
+		xd
+rc
+	lib
+		rcmain
+		conf.rc 555 sys sys ../boot/conf.rc
+		local.rc 555 sys sys ../boot/local.rc
+		menu.rc 555 sys sys ../boot/menu.rc
+		tcp.rc 555 sys sys ../boot/tcp.rc
+	bin
+		diskparts
+		bootrc 555 sys sys ../boot/bootrc
+tmp
+
--- /dev/null
+++ b/sys/src/9/port/mkbootfs
@@ -1,0 +1,39 @@
+#!/bin/rc
+ 
+fn bootraw {
+	proto=../port/bootfs.proto
+	mkdir bootfs
+
+	aux/stub /sys/log/timesync
+	bind /dev/null /sys/log/timesync
+	# make files writable for now.
+	cat $proto | sed 's!d000!d775!;s!000!664!;s!555!775!;s!444!664!' > proto.cp
+	disk/mkfs -a proto.cp | disk/mkext -d bootfs
+	@{
+		cd bootfs/386/bin
+		strip * */* >[2]/dev/null || status=''
+	}
+	disk/mkfs -a -s bootfs proto.cp >boot.raw
+	rm proto.cp
+}
+
+fn bootbz2 {
+	aux/bflz -n 32 < boot.raw >boot.bflz
+	bzip2 -9 < boot.bflz >boot.bz2
+	rm boot.raw boot.bflz
+}
+
+fn rootbz2 {
+	{
+		echo bzfilesystem
+		cat boot.bz2
+		dd -if /dev/zero -bs 1024 -count 1 >[2]/dev/null
+	} >rootfs.bz2
+	ls -l rootfs.bz2
+	rm boot.bz2
+}
+
+bootraw
+bootbz2
+rootbz2
+rm -rf bootfs