3 # this file configures a boot program (/boot) for a kernel.
6 echo usage: mkboot file >[1=2]
13 #include "../boot/boot.h"
19 # configure all remote methods, i.e. all methods in the 'boot' section
27 ../port/mkextract boot 0 $* | awk '{
28 printf " { \"" "" $1 "\", "\
39 if (substr(s, 1, 1) == "\"") {
40 sub(/^"[^\"]*"/, "", s)
42 sub(/^[^ \t]*/, "", s)
47 if (substr(s, 1, 1) == "\"") {
48 i = index(substr(s, 2), "\"")
50 return substr(s, 1, i+1)
65 BEGIN { cpuflag = 0; bootprog = "boot"; bootdisk = "#S/sdC0/"; rootdir = "/root"; }
66 $0 ~ "^boot" && $2=="cpu"\
68 if(NF == 4 && $3 == "boot")
71 $0 ~ "^boot" && $2=="rootdir" && NF==3\
73 $0 ~ "^boot" && ($2=="bboot" || $2=="romboot" || $2=="dosboot")\
74 { cpuflag = 1; bootprog = $2; }
75 $0 ~ "^boot" && $2=="boot" && NF==3\
77 END { print "int cpuflag = " cpuflag ";"
78 print "char* rootdir = \"" rootdir "\";"
79 print "char* bootdisk = \"" bootdisk "\";"
80 print "extern void " bootprog "(int, char**);"
82 print "main(int argc, char **argv)"
84 print "\t" bootprog "(argc, argv);"
90 # configure in a cache file system if a
91 # /386/bin/root appears in the bootdir section.
93 ../port/mkextract bootdir 0 $* | awk '
95 $1 ~ "bin/cfs$" { cfs = 1 }
97 print "int (*cfs)(int) = cache;"
99 print "int (*cfs)(int) = 0;"