Subject: Re: Adding bootverbose
To: None <tech-kern@netbsd.org>
From: ITOH Yasufumi <itohy@netbsd.org>
List: tech-kern
Date: 08/09/2000 09:34:30
In article <200008072244.e77Mi1o14599@saruman.ics.muni.cz>
dolecek@ibis.cz writes:
> As suggested by people here, I've added also 'bootquiet', which
> would be used for extra silent boot.
What happens if both 'verbose' and 'quiet' are set? :-)
> Note I've merged code handling common boot flags into new shared function
> boot_flag(), implemented in <sys/boot_flag.h>. The primary reason
> to put it into a header file was so that it can easily
> be used by both bootblock code and common kernel source (some
> ports parse boot flags in e.g. arch/xxx/machdep.c), and also
> to make it possible to inline it.
The boot programs are not necessarily compiled by the toolchain in NetBSD.
I don't think depending on gcc is a good thing.
> The function recognizes sum of all non-conflicting flags
> accross the ports. Currently, it e.g. supports -m (or RB_MINIROOT)
"-a" is not common, it seems....
> Index: sys/systm.h
> ===================================================================
> RCS file: /cvsroot/syssrc/sys/sys/systm.h,v
> retrieving revision 1.113
> diff -u -r1.113 systm.h
> --- systm.h 2000/07/14 07:21:22 1.113
> +++ systm.h 2000/08/07 21:43:02
> @@ -143,6 +143,8 @@
> #endif
>
> extern int boothowto; /* reboot flags, from console subsystem */
> +#define bootverbose (boothowto & AB_VERBOSE)
> +#define bootquiet (boothowto & AB_QUIET)
>
> extern void (*v_putc) __P((int)); /* Virtual console putc routine */
>
Hmm, bootverbose and bootquiet are not variables and
variable-like macros might be confusing.
Isn't it enough to use "boothowto & AB_xxx" everywhere?
> Index: arch/i386/stand/lib/parseutils.c
> ===================================================================
> RCS file: /cvsroot/syssrc/sys/arch/i386/stand/lib/parseutils.c,v
> retrieving revision 1.1
> diff -u -r1.1 parseutils.c
> --- parseutils.c 1997/09/17 17:13:03 1.1
> +++ parseutils.c 2000/08/07 21:43:26
:
> /* format is... */
> - /* [[xxNx:]filename] [-adrs] */
> + /* [[xxNx:]filename] [-adrsv] */
'q' is missing.
> Index: arch/vax/boot/boot/boot.c
> ===================================================================
> RCS file: /cvsroot/syssrc/sys/arch/vax/boot/boot/boot.c,v
> retrieving revision 1.12
> diff -u -r1.12 boot.c
> --- boot.c 2000/07/19 02:39:11 1.12
> +++ boot.c 2000/08/07 21:43:45
:
> -fail: printf("usage: boot [filename] [-asd]\n");
> +fail: printf("usage: boot [filename] [-asdv]\n");
'q' is missing.
> Index: arch/x68k/stand/loadbsd/loadbsd.c
> ===================================================================
> RCS file: /cvsroot/syssrc/sys/arch/x68k/stand/loadbsd/loadbsd.c,v
> retrieving revision 1.5
> diff -u -r1.5 loadbsd.c
> --- loadbsd.c 2000/07/29 20:06:30 1.5
> +++ loadbsd.c 2000/08/07 21:43:46
:
It'd be nice if the usage mesage is also updated. :)
--
ITOH, Yasufumi <itohy@netbsd.org>