From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25762 invoked by alias); 1 Jul 2009 17:17:38 -0000 Received: (qmail 25750 invoked by uid 22791); 1 Jul 2009 17:17:37 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from exprod6og108.obsmtp.com (HELO exprod6og108.obsmtp.com) (64.18.1.21) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Wed, 01 Jul 2009 17:17:30 +0000 Received: from source ([63.240.6.3]) (using TLSv1) by exprod6ob108.postini.com ([64.18.5.12]) with SMTP ID DSNKSkuaJ7pHfrLCRUqUwMUnqDeVbe+OFBUZ@postini.com; Wed, 01 Jul 2009 10:17:29 PDT Received: from D01SMTP04.Mi8.com ([172.16.1.243]) by Outbound02.Mi8.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 1 Jul 2009 13:17:26 -0400 Received: from mi8nycmail19.Mi8.com ([172.16.7.219]) by D01SMTP04.Mi8.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 1 Jul 2009 13:17:27 -0400 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Querying Loader from Kernel Date: Wed, 01 Jul 2009 17:17:00 -0000 Message-ID: In-Reply-To: <4A4B979A.8000004@mlbassoc.com> References: <113b56700906291200n4e3ca671s63462d29b31e5821@mail.gmail.com> <4A4B979A.8000004@mlbassoc.com> From: "H Hartley Sweeten" To: "Gary Thomas" Cc: "Eric Bresie" , X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2009-07/txt/msg00003.txt.bz2 On Wednesday, July 01, 2009 10:07 AM, Gary Thomas wrote: >>> Is it possible to query info from the loader (Redboot) from the >>> loaded kernel? >>> >>> I'd like to have Redboot version indicated in syslog or something >>> to confirm version details at both loader and kernel level. >>> >>> With dmesg I see some indication of the mtd partitions but nothing >>> else beyond that. >>> >>> Any ideas? >>=20 >> I'm not sure you can query the info from the kernel but maybe from >> userspace. >>=20 >> You can use the fconfig utility to parse the mtd partition that >> contains your Redboot config. Create an alias in Redboot that has >> the version information you need. For example I set a serial number >> on each of my boards as: >>=20 >> alias/SNUM: 0x27260017 >>=20 >> Then use fconfig to read it: >>=20 >> / #fconfig -r -d /dev/mtd3 -n alias/SNUM >> 0x27260017 >> / # > > Two things: > * What is the 'fconfig' utility and where did you get it? > * This only works for data stored in 'fconfig' I think the > original poster was interested in other data, such as the > build version string, etc. The best way to provide that > would be to pass it to Linux during 'exec'. The details > depend on the architecture (e.g. PowerPC does things differently > from how ARM works, etc) I found the 'fconfig' as one of the packages in buildroot. You can get it here: http://andrzejekiert.ovh.org/software.html.en I agree this only works for data stored in 'fconfig' that's why I suggested setting an alias for the needed information. I'm not sure how you would pass the information to linux during 'exec'. And, as you mentioned, whatever mechanism is used it will probably not be portable between architectures. I think with ARM it would need to be passed as an ATAG. It might be possible to create a kernel driver that parses the kernel command line for some sort of information then creates a sysfs entry containing that info or just spits it out for dmesg. Not really sure... Regards, Hartley