From 4486b15211eb5f43bfa55e6b007c050b50595a7b Mon Sep 17 00:00:00 2001 From: drochner Date: Fri, 10 Sep 1999 16:38:46 +0000 Subject: [PATCH] -make ustarfs optional (enabled per default) for cases where space is scarce -make the boot timeout patchable -optionally, call checkpasswd() before the boot menu can be accessed (The latter 2 follow PR port-i386/8196 by Stephan Thesing.) --- sys/arch/i386/stand/biosboot/Makefile | 5 ++++- sys/arch/i386/stand/biosboot/conf.c | 6 +++++- sys/arch/i386/stand/biosboot/main.c | 13 +++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/arch/i386/stand/biosboot/Makefile b/sys/arch/i386/stand/biosboot/Makefile index 78d7aed13947..868a97558d53 100644 --- a/sys/arch/i386/stand/biosboot/Makefile +++ b/sys/arch/i386/stand/biosboot/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.23 1999/07/11 01:22:45 kim Exp $ +# $NetBSD: Makefile,v 1.24 1999/09/10 16:38:46 drochner Exp $ S= ${.CURDIR}/../../../../ @@ -28,7 +28,10 @@ CPPFLAGS+= -DCOMPAT_OLDBOOT -DCOMPAT_386BSD_MBRPART CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_COM0 -DDIRECT_SERIAL .endif +CPPFLAGS+= -DSUPPORT_USTARFS CPPFLAGS+= -DPASS_BIOSGEOM +#CPPFLAGS+= -DBOOTPASSWD + #uncomment if there are problems with memory detection #CPPFLAGS+= -DCONSERVATIVE_MEMDETECT #increase MAXFLENTRIES if "installboot" complains about diff --git a/sys/arch/i386/stand/biosboot/conf.c b/sys/arch/i386/stand/biosboot/conf.c index 1b086e97b455..baa1c3ec6a92 100644 --- a/sys/arch/i386/stand/biosboot/conf.c +++ b/sys/arch/i386/stand/biosboot/conf.c @@ -1,4 +1,4 @@ -/* $NetBSD: conf.c,v 1.3 1998/12/19 19:44:56 he Exp $ */ +/* $NetBSD: conf.c,v 1.4 1999/09/10 16:38:47 drochner Exp $ */ /* * Copyright (c) 1997 @@ -36,7 +36,9 @@ #include #include +#ifdef SUPPORT_USTARFS #include +#endif #include @@ -46,8 +48,10 @@ struct devsw devsw[] = { int ndevs = sizeof(devsw) / sizeof(struct devsw); struct fs_ops file_system[] = { +#ifdef SUPPORT_USTARFS { ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write, ustarfs_seek, ustarfs_stat }, +#endif { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat }, }; int nfsys = sizeof(file_system) / sizeof(struct fs_ops); diff --git a/sys/arch/i386/stand/biosboot/main.c b/sys/arch/i386/stand/biosboot/main.c index 370c3b7544d8..3c3a8fdb5f65 100644 --- a/sys/arch/i386/stand/biosboot/main.c +++ b/sys/arch/i386/stand/biosboot/main.c @@ -1,7 +1,7 @@ -/* $NetBSD: main.c,v 1.16 1999/04/14 11:45:39 drochner Exp $ */ +/* $NetBSD: main.c,v 1.17 1999/09/10 16:38:47 drochner Exp $ */ /* - * Copyright (c) 1996, 1997 + * Copyright (c) 1996, 1997, 1999 * Matthias Drochner. All rights reserved. * Copyright (c) 1996, 1997 * Perry E. Metzger. All rights reserved. @@ -68,6 +68,7 @@ char *names[] = { #define MAXDEVNAME 16 #define TIMEOUT 5 +int boottimeout = TIMEOUT; /* patchable */ static char *default_devname; static int default_unit, default_partition; @@ -249,8 +250,12 @@ main() printf("booting %s - starting in ", sprint_bootsel(names[currname])); - c = awaitkey(TIMEOUT, 1); - if ((c != '\r') && (c != '\n') && (c != '\0')) { + c = awaitkey(boottimeout, 1); + if ((c != '\r') && (c != '\n') && (c != '\0') +#ifdef BOOTPASSWD + && checkpasswd() +#endif + ) { printf("type \"?\" or \"help\" for help.\n"); bootmenu(); /* does not return */ }