From owner-cvs-src@FreeBSD.ORG Tue Jul 26 18:39:26 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5FA616A41F; Tue, 26 Jul 2005 18:39:25 +0000 (GMT) (envelope-from jkim@FreeBSD.org) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79E6143D45; Tue, 26 Jul 2005 18:39:23 +0000 (GMT) (envelope-from jkim@FreeBSD.org) Received: from niksun.com (anuket [10.70.0.5]) by anuket.mj.niksun.com (8.13.1/8.13.1) with ESMTP id j6QIfcLN057978; Tue, 26 Jul 2005 14:41:38 -0400 (EDT) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Peter Wemm Date: Tue, 26 Jul 2005 14:39:02 -0400 User-Agent: KMail/1.6.2 References: <200507141952.j6EJqMVQ009846@repoman.freebsd.org> <86oe8phlq1.fsf@xps.des.no> <200507261002.31596.peter@wemm.org> In-Reply-To: <200507261002.31596.peter@wemm.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_KNo5CfP4W9sg0nf" Message-Id: <200507261439.06189.jkim@FreeBSD.org> X-Virus-Scanned: ClamAV 0.85.1/993/Tue Jul 26 03:28:36 2005 on anuket.mj.niksun.com X-Virus-Status: Clean Cc: Dag-Erling =?euc-kr?q?Sm=A9=AArgrav?= , src-committers@FreeBSD.org, cvs-src@FreeBSD.org Subject: Re: cvs commit: src/sys/boot/i386/libi386 Makefile libi386.h smbios.c src/sys/boot/i386/loader main.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2005 18:39:26 -0000 --Boundary-00=_KNo5CfP4W9sg0nf Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline On Tuesday 26 July 2005 01:02 pm, Peter Wemm wrote: > On Tuesday 26 July 2005 04:04 am, Dag-Erling Smørgrav wrote: > > Jung-uk Kim writes: > > > Log: > > > Scan static SMBIOS structures and export the following > > > environment variables to loader: [...] > > > > These values are sometimes padded, IWBNI libi386 could remove > > that padding: > > > > hint.smbios.0.system.maker="Dell Inc. " > > hint.smbios.0.system.product="Dimension XPS Gen 3 " > > > > also, there's a typo in one of the strings: > > > > Hint.smbios.0.planar.version=" " > > > > (note the capital H) I think we should keep the spaces. SMBIOS spec. says anything before NULL is valid if my memory serves. > It's not a typo. Its got the wrong number of fields so the hint > scanner disables it. > if (strncmp(cp, "hint.", 5) != 0) > hit = 0; > else > n = sscanf(cp, > "hint.%32[^.].%d.%32[^=]=%128s", r_name, &r_unit, r_resname, > r_value); if (hit && n != 4) { > printf("CONFIG: invalid hint '%s'\n", cp); > p = index(cp, 'h'); > *p = 'H'; > hit = 0; > } > > hint.smbios.0.planar.version is an illegal hint. It has 5 fields, > not 4. These are not free-form strings. Ouch... Is this okay for you? Thanks, Jung-uk Kim --Boundary-00=_KNo5CfP4W9sg0nf Content-Type: text/x-diff; charset="iso-8859-1"; name="smbios.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="smbios.diff" Index: sys/boot/i386/libi386/smbios.c =================================================================== RCS file: /home/ncvs/src/sys/boot/i386/libi386/smbios.c,v retrieving revision 1.1 diff -u -r1.1 smbios.c --- sys/boot/i386/libi386/smbios.c 14 Jul 2005 19:52:22 -0000 1.1 +++ sys/boot/i386/libi386/smbios.c 26 Jul 2005 18:34:34 -0000 @@ -91,26 +91,26 @@ switch(dmi[0]) { case 0: /* Type 0: BIOS */ - smbios_setenv("hint.smbios.0.bios.vendor", dmi, 0x04); - smbios_setenv("hint.smbios.0.bios.version", dmi, 0x05); - smbios_setenv("hint.smbios.0.bios.reldate", dmi, 0x08); + smbios_setenv("hint.smbios.0.bios_vendor", dmi, 0x04); + smbios_setenv("hint.smbios.0.bios_version", dmi, 0x05); + smbios_setenv("hint.smbios.0.bios_reldate", dmi, 0x08); break; case 1: /* Type 1: System */ - smbios_setenv("hint.smbios.0.system.maker", dmi, 0x04); - smbios_setenv("hint.smbios.0.system.product", dmi, 0x05); - smbios_setenv("hint.smbios.0.system.version", dmi, 0x06); + smbios_setenv("hint.smbios.0.system_maker", dmi, 0x04); + smbios_setenv("hint.smbios.0.system_product", dmi, 0x05); + smbios_setenv("hint.smbios.0.system_version", dmi, 0x06); break; case 2: /* Type 2: Base Board (or Module) */ - smbios_setenv("hint.smbios.0.planar.maker", dmi, 0x04); - smbios_setenv("hint.smbios.0.planar.product", dmi, 0x05); - smbios_setenv("hint.smbios.0.planar.version", dmi, 0x06); + smbios_setenv("hint.smbios.0.planar_maker", dmi, 0x04); + smbios_setenv("hint.smbios.0.planar_product", dmi, 0x05); + smbios_setenv("hint.smbios.0.planar_version", dmi, 0x06); break; case 3: /* Type 3: System Enclosure or Chassis */ - smbios_setenv("hint.smbios.0.chassis.maker", dmi, 0x04); - smbios_setenv("hint.smbios.0.chassis.version", dmi, 0x06); + smbios_setenv("hint.smbios.0.chassis_maker", dmi, 0x04); + smbios_setenv("hint.smbios.0.chassis_version", dmi, 0x06); break; default: /* skip other types */ --Boundary-00=_KNo5CfP4W9sg0nf--