From owner-freebsd-current Tue Jun 25 14:56:28 2002 Delivered-To: freebsd-current@freebsd.org Received: from smtp.noos.fr (camus.noos.net [212.198.2.70]) by hub.freebsd.org (Postfix) with ESMTP id D392C37B400 for ; Tue, 25 Jun 2002 14:56:19 -0700 (PDT) Received: (qmail 32370094 invoked by uid 0); 25 Jun 2002 21:56:17 -0000 Received: from unknown (HELO gits.gits.dyndns.org) ([212.198.229.153]) (envelope-sender ) by 212.198.2.70 (qmail-ldap-1.03) with SMTP for ; 25 Jun 2002 21:56:17 -0000 Received: from gits.gits.dyndns.org (4if27nj87eev79xl@localhost [127.0.0.1]) by gits.gits.dyndns.org (8.12.4/8.12.4) with ESMTP id g5PLuHtY014423; Tue, 25 Jun 2002 23:56:17 +0200 (CEST) (envelope-from root@gits.dyndns.org) Received: (from root@localhost) by gits.gits.dyndns.org (8.12.4/8.12.4/Submit) id g5PLuAJH014422; Tue, 25 Jun 2002 23:56:10 +0200 (CEST) (envelope-from root) Date: Tue, 25 Jun 2002 23:56:09 +0200 From: Cyrille Lefevre To: Mark Murray Cc: current@freebsd.org Subject: Re: Even more progress with perl script rewrites! Message-ID: <20020625215609.GA14026@gits.dyndns.org> References: <200206250827.g5P8RGnG002478@grimreaper.grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200206250827.g5P8RGnG002478@grimreaper.grondar.org> User-Agent: Mutt/1.3.99i Organization: ACME X-Face: V|+c;4!|B?E%BE^{E6);aI.[< List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Jun 25, 2002 at 09:27:16AM +0100, Mark Murray wrote: > sys/*/conf/gethints.pl * - del?/fix? - * done. #! /usr/bin/awk -f # # This is a transition aid. It extracts old-style configuration information # from a config file and writes an equivalent device.hints file to stdout. # You can use that with loader(8) or statically compile it in with the # 'hints' directive. See how GENERIC and GENERIC.hints fit together for # a static example. You should use loader(8) if at all possible. # # $FreeBSD: src/sys/i386/conf/gethints.pl,v 1.5 2000/06/26 09:08:23 peter Exp $ /^[ \t]*#/ || /^[ \t]*$/ || !/[ \t]*device/ { next; } { gsub ("#.*", ""); gsub ("\"", ""); dev = $1; nameunit = $2; at = $3; where = $4; rest = 5; if (at != "at" || where == "") next; name = nameunit; sub ("[0-9]*$", "", name); unit = nameunit; sub ("^" name, "", unit); sub ("\?$", "", where); printf "hint.%s.%s.at=\"%s\"\n", name, unit, where; for (key = $rest; rest <= NF; key = $(++rest)) { if (key == "disable") { printf "hint.%s.%s.disabled=\"1\"\n", name, unit; continue; } if (key == "port") { val = $(++rest); sub ("IO_AHA0", "0x330", val); sub ("IO_AHA1", "0x334", val); sub ("IO_ASC1", "0x3EB", val); sub ("IO_ASC2", "0x22B", val); sub ("IO_ASC3", "0x26B", val); sub ("IO_ASC4", "0x2AB", val); sub ("IO_ASC5", "0x2EB", val); sub ("IO_ASC6", "0x32B", val); sub ("IO_ASC7", "0x36B", val); sub ("IO_ASC8", "0x3AB", val); sub ("IO_BT0", "0x330", val); sub ("IO_BT1", "0x334", val); sub ("IO_CGA", "0x3D0", val); sub ("IO_COM1", "0x3F8", val); sub ("IO_COM2", "0x2F8", val); sub ("IO_COM3", "0x3E8", val); sub ("IO_COM4", "0x2E8", val); sub ("IO_DMA1", "0x000", val); sub ("IO_DMA2", "0x0C0", val); sub ("IO_DMAPG", "0x080", val); sub ("IO_FD1", "0x3F0", val); sub ("IO_FD2", "0x370", val); sub ("IO_GAME", "0x201", val); sub ("IO_GSC1", "0x270", val); sub ("IO_GSC2", "0x2E0", val); sub ("IO_GSC3", "0x370", val); sub ("IO_GSC4", "0x3E0", val); sub ("IO_ICU1", "0x020", val); sub ("IO_ICU2", "0x0A0", val); sub ("IO_KBD", "0x060", val); sub ("IO_LPT1", "0x378", val); sub ("IO_LPT2", "0x278", val); sub ("IO_LPT3", "0x3BC", val); sub ("IO_MDA", "0x3B0", val); sub ("IO_NMI", "0x070", val); sub ("IO_NPX", "0x0F0", val); sub ("IO_PMP1", "0x026", val); sub ("IO_PMP2", "0x178", val); sub ("IO_PPI", "0x061", val); sub ("IO_RTC", "0x070", val); sub ("IO_TIMER1", "0x040", val); sub ("IO_TIMER2", "0x048", val); sub ("IO_UHA0", "0x330", val); sub ("IO_VGA", "0x3C0", val); sub ("IO_WD1", "0x1F0", val); sub ("IO_WD2", "0x170", val); if (val != "?") printf "hint.%s.%s.port=\"%s\"\n", \ name, unit, val; continue; } if (key == "port?" || key == "drq?" || key == "irq?" || \ key == "iomem?" || key == "iosiz?") continue; if (key == "irq" || key == "drq" || key == "drive" || \ key == "iomem" || key == "iosiz" || key == "flags" || \ key == "bus" || key == "target" || key == "unit") { sub ("iomem", "maddr", key); sub ("iosiz", "msize", key); val = $(++rest); if (val != "?") printf "hint.%s.%s.%s=\"%s\"\n", \ name, unit, key, val; continue; } printf ("unrecognized config token '%s:%s' on line %s\n", rest, key, NR); # > "/dev/stderr"; } } Cyrille. -- Cyrille Lefevre mailto:cyrille.lefevre@laposte.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message