From 23b2128da14e62c073be633d159cd6005d23d78d Mon Sep 17 00:00:00 2001 From: iru Date: Sat, 16 Apr 2011 17:50:51 -0300 Subject: [PATCH] Oops, forgot to add port/bootfs.proto and port/mkbootfs. --- sys/src/9/port/bootfs.proto | 45 +++++++++++++++++++++++++++++++++++++ sys/src/9/port/mkbootfs | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 sys/src/9/port/bootfs.proto create mode 100755 sys/src/9/port/mkbootfs diff --git a/sys/src/9/port/bootfs.proto b/sys/src/9/port/bootfs.proto new file mode 100644 index 000000000..7c050fe08 --- /dev/null +++ b/sys/src/9/port/bootfs.proto @@ -0,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 + diff --git a/sys/src/9/port/mkbootfs b/sys/src/9/port/mkbootfs new file mode 100755 index 000000000..d8867c5ad --- /dev/null +++ b/sys/src/9/port/mkbootfs @@ -0,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