From 7afa95c18407218f753211c30dad79f3622af3af Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 30 May 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-05-30 --- boot/aux.c | 16 ++++++++++++++++ boot/boot.c | 9 +++++---- boot/boot.h | 2 ++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/boot/aux.c b/boot/aux.c index fba62146ddf1285234cdfd17627a9da7b16b09ba..80a6344147a7ee1aa15157f251d75d60314e5744 100644 --- a/boot/aux.c +++ b/boot/aux.c @@ -143,3 +143,19 @@ outin(char *prompt, char *def, int len) } return n; } + +void +getconffile(char *conffile, char *terminal) +{ + char *p, *q; + + *conffile = 0; + p = terminal; + if((p = strchr(p, ' ')) == 0 || p[1] == ' ' || p[1] == 0) + return; + p++; + for(q = p; *q && *q != ' '; q++) + ; + while(p < q) + *conffile++ = *p++; +} diff --git a/boot/boot.c b/boot/boot.c index a35768bfd16683d86ab9e654b7b58e2dc83a4aa0..e1cd7c04a261e9454789608b42fb6cb5e6719fec 100644 --- a/boot/boot.c +++ b/boot/boot.c @@ -14,6 +14,7 @@ char sys[2*NAMELEN]; char username[NAMELEN]; char *sauth; char bootfile[3*NAMELEN]; +char conffile[NAMELEN]; int mflag; int fflag; @@ -21,9 +22,8 @@ int kflag; int aflag; int pflag; -int cache(int); -void swapproc(void); -Method *rootserver(char*); +static void swapproc(void); +static Method *rootserver(char*); void boot(int argc, char *argv[]) @@ -64,6 +64,7 @@ boot(int argc, char *argv[]) readenv("cputype", cputype, sizeof(cputype)); readenv("terminal", terminal, sizeof(cputype)); + getconffile(conffile, terminal); /* * pick a method and initialize it @@ -171,7 +172,7 @@ rootserver(char *arg) return 0; /* not reached */ } -void +static void swapproc(void) { int fd; diff --git a/boot/boot.h b/boot/boot.h index 419dcfa756b351a94db3d7fd97e12d29b98f5c15..cba6f095f2fd98026218e62e34e0c82211c61308 100644 --- a/boot/boot.h +++ b/boot/boot.h @@ -21,6 +21,7 @@ extern char sys[2*NAMELEN]; extern char terminal[NAMELEN]; extern char username[NAMELEN]; extern char bootfile[3*NAMELEN]; +extern char conffile[NAMELEN]; extern char *sauth; /* libc equivalent */ @@ -28,6 +29,7 @@ extern int cache(int); extern int dkauth(void); extern int dkconnect(void); extern void fatal(char*); +extern void getconffile(char*, char*); extern void getpasswd(char*, int); extern void key(int, Method*); extern void newkernel(void);