boot(8): replace bzfs with paqfs
This commit is contained in:
parent
f83d4972db
commit
792b186b3a
13 changed files with 51 additions and 97 deletions
|
@ -55,12 +55,12 @@ ip
|
||||||
port
|
port
|
||||||
int cpuserver = 0;
|
int cpuserver = 0;
|
||||||
|
|
||||||
boot
|
boot boot
|
||||||
tcp
|
tcp
|
||||||
|
local
|
||||||
|
|
||||||
bootdir
|
bootdir
|
||||||
bootapc.out boot
|
boot$CONF.out boot
|
||||||
/alpha/bin/disk/kfs
|
/$objtype/bin/paqfs
|
||||||
/alpha/bin/auth/factotum
|
/$objtype/bin/auth/factotum
|
||||||
/alpha/bin/ip/ipconfig
|
bootfs.paq
|
||||||
|
|
||||||
|
|
|
@ -76,9 +76,6 @@ $p$CONF: $CONF.c $OBJ $LIB
|
||||||
install:V: $p$CONF
|
install:V: $p$CONF
|
||||||
cp $p$CONF /$objtype/$p$CONF
|
cp $p$CONF /$objtype/$p$CONF
|
||||||
|
|
||||||
rootfs.bz2:
|
|
||||||
rc ../port/mkbootfs
|
|
||||||
|
|
||||||
<../boot/bootmkfile
|
<../boot/bootmkfile
|
||||||
<../port/portmkfile
|
<../port/portmkfile
|
||||||
<|../port/mkbootrules $CONF
|
<|../port/mkbootrules $CONF
|
||||||
|
|
|
@ -16,6 +16,7 @@ boot(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Waitmsg *w;
|
Waitmsg *w;
|
||||||
int pid, i;
|
int pid, i;
|
||||||
|
char buf[32];
|
||||||
|
|
||||||
fmtinstall('r', errfmt);
|
fmtinstall('r', errfmt);
|
||||||
|
|
||||||
|
@ -54,10 +55,10 @@ boot(int argc, char *argv[])
|
||||||
setenv("bootdisk", bootdisk, 0);
|
setenv("bootdisk", bootdisk, 0);
|
||||||
|
|
||||||
/* setup the boot namespace */
|
/* setup the boot namespace */
|
||||||
run("/boot/mntgen", "-s", "slash", "/mnt", nil);
|
run("/boot/paqfs", "-m" "/root", "/boot/bootfs.paq", nil);
|
||||||
run("/boot/bzfs", "-f", "/boot/rootfs.bz2", "-m", "/mnt/broot", nil);
|
bind("/root", "/", MAFTER);
|
||||||
bind("/mnt/broot", "/", MAFTER);
|
snprint(buf, sizeof(buf), "/%s/bin", cputype);
|
||||||
bind("/386/bin", "/bin", MAFTER);
|
bind(buf, "/bin", MAFTER);
|
||||||
bind("/rc/bin", "/bin", MAFTER);
|
bind("/rc/bin", "/bin", MAFTER);
|
||||||
bind("/boot", "/bin", MAFTER);
|
bind("/boot", "/bin", MAFTER);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
#!/bin/rc
|
#!/bin/rc
|
||||||
|
|
||||||
|
mntgen -s slash /mnt
|
||||||
|
bind /root /mnt/broot
|
||||||
|
unmount /root
|
||||||
|
|
||||||
|
ramfs
|
||||||
|
|
||||||
bind -q '#p' /proc
|
bind -q '#p' /proc
|
||||||
|
|
||||||
for(i in S f k æ t){
|
for(i in S f k æ t){
|
||||||
|
@ -99,6 +105,7 @@ fn main{
|
||||||
# remove part of our temporary root
|
# remove part of our temporary root
|
||||||
/mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
|
/mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
|
||||||
/mnt/broot/$cputype/bin/unmount /rc/bin /bin
|
/mnt/broot/$cputype/bin/unmount /rc/bin /bin
|
||||||
|
/mnt/broot/$cputype/bin/unmount /tmp
|
||||||
/mnt/broot/$cputype/bin/unmount /
|
/mnt/broot/$cputype/bin/unmount /
|
||||||
|
|
||||||
# create the name space, mount the root fs
|
# create the name space, mount the root fs
|
||||||
|
|
|
@ -66,15 +66,12 @@ port
|
||||||
int cpuserver = 1;
|
int cpuserver = 1;
|
||||||
int i8250freq = 3686000;
|
int i8250freq = 3686000;
|
||||||
|
|
||||||
boot cpu
|
boot boot
|
||||||
tcp
|
tcp
|
||||||
# paq
|
local
|
||||||
|
|
||||||
bootdir
|
bootdir
|
||||||
boot$CONF.out boot
|
boot$CONF.out boot
|
||||||
/arm/bin/ip/ipconfig
|
/$objtype/bin/paqfs
|
||||||
/arm/bin/auth/factotum
|
/$objtype/bin/auth/factotum
|
||||||
# /arm/bin/paqfs
|
bootfs.paq
|
||||||
/arm/bin/usb/usbd
|
|
||||||
# nvram not needed any longer, it's in flash
|
|
||||||
nvram
|
|
||||||
|
|
|
@ -69,13 +69,12 @@ port
|
||||||
int cpuserver = 1;
|
int cpuserver = 1;
|
||||||
int i8250freq = 3686000;
|
int i8250freq = 3686000;
|
||||||
|
|
||||||
boot cpu
|
boot boot
|
||||||
tcp
|
tcp
|
||||||
local
|
local
|
||||||
|
|
||||||
bootdir
|
bootdir
|
||||||
boot$CONF.out boot
|
boot$CONF.out boot
|
||||||
/arm/bin/bzfs
|
/$objtype/bin/paqfs
|
||||||
/arm/bin/mntgen
|
/$objtype/bin/auth/factotum
|
||||||
/arm/bin/auth/factotum
|
bootfs.paq
|
||||||
rootfs.bz2
|
|
||||||
|
|
|
@ -92,9 +92,6 @@ install:V: /$objtype/$p$CONF
|
||||||
wait
|
wait
|
||||||
touch $target
|
touch $target
|
||||||
|
|
||||||
rootfs.bz2:
|
|
||||||
rc ../port/mkbootfs
|
|
||||||
|
|
||||||
<../boot/bootmkfile
|
<../boot/bootmkfile
|
||||||
<../port/portmkfile
|
<../port/portmkfile
|
||||||
<|../port/mkbootrules $CONF
|
<|../port/mkbootrules $CONF
|
||||||
|
|
|
@ -77,9 +77,6 @@ $p$CONF: $CONF.c $OBJ $LIB
|
||||||
$LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
|
$LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
|
||||||
size $target
|
size $target
|
||||||
|
|
||||||
rootfs.bz2:
|
|
||||||
rc ../port/mkbootfs
|
|
||||||
|
|
||||||
# don't strip the gzipped kernels -- too frustrating when that's all you have!
|
# don't strip the gzipped kernels -- too frustrating when that's all you have!
|
||||||
$p%.gz:D: $p%
|
$p%.gz:D: $p%
|
||||||
gzip -9 <$p$stem >$p$stem.gz
|
gzip -9 <$p$stem >$p$stem.gz
|
||||||
|
@ -188,13 +185,3 @@ checkdist:VQ:
|
||||||
|
|
||||||
%.clean:V:
|
%.clean:V:
|
||||||
rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h init.h
|
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
|
|
||||||
|
|
|
@ -118,13 +118,12 @@ ip
|
||||||
port
|
port
|
||||||
int cpuserver = 1;
|
int cpuserver = 1;
|
||||||
|
|
||||||
boot cpu boot #S/sdC0/
|
boot boot
|
||||||
tcp
|
tcp
|
||||||
local
|
local
|
||||||
|
|
||||||
bootdir
|
bootdir
|
||||||
bootpccpuf.out boot
|
boot$CONF.out boot
|
||||||
/386/bin/bzfs
|
/$objtype/bin/paqfs
|
||||||
/386/bin/mntgen
|
/$objtype/bin/auth/factotum
|
||||||
/386/bin/auth/factotum
|
bootfs.paq
|
||||||
rootfs.bz2
|
|
||||||
|
|
|
@ -127,13 +127,12 @@ ip
|
||||||
port
|
port
|
||||||
int cpuserver = 0;
|
int cpuserver = 0;
|
||||||
|
|
||||||
boot boot #S/sdC0/
|
boot boot
|
||||||
tcp
|
tcp
|
||||||
local
|
local
|
||||||
|
|
||||||
bootdir
|
bootdir
|
||||||
bootpcf.out boot
|
boot$CONF.out boot
|
||||||
/386/bin/bzfs
|
/$objtype/bin/paqfs
|
||||||
/386/bin/mntgen
|
/$objtype/bin/auth/factotum
|
||||||
/386/bin/auth/factotum
|
bootfs.paq
|
||||||
rootfs.bz2
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ $cputype
|
||||||
aux
|
aux
|
||||||
kbdfs
|
kbdfs
|
||||||
bind
|
bind
|
||||||
bzfs
|
|
||||||
cat
|
cat
|
||||||
cryptsetup
|
cryptsetup
|
||||||
dd
|
dd
|
||||||
|
@ -23,6 +22,7 @@ $cputype
|
||||||
ipconfig
|
ipconfig
|
||||||
ls
|
ls
|
||||||
mkdir
|
mkdir
|
||||||
|
mntgen
|
||||||
mount
|
mount
|
||||||
ramfs
|
ramfs
|
||||||
rc
|
rc
|
||||||
|
|
|
@ -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
|
|
|
@ -30,7 +30,7 @@ all:V:
|
||||||
mk 'CONF='$i
|
mk 'CONF='$i
|
||||||
|
|
||||||
clean:V:
|
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)
|
for(i in $CONFLIST $CRAPLIST)
|
||||||
mk $i.clean
|
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$CONF.c
|
||||||
$CC $CFLAGS ../boot/printstub.c
|
$CC $CFLAGS ../boot/printstub.c
|
||||||
$LD -o boot$CONF.out boot$CONF.$O $BOOTLIB printstub.$O
|
$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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue