boot(8): replace bzfs with paqfs

This commit is contained in:
cinap_lenrek 2011-06-04 05:19:29 +00:00
parent f83d4972db
commit 792b186b3a
13 changed files with 51 additions and 97 deletions

View file

@ -55,12 +55,12 @@ ip
port
int cpuserver = 0;
boot
boot boot
tcp
local
bootdir
bootapc.out boot
/alpha/bin/disk/kfs
/alpha/bin/auth/factotum
/alpha/bin/ip/ipconfig
boot$CONF.out boot
/$objtype/bin/paqfs
/$objtype/bin/auth/factotum
bootfs.paq

View file

@ -76,9 +76,6 @@ $p$CONF: $CONF.c $OBJ $LIB
install:V: $p$CONF
cp $p$CONF /$objtype/$p$CONF
rootfs.bz2:
rc ../port/mkbootfs
<../boot/bootmkfile
<../port/portmkfile
<|../port/mkbootrules $CONF

View file

@ -16,6 +16,7 @@ boot(int argc, char *argv[])
{
Waitmsg *w;
int pid, i;
char buf[32];
fmtinstall('r', errfmt);
@ -54,10 +55,10 @@ boot(int argc, char *argv[])
setenv("bootdisk", bootdisk, 0);
/* setup the boot namespace */
run("/boot/mntgen", "-s", "slash", "/mnt", nil);
run("/boot/bzfs", "-f", "/boot/rootfs.bz2", "-m", "/mnt/broot", nil);
bind("/mnt/broot", "/", MAFTER);
bind("/386/bin", "/bin", MAFTER);
run("/boot/paqfs", "-m" "/root", "/boot/bootfs.paq", nil);
bind("/root", "/", MAFTER);
snprint(buf, sizeof(buf), "/%s/bin", cputype);
bind(buf, "/bin", MAFTER);
bind("/rc/bin", "/bin", MAFTER);
bind("/boot", "/bin", MAFTER);

View file

@ -1,5 +1,11 @@
#!/bin/rc
mntgen -s slash /mnt
bind /root /mnt/broot
unmount /root
ramfs
bind -q '#p' /proc
for(i in S f k æ t){
@ -99,6 +105,7 @@ fn main{
# remove part of our temporary root
/mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
/mnt/broot/$cputype/bin/unmount /rc/bin /bin
/mnt/broot/$cputype/bin/unmount /tmp
/mnt/broot/$cputype/bin/unmount /
# create the name space, mount the root fs

View file

@ -66,15 +66,12 @@ port
int cpuserver = 1;
int i8250freq = 3686000;
boot cpu
boot boot
tcp
# paq
local
bootdir
boot$CONF.out boot
/arm/bin/ip/ipconfig
/arm/bin/auth/factotum
# /arm/bin/paqfs
/arm/bin/usb/usbd
# nvram not needed any longer, it's in flash
nvram
/$objtype/bin/paqfs
/$objtype/bin/auth/factotum
bootfs.paq

View file

@ -69,13 +69,12 @@ port
int cpuserver = 1;
int i8250freq = 3686000;
boot cpu
boot boot
tcp
local
bootdir
boot$CONF.out boot
/arm/bin/bzfs
/arm/bin/mntgen
/arm/bin/auth/factotum
rootfs.bz2
/$objtype/bin/paqfs
/$objtype/bin/auth/factotum
bootfs.paq

View file

@ -92,9 +92,6 @@ install:V: /$objtype/$p$CONF
wait
touch $target
rootfs.bz2:
rc ../port/mkbootfs
<../boot/bootmkfile
<../port/portmkfile
<|../port/mkbootrules $CONF

View file

@ -77,9 +77,6 @@ $p$CONF: $CONF.c $OBJ $LIB
$LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
size $target
rootfs.bz2:
rc ../port/mkbootfs
# don't strip the gzipped kernels -- too frustrating when that's all you have!
$p%.gz:D: $p%
gzip -9 <$p$stem >$p$stem.gz
@ -188,13 +185,3 @@ checkdist:VQ:
%.clean:V:
rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h init.h
# testing
9load:D: /usr/rsc/boot/$O.load 9pcload
cat $prereq >$target
9load.flp: 9load
disk/format -b /386/pbs -df $target $prereq
$p$CONF.flp: /386/9load plan9.ini $p$CONF.gz
disk/format -b /386/pbs -df $target $prereq

View file

@ -118,13 +118,12 @@ ip
port
int cpuserver = 1;
boot cpu boot #S/sdC0/
boot boot
tcp
local
bootdir
bootpccpuf.out boot
/386/bin/bzfs
/386/bin/mntgen
/386/bin/auth/factotum
rootfs.bz2
boot$CONF.out boot
/$objtype/bin/paqfs
/$objtype/bin/auth/factotum
bootfs.paq

View file

@ -127,13 +127,12 @@ ip
port
int cpuserver = 0;
boot boot #S/sdC0/
boot boot
tcp
local
bootdir
bootpcf.out boot
/386/bin/bzfs
/386/bin/mntgen
/386/bin/auth/factotum
rootfs.bz2
boot$CONF.out boot
/$objtype/bin/paqfs
/$objtype/bin/auth/factotum
bootfs.paq

View file

@ -5,7 +5,6 @@ $cputype
aux
kbdfs
bind
bzfs
cat
cryptsetup
dd
@ -23,6 +22,7 @@ $cputype
ipconfig
ls
mkdir
mntgen
mount
ramfs
rc

View file

@ -1,39 +0,0 @@
#!/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

View file

@ -30,7 +30,7 @@ all:V:
mk 'CONF='$i
clean:V:
rm -f *.[$OS] *.i *.root.s *.rootc.c cfs.h fs.h init.h conf.h *.out *.m errstr.h rootfs.bz2
rm -f *.[$OS] *.i *.root.s *.rootc.c cfs.h fs.h init.h conf.h *.out *.m errstr.h bootfs.paq
for(i in $CONFLIST $CRAPLIST)
mk $i.clean
@ -92,3 +92,13 @@ boot$CONF.out: $CONF print.$O $BOOTDIR/boot.c $BOOTLIB
$CC $CFLAGS boot$CONF.c
$CC $CFLAGS ../boot/printstub.c
$LD -o boot$CONF.out boot$CONF.$O $BOOTLIB printstub.$O
bootfs.paq: ../port/bootfs.proto
mkdir -p bootfs
disk/mkfs -s / -d bootfs ../port/bootfs.proto
@{
cd bootfs/$objtype/bin
strip * */* >[2]/dev/null || status=''
}
mkpaqfs -o $target bootfs
rm -rf bootfs