From 67bed722f21cb216a0fcc3d3ebebf161b09439d4 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 14 Dec 2014 22:10:34 +0100 Subject: kernel: get rid of /boot/boot parametrization there is no use for "bootdisk" variable parametrization of /boot/boot and no point for the boot section with its boot methods in the kernel configuration anymore. so mkboot and boot$CONF.out are gone. move the rules for bootfs.paq creation in 9/boot/bootmkfile. location of bootfs.proto is now in 9/boot/bootfs.proto. our /boot/boot target is now just "boot". --- sys/src/9/boot/boot.c | 3 +-- sys/src/9/boot/boot.h | 2 -- sys/src/9/boot/bootfs.proto | 58 +++++++++++++++++++++++++++++++++++++++++++++ sys/src/9/boot/bootmkfile | 27 ++++++++++++++------- sys/src/9/boot/mkboot | 33 -------------------------- 5 files changed, 78 insertions(+), 45 deletions(-) create mode 100644 sys/src/9/boot/bootfs.proto delete mode 100755 sys/src/9/boot/mkboot (limited to 'sys/src/9/boot') diff --git a/sys/src/9/boot/boot.c b/sys/src/9/boot/boot.c index 96ea7fc26..4daf5a661 100644 --- a/sys/src/9/boot/boot.c +++ b/sys/src/9/boot/boot.c @@ -5,7 +5,7 @@ #include "../boot/boot.h" void -boot(int argc, char *argv[]) +main(int argc, char *argv[]) { char cputype[64]; char buf[32]; @@ -36,7 +36,6 @@ boot(int argc, char *argv[]) USED(argc); readfile("#e/cputype", cputype, sizeof(cputype)); - setenv("bootdisk", bootdisk, 0); /* setup the boot namespace */ bind("/boot", "/bin", MAFTER); diff --git a/sys/src/9/boot/boot.h b/sys/src/9/boot/boot.h index 4cb7400bb..c72622807 100644 --- a/sys/src/9/boot/boot.h +++ b/sys/src/9/boot/boot.h @@ -2,8 +2,6 @@ enum { Debug = 0, }; -extern char* bootdisk; - extern void fatal(char*); extern int readfile(char*, char*, int); extern void run(char*, ...); diff --git a/sys/src/9/boot/bootfs.proto b/sys/src/9/boot/bootfs.proto new file mode 100644 index 000000000..33df1759f --- /dev/null +++ b/sys/src/9/boot/bootfs.proto @@ -0,0 +1,58 @@ +$objtype + bin + 9660srv + awk + auth + secstore + aux + kbdfs + wpa + bind + cat + cfs + cryptsetup + dd + disk + fdisk + prep + dossrv + echo + cwfs64x + grep + ip + ipconfig + ls + mkdir + mntgen + mount + mv + ndb + dnsgetip + hjfs + rc + rm + sed + sleep + srv + test + unmount + nusb + usbd + ether + disk + kb + xd +rc + lib + rcmain + local.rc 555 sys sys ../boot/local.rc + net.rc 555 sys sys ../boot/net.rc + bin + fstype + diskparts + nusbrc 555 sys sys ../boot/nusbrc + bootrc 555 sys sys ../boot/bootrc +tmp +lib + firmware + + diff --git a/sys/src/9/boot/bootmkfile b/sys/src/9/boot/bootmkfile index 0b873ae7a..e2c73d7eb 100644 --- a/sys/src/9/boot/bootmkfile +++ b/sys/src/9/boot/bootmkfile @@ -1,18 +1,29 @@ BOOTDIR=../boot -BOOTLIB=$BOOTDIR/libboot.a$O BOOTFILES=\ aux.$O\ boot.$O\ - -$BOOTLIB(%.$O):N: %.$O - -$BOOTLIB: ${BOOTFILES:%=$BOOTLIB(%)} - names=`{membername $newprereq} - ar vu $BOOTLIB $names - rm $names + printstub.$O\ $BOOTFILES: $BOOTDIR/boot.h %.$O: $BOOTDIR/%.c $CC -I$BOOTDIR $CFLAGS $BOOTDIR/$stem.c + +boot: $BOOTFILES + $LD -o $target $BOOTFILES + +BOOTFSPROTO=$BOOTDIR/bootfs.proto + +bootfs.paq: $BOOTFSPROTO \ + `{disk/mkfs -s / -ax $BOOTFSPROTO >[2]/dev/null \ + | awk '/^end of archive/{exit}{print $1}' \ + | while(x=`{read}){test -f $x && echo $x}} + mkdir -p bootfs + disk/mkfs -s / -d bootfs $BOOTFSPROTO + @{ + cd bootfs/$objtype/bin + strip * */* */*/* >[2]/dev/null || status='' + } + mkpaqfs -o $target bootfs + rm -rf bootfs diff --git a/sys/src/9/boot/mkboot b/sys/src/9/boot/mkboot deleted file mode 100755 index 339a700a3..000000000 --- a/sys/src/9/boot/mkboot +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/rc -# -# this file configures a boot program (/boot) for a kernel. -# -if(! ~ $#* 1){ - echo usage: mkboot file >[1=2] - exit 1 -} - -cat <<'---' -#include -#include -#include "../boot/boot.h" - ---- - -awk ' - BEGIN { bootprog = "boot"; bootdisk = "/dev/sdC0/"; } - $0 ~ "^boot" && $2=="cpu"\ - { if(NF == 4 && $3 == "boot") - bootdisk = $4 - } - $0 ~ "^boot" && $2=="boot" && NF==3\ - { bootdisk = $3 } - END { print "char* bootdisk = \"" bootdisk "\";" - print "extern void " bootprog "(int, char**);" - print "void" - print "main(int argc, char **argv)" - print "{" - print "\t" bootprog "(argc, argv);" - print "}" - } -' $1 -- cgit v1.2.3