Subject: checkconf v1.7 - check your kernel config files...
To: None <current-users@NetBSD.ORG>
From: Luke Mewburn <lm@melb.cpr.itg.telecom.com.au>
List: current-users
Date: 03/03/1995 20:19:11
Here's the latest version of a script I've written.  It's written in perl, so
you'll need that.

It examines your kernel config files (of config.new format, so HP300 or Vax
config files won't work) and displays what's configured.

I've marked entries which I'm not sure about with '-->', so could those
who are more knowledgable about the non-i386 ports mail me personally
with any corrections.

Also, please mail me any obvious defines I may have missed.

I noticed a couple of things whilst doing this:
    - the mac port config files use MC68030 & MC68040, yet the mac locore.s,
      and the other m68k based ports use M68030 & M68040. A minor anomaly.
    - two of the ports define NEWCONFIG (mac68k & sun), and the pc532 uses
      CONFIG_NEW. Given that there are no old-style files left, is it worth
      cleaning up the code to depreciate this?

Luke.

-- cut here --
#!/bin/sh
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	checkconf
#
echo x - checkconf
sed 's/^X//' >checkconf << 'END-of-checkconf'
X#!/usr/bin/perl
X#
X# Copyright 1994, 1995 Luke Mewburn <lm@werj.com.au>.  All rights reserved.
X#
X# Redistribution and use in source and binary forms, with or without
X# modification, are permitted provided that the following conditions
X# are met:
X# 1. Redistributions of source code must retain the above copyright
X#    notice, this list of conditions and the following disclaimer.
X# 2. Redistributions in binary form must reproduce the above copyright
X#    notice, this list of conditions and the following disclaimer in the
X#    documentation and/or other materials provided with the distribution.
X# 3. All advertising materials mentioning features or use of this software
X#    must display the following acknowledgement:
X# 	This product includes software developed by Luke Mewburn.
X# 4. The name of the author may not be used to endorse or promote products
X#    derived from this software without specific prior written permission.
X# 
X# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
X# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
X# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
X# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
X# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
X# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
X# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
X# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
X# 
X# $Id: checkconf,v 1.7 1995/03/03 08:46:22 lukem Exp $
X#
X# checkconf --
X#	check the validity of netbsd kernel config files
X#
X# $Log: checkconf,v $
X# Revision 1.7  1995/03/03  08:46:22  lukem
X# updated entries for alpha, amiga, da30, mac68k, pc532, pmax, sparc, sun3
X# cleaned up/sorted all data structures into a reasonable order
X#
X# Revision 1.6  1995/03/02  13:13:53  root
X# support for multiple depth include files
X# initial macintosh definitions
X#
X# Revision 1.5  1995/02/18  16:09:05  root
X# added amiga definitions
X# cleaned up general defs
X#
X# Revision 1.4  1995/01/24  11:33:28  root
X# updated for config.new & NetBSD 1.0
X#
X# Revision 1.3  1994/08/06  10:01:04  root
X# updated %devices entries for more generic definitions
X# updated %pseudo-devices for the same
X# cleaned up a couple more options
X#
X# Revision 1.2  1994/08/06  08:48:04  root
X# fixed up a few of the descriptions as suggested by Charles Hannum
X#
X# Revision 1.1  1994/08/06  08:33:30  root
X# Initial revision
X#
X
X#
X# TODO:
X#	- entries marked with '-->' need to be clarified
X#	- needs to have HP300 & vax options incorporated
X#
X
Xrequire "shellwords.pl";
Xrequire "dumpvar.pl";
X
Xdie("Usage: $0 conf_file\n") unless (@ARGV);
X
X#
X#	constants
X#
X$MAX_COLS = 80;
X
X#
X#	known machine types
X#
X%machines = (
X    'alpha',		'DEC Alpha AXP',
X    'amiga',		'Amiga',
X    'da30',		'DA-30 single-board',
X    'i386',		'Intel 386 or higher',
X    'mac68k',		'Macintosh',
X    'm68k',		'Motorola 68000',
X    'pc532',		'PC532 NS-32532 based homebrew',
X    'sparc',		'Sparc',
X    'sun3',		'Sun 3',
X);
X
X#
X#	known options
X#
X%options = (
X		# CPUs
X    'DEC_3000_500',	'DEC AXP 3000/400, /500, /600, & /700 support',
X    'FPCOPROC',		'6888[12] support',
X    'FPSP',		'6888[12] support',
X    'I386_CPU',		'80386 support',
X    'I486_CPU',		'i486 support',
X    'I586_CPU',		'Pentium support',
X    'M68020',		'68020 support',
X    'M68030',		'68030 support',
X    'M68040',		'68040 support',
X    'MATH_EMULATE',	'i387 floating point emulation',
X    'MC68030',		'68030 support [OBSOLETE - use M68030]',
X    'MC68040',		'68040 support [OBSOLETE - use M68040]',
X    'SUN4',		'Sparc sun4 architecture support',
X    'SUN4C',		'Sparc sun4c architecture support',
X    'SUN4M',		'Sparc sun4m architecture support',
X    'SUN3_50',		'Sun 3/50',
X    'SUN3_60',		'Sun 3/60',
X    'SUN3_110',		'Sun 3/110',
X    'SUN3_160',		'Sun 3/160',
X    'SUN3_260',		'Sun 3/260',
X
X		# misc stuff
X    'DST',		'daylight savings is used by RTC',
X    'DUMMY_NOPS',	'speed hack; will break on some machines',
X    'GENERIC',		'Generic kernel ?',
X    'LKM',		'loadable kernel modules',
X    'TIMEZONE',		'timezone to adjust RTC by (minutes west of UTC)',
X    'USER_LDT',		'user creatable i386 LDTs (for WINE Windows emulator)',
X
X		# tuning
X    'CONFIG_NEW',	'--> Using config.new (pc532)',
X    'MACHINE_NONCONTIG','support for non-contiguous physical memory',
X    'MAPMEM',		'--> macintosh memory mapping',
X    'MAXFDESCS',	'--> Maximum # of file descriptors',
X    'NEWCONFIG',	'--> Using config.new (mac68k, sun3)',
X    'NKMEMCLUSTERS',	'size of kernel malloc area',
X    'SHMMAXPGS',	'maximum pages for SYSVSHM, default = 1024 pages',
X    'SYSVMSG',		'System V-like message queues',
X    'SYSVSEM',		'System V-like semaphores',
X    'SYSVSHM',		'System V-like memory sharing',
X
X		# debug
X    'DDB',		'in-kernel debugger',
X    'DEBUG',		'set to -g for full symbol table',
X    'DIAGNOSTIC',	'internal consistancy checks',
X    'KGDB',		'in-kernel gdb debugger',
X    'KTRACE',		'system call tracing, a la ktrace(1)',
X    'SYMTAB_SPACE',	'--> bytes allocated to symbol table',
X    'CONTEXT_DEBUG',	'--> Sun 3 specific context switch debugging',
X    'EXEC_DEBUG',	'--> Sun 3 specific exec() debugging',
X    'PMAP_DEBUG',	'--> Sun 3 specific pmap() debugging',
X
X		# memory / io
X    'COMDEF_SPEED',	'default speed of tty lines',
X    'DEVPAGER',		'allow mmap() of devices',
X    'FASTLINKS',	'store short symlinks in 4.2UFS inode [OBSOLETE]',
X    'SCSI',		'--> old generic SCSI system [OBSOLETE]',
X    'SWAPPAGER',	'paging of processes; REQUIRED',
X    'UCONSOLE',		'allow non-root users to aquire console with TIOCCONS',
X    'VNODEPAGER',	'allow mmap() of files',
X    'XSERVER',		'allows machine to be an X server with PCVT',
X
X		# filesystems
X    'ADOSFS',		'Amiga DOS file system',
X    'CD9660',		'ISO 9660 + Rock Ridge file system',
X    'FDESC',		'/dev/fd',
X    'FFS',		'UFS',
X    'FIFO',		'FIFOs',
X    'ISOFS',		'ISO 9660 + Rock Ridge file system [OBSOLETE]',
X    'KERNFS',		'/kern kernel file system',
X    'LFS',		'log-structured file system',
X    'LOFS',		'loopback file system [OBSOLETE]',
X    'MFS',		'memory file system (shares memory and swap space)',
X    'MSDOSFS',		'MS-DOS file system',
X    'NFSCLIENT',	'Network File System (NFS) client',
X    'NFSSERVER',	'Network File System (NFS) server',
X    'NULLFS',		'null file system (incorporates lofs)',
X    'PCFS',		'MS-DOS file system [OBSOLETE]',
X    'PORTAL',		'portal file system (sockets visible as files?)',
X    'PROCFS',		'/proc file system',
X    'QUOTA',		'quotas in UFS',
X    'UMAP',		'--> typo for UMAPFS? [OBSOLETE]',
X    'UMAPFS',		'null file system (with uid & gid remapping)',
X    'UNION',		'union file system',
X
X		# networking
X    'CCITT',		'X.25',
X    'EON',		'OSI tunnelling over IP?',
X    'GATEWAY',		'packet forwarding',
X    'HDLC',		'X.25 HDLC (needed by CCITT)',
X    'IMP',		'host-to-IMP from ARPAnet days [OBSOLETE]',
X    'INET',		'IP + ICMP + TCP + UDP',
X    'ISO',		'OSI',
X    'LLC',		'X.25 LLC (needed by CCITT)',
X    'MROUTING',		'multicast routing',
X    'MULTICAST',	'multicast networking - always there [OBSOLETE]',
X    'NFS_BOOT_RWSIZE',	'NFS read/write size for mount at boot',
X    'NS',		'xerox XNS protocol',
X    'TPIP',		'connection-based (a la TCP) protocol for ISO',
X
X		# compat
X    'COMPAT_09',	'NetBSD 0.9 binary compatibility',
X    'COMPAT_10',	'NetBSD 1.0 binary compatibility',
X    'COMPAT_42',	'--> 4.2 compatibility [OBSOLETE]',
X    'COMPAT_43',	'BSD 4.3 compatibility',
X    'COMPAT_LINUX',	'Linux binary compatibility',
X    'COMPAT_NOMID',	'NetBSD 0.8, BSDI, 386BSD binary compatibility',
X    'COMPAT_OSF1',	'OSF/1 static binary compatibility',
X    'COMPAT_SUNOS',	'SunOS 4.x compatibility',
X    'COMPAT_SVR4',	'SVR4 binary compatibility',
X    'OLD_EXEC',		'DA-30 support for old ZMAGIC binaries',
X    'TCP_COMPAT_42',	'BSD 4.2 TCP/IP compatibility',
X
X		# security
X    'FDSCRIPTS',	'exec Execute only scripts via /dev/fd',
X    'SETUIDSCRIPTS',	'allow Execute only and SetUID scripts via /dev/fd',
X
X		# i386 specific
X    'SBPRO',		'--> SoundBlaster Pro [OBSOLETE]',
X
X		# amiga specific
X    'GRF_A2024',	'Amiga A2024 graphics adapter',
X    'GRF_AGA',		'Amiga AGA chipset graphics',
X    'GRF_ECS',		'Amiga Enhanced Chip Set graphics',
X    'GRF_NTSC',		'Amiga NTSC graphics',
X    'GRF_PAL',		'Amiga PAL graphics',
X    'PANICWAIT',	'--> some amiga debug option',
X    'RETINACONSOLE',	'Use Retina as console',
X    'SCSIDEBUG',	'--> some amiga debug option',
X    'SYSCALL_DEBUG',	'--> some amiga debug option',
X
X		# sparc specific
X    'RCONSOLE',		'fast rasterop console',
X);
X
X#
X#	known devices (master, controller, device, disk, and tape entries)
X#
X# these entries are matched with the regex '(\D+)(\d)$' for ease.
X# '%d' in the description matches the actual device number
X#
X# For new devices, if '([^\*])(\*)' matches, then the %d is removed,
X# and "generic" is appended to the front of the description...
X%devices = (
X	    # backplanes & card slots
X    'asic',	'DEC AXP IO ASIC controller',
X    'gvpbus',	'Amiga GVP expansion backplane',
X    'iio',	'DA30 IO controller',
X    'isa',	'PC clone ISA bus',
X    'mainbus',	'Amiga or Sparc backplane',
X    'membus',	'PC532 backplane',
X    'nubus',	'Apple NuBus %d',
X    'obio',	'Sparc backplane',
X    'pci',	'PCI bus',
X    'sbus',	'Sun S-bus %d',
X    'tc',	'TurboChannel bus %d',
X    'vmes',	'--> VME short backplace %d',
X    'vmel',	'--> VME long backplace %d',
X    'zbus',	'Amiga ZORRO bus %d',
X
X	    # console devices
X    'adb',	'Apple Desktop Bus %d',
X    'bwtwo',	'Sparc mono display %d', 
X    'cgsix',	'Sparc accelerated 8 bit color display %d',
X    'cgthree',	'Sparc 8 bit color display %d',
X    'grf',	'graphics display card %d',
X    'grfcc',	'--> some Amiga custom chip based graphics %d',
X    'grfrh',	'Amiga Retina III graphics card %d',
X    'grfrt',	'Amiga Retina II graphics card %d',
X    'gsp',	'GSP controlled DA-30 display %d',
X    'ite',	'Amiga bitmapped terminal %d ?',
X    'kbd',	'keyboard %d',
X    'kd',	'serial console keyboard & display %d',
X    'lms',	'Logitech mouse %d',
X    'mms',	'Microsoft InPort bus mouse %d',
X    'pc',	'pccons console driver for PC keyboard & monitor',
X    'pms',	'PS/2 auxiliary port %d',
X    'vt',	'pcvt virtual multi-console driver PC keyboard & monitor',
X
X	    # cpus, clocks, registers, proms, memory
X    'clock',	'Amiga or Sparc clock',
X    'cpu',	'AXP cpu',
X    'eeprom',	'Sun3 EEPROM',
X    'idprom',	'Sun3 system type & serial number ID PROM',
X    'memreg',	'Sun4c memory error register',
X    'npx',	'80x87 numeric co-processor',
X    'obctl',	'Sun3 control space hack',
X    'obmem',	'Sun3 on-board memory space',
X    'oclock',	'Sun 4/[12]00 clock',
X    'prom',	'--> Sun3 PROM',
X    'timer',	'Sparc counter-timer',
X
X	    # IDE devices
X    'id',	'DA30 IDE disk %d',
X    'idc',	'DA30 IDE controller %d',
X    'idesc',	'A4000 & A1200 IDE controller %d',
X    'wd',	'PC ST506/IDE disk %d',
X    'wdc',	'PC ST506/IDE controller %d',
X    'wfc',	'WD1002-05 hard & floppy disk controller %d',
X
X	    # floppy devices
X    'auxreg',	'Sparc floppy drive %d',
X    'fd',	'PC floppy drive %d',
X    'fdc',	'PC floppy controller %d',
X
X	    # other non-SCSI devices
X    'mcd',	'Mitsumi non-SCSI CDROM %d',
X    'rd',	'Ram disk %d',
X    'wt',	'Non-SCSI tape drive %d',
X
X	    # SCSI devices
X    'afsc',	'A4091 SCSI controller %d',
X    'aha',	'Adaptec 154x ISA SCSI controller %d',
X    'ahb',	'Adaptec 174x EISA SCSI controller %d',
X    'ahsc',	'A3000 SCSI controller %d',
X    'aic',	'AIC6360 SCSI controller %d',
X    'atzsc',	'A2091 SCSI controller %d',
X    'bt',	'BusLogic 742 SCSI controller %d',
X    'cd',	'SCSI CDROM %d',
X    'ch',	'SCSI tape changer %d',
X    'dma',	'sun4c SCSI dma %d',
X    'esp',	'PC532 or Sparc AIC6360 SCSI controller %d',
X    'espdma',	'Sun FSBE/S or sun4m SCSI dma %d',
X    'gtsc',	'GVP SCSI controller %d',
X    'ivsc',	'IVS SCSI controller %d', 
X    'mgnsc',	'Magnum SCSI controller %d',
X    'mlhsc',	'Hacker SCSI controller %d',
X    'ncr',	'NCR 53C8xx (i386) or 5380 (pc532) SCSI controller %d',
X    'ncr96scsi','--> Quadra SCSI controller %d ?',
X    'ncrscsi',	'Mac II SCSI controller %d',
X    'otgsc',	'12 gauge SCSI controller %d',
X    'sbic',	'DA30 SCSI controller %d',
X    'scsibus',	'SCSI bus %d',
X    'sd',	'SCSI disk %d',
X    'sea',	'--> unknown Seagate SCSI controller %d',
X    'si',	'Sun3 VME NCR 5380 SCSI controller %d',
X    'st',	'SCSI tape %d',
X    'tcds',	'--> TurboChannel SCSI controller %d',
X    'uha',	'UltraStor 14f SCSI controller %d',
X    'wesc',	'Warp engine SCSI controller %d',
X    'wstsc',	'Wordsync II SCSI controller %d',
X    'zssc',	'Zeus SCSI controller %d',
X
X	    # sound
X    'asc',	'Apple Sound Chip %d',
X    'audio',	'Sparcstation audio %d',
X    'pas',	'ProAusio Spectrum %d',
X    'sb',	'Sound Blaster %d',
X    'wss',	'Windows Sound System %d',
X
X	    # ethernet
X    'ae',	'Apple DS8390 based ethernet %d',
X    'ed',	'WD/SMC 80x3, 8216, 3C503, NE[12]000 ethernet %d',
X    'ep',	'3com 3c579? ethernet %d',
X    'es',	'SMC 91C90 ethernet %d',
X    'hp',	'hp ISA ethernet %d',
X    'ie',	'intel 82586 ethernet %d',
X    'is',	'isolan ethernet %d [OBSOLETE? - use le%d]',
X    'le',	'lance ethernet %d',
X
X	    # serial & parallel
X    'ast',	'4 port serial card #%d',
X    'com',	'serial port %d',
X    'lpt',	'parallel port %d',
X    'mfc',	'MultiFaceCard I/O board %d',
X    'mfcp',	'MFC parallel port %d',
X    'mfcs',	'MFC serial port %d',
X    'par',	'parallel port %d',
X    'scc',	'i82530 dual UART serial port %d',
X    'scn',	'serial port %d',
X    'ser',	'serial port %d',
X    'zs',	'serial port %d',
X);
X
X#
X#	pseudo devices
X#
X# %d is the actual argument, %s is "" if %d == 1, else "s"
X%pseudo_devices = (
X    'audio',	'--> /dev/audio [OBSOLETE]',
X    'bpfilter',	'berkeley packet filter (%d FD%s maximum)',
X    'ether',	'ethernet [OBSOLETE]',
X    'kbd',	'keyboard',
X    'log',	'--> kernel gateway into syslogd [OBSOLETE]',
X    'loop',	'network loopback, %d interface%s',
X    'mouse',	'mouse, %d port%s',
X    'ppp',	'point-to-point protocol, %d interface%s',
X    'pty',	'%d pseudo terminal%s',
X    'sl',	'compressed SLIP, %d interface%s',
X    'speaker',	'--> speaker queue [OBSOLETE]',
X    'tb',	'tablet line discipline',
X    'tun',	'network tunnelling over tty',
X    'view',	'view (graphics mapping), %d port%s?',
X    'vn',	'%d vn virtual file system device%s [OBSOLETE]',
X    'vnd',	'%d vnd virtual file system device%s',
X);
X
X
X#
X#	changable entries
X#
X
X
X%geninfo = ();
X%optinfo = ();
X%devinfo = ();
X%pseudodevinfo = ();
X
X
X#
X#	slurp in the file
X#
X@fhs = ('FH0');
X&open_relative($fhs[0], $ARGV[0]);
X
Xwhile(@fhs)
X{
X    $curfh = $fhs[0];
X    while (<$curfh>)
X    {
X	chop;
X	s/#.*//;				# remove comments
X	next if /^$/;				# skip blank lines
X	($cmd, @arg) = &shellwords($_);
X
X	ENTRY:
X	{
X	    $cmd eq "include" && do
X	    {
X		local($tfh);
X		$tfh = sprintf("FH%d", int(@fhs));
X		unshift(@fhs, $tfh);
X		$curfh = $fhs[0];
X		&open_relative($curfh, $arg[0]);
X		last ENTRY;
X	    };
X	    $cmd eq "machine" && do
X	    {
X		print "machine already specified as $geninfo{'machine'}\n"
X			if defined($geninfo{'machine'});
X		foreach (@arg)
X		{
X		    $geninfo{'machine'} .= ", " if ($geninfo{'machine'});
X		    $geninfo{'machine'} .= $machines{$_} || "${_}[UNDEFINED]";
X		}
X		last ENTRY;
X	    };
X	    $cmd =~
X    /^(cpu|ident|maxfdescs|timezone|controller|device|disk|tape|master)$/
X	    && do
X	    {
X		print "$cmd has been obsoleted. Please remove it from your config file.\n";
X		last ENTRY;
X	    };
X	    $cmd eq "maxusers" && do
X	    {
X		print "maxusers already specified as $geninfo{'maxusers'}\n"
X			if defined($geninfo{'maxusers'});
X		$geninfo{'maxusers'} = $arg[0];
X		last ENTRY;
X	    };
X	    $cmd eq "makeoptions" && do
X	    {
X#
X#	XXX:  do something?
X#
X		last ENTRY;
X	    };
X	    $cmd eq "options" && do
X	    {
X		local(@opts) = split(',', join('', @arg));
X		foreach $option (@opts)
X		{
X		    local($argname, $argval) = split('=', $option);
X		    $argval = " = " . $argval if (defined($argval));
X		    $optinfo{$argname} = $argval;
X		}
X		last ENTRY;
X	    };
X	    $cmd eq "config" && do				# XXX: improve
X	    {
X		print "config already specified as $geninfo{'config'}\n"
X			if defined($geninfo{'config'});
X		$geninfo{'config'} = join(' ', @arg);
X		last ENTRY;
X	    };
X	    $cmd eq "pseudo-device" && do
X	    {
X		$pseudodevinfo{shift(@arg)} = join(' ', @arg);
X		last ENTRY;
X	    };
X	    $arg[0] =~ /^at$/ && do
X	    {
X		$devinfo{$cmd} = join(' ', @arg);
X		last ENTRY;
X	    };
X	    print "Unknown directive: $cmd\n";
X	} # ENTRY
X    } # while <file>
X    shift(@fhs);
X} # while fhs
X
X#
X#	print the config file's innermost secrets :)
X#
X
Xgrep ((do {$geninfo{$_} = "undefined" unless defined($geninfo{$_})} ),
X	('machine', 'maxusers', 'config'));
X
Xprint <<GENINFO;
XFile:       $ARGV[0]
XMachine:    $geninfo{'machine'}
XConfig:     $geninfo{'config'}
XMax Users:  $geninfo{'maxusers'}
XGENINFO
X
Xprint "\nOptions:\n--------\n";
Xforeach $opt (sort keys %optinfo)
X{
X    &print_block($opt . $optinfo{$opt}, 24, $options{$opt} || "[UNDEFINED]");
X}
X
Xprint "\nDevices:\n--------\n";
Xforeach $ent (sort keys %devinfo)
X{
X    ($devname, $devnum) = ($ent =~ /^(\w+)(\d+|\*)$/);
X    unless ($devices{$devname})
X    {
X	undef($desc);
X    }
X    elsif ($devnum eq "*")
X    {
X	($desc = "generic " . $devices{$devname}) =~ s/\s*%d\s*//g;
X    }
X    else
X    {
X	($desc = $devices{$devname}) =~ s/%d/$devnum/g;
X    }
X    &print_block($ent, 24, $desc || "[UNDEFINED]");
X}
X
Xprint "\nPseudo devices:\n---------------\n";
Xforeach $ent (sort keys %pseudodevinfo)
X{
X    $num = $pseudodevinfo{$ent} || 1;		# defaults to 1 ("defined")
X    ($desc = $pseudo_devices{$ent}) =~ s/%d/$num/g;
X    $numstr = ($num == 1 ? "" : "s");
X    $desc =~ s/%s/$numstr/g;
X    $ent .= " = " . $num if ($num != 1);	# even if explicit =1, ignore
X    &print_block($ent, 24, $desc || "[UNDEFINED]");
X}
X
Xexit 0;
X
X
X#
X# print_block --
X#	display info in the form:
X#
X#  v---------$MAX_COLS------------------v
X#  v--$offset--v  
X#  $tag           $lines
X#
X#	($lines may cross multiple lines. $tag is printed for 1st line only)
X#
X
Xsub
Xprint_block
X{
X    local($tag, $offset, $lines) = @_;
X    local($width) = $MAX_COLS - $offset - 2;
X    local($indent) = '@' . '<' x ($offset - 1);
X    local($para) = '^' . '<' x ($width - 1);
X    local($form) = <<"ENDOFFORM";
Xformat STDOUT =
X$indent $para
X\$tag,  \$lines
X.
XENDOFFORM
X    eval $form;
X    write;
X    $tag = "";
X    write while ($lines);
X} # print_block
X
X
X#
X# open_relative --
X#	changes to basename of given file, and opens it
X#
Xsub
Xopen_relative
X{
X    local($fh, $full) = @_;
X    local($dir, $file) = $full =~ m#(.*)/(.*)#;
X    unless ($file)
X    {
X	$file = $full;
X	$dir = ".";
X    }
X    chdir($dir) || die("$0: can't chdir to $dir - $!\n");
X    open($fh, $file) || die("$0: can't open $full - $!\n");
X} # open_relative
END-of-checkconf
exit

-- ereh tuc --


-- 
``Don't steal. The Government (and the Banks) hate                Luke Mewburn
  competition.''                                              <lm@werj.com.au>
    -- (anon)