Re: identifying a 1.75

2011-08-10 Thread Paul Fox
martin wrote:
  On Tue, Aug 9, 2011 at 6:31 PM, Paul Fox p...@laptop.org wrote:
   thoughts/comments?  better approaches?  obvious additions?
  
  Hi Paul
  
  timely - I was just hacking on olpc-utils, bitfrost and sugar on
  exactly the same thing (while on the plane, no internet).
  
  Something along the lines of what you have is needed, I'll probably
  merge it into my hacking. And we need it as part of a mini bash
  function library as well, machine identification and other tasks
  reading from ofw are spread across olpc-utils at random.
  
  So I'll prolly hack olpc-hwinfo into a shell of what you posted (oh!
  the pun!) -- calling into shared function calls. And will refactor
  other scripts to match.

something else i found this morning, while looking at #11126 -- udev
uses dmi/id/product_name to decide to apply our keyboard map.  this
won't work on 1.75, so i guess we'll need to choose a/the canonical
method of distinguishing a 1.75 from sysfs.

paul

  
  cheers,
  
  
  
  m
  -- 
   martin.langh...@gmail.com
   mar...@laptop.org -- Software Architect - OLPC
   - ask interesting questions
   - don't get distracted with shiny stuff  - working code first
   - http://wiki.laptop.org/go/User:Martinlanghoff

=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


identifying a 1.75

2011-08-09 Thread Paul Fox
on XO-1 and XO-1.5, we were able to discover the model of the laptop
from the information under /sys/class/dmi/id.  the DMI schema comes
from the PC world, and we can't expect it to exist on ARM.

there was also information to be found in /ofw on those machines, like
serial number, and uuid.  the hex model designator found there was
used as a fallback if the dmi tree wasn't there (on older XO-1
firmware).

on 1.75, there's no dmi tree, and /ofw has moved to /proc/device-tree,
so we need to modify a lot of places that try and dig up platform
info.  (see #6)

so i'm floating the attached script, tentatively named olpc-hwinfo,
as a strawman.  i think it gives access to the most often needed info,
and can obviously be expanded if needed.  it would go in olpc-utils,
which would put it in /usr/sbin (since some clients live in /usr/sbin).

thoughts/comments?  better approaches?  obvious additions?

paul
=-
 paul fox, p...@laptop.org



olpc-hwinfo
Description: - 
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: identifying a 1.75

2011-08-09 Thread Stephen John Smoogen
On Tue, Aug 9, 2011 at 16:31, Paul Fox p...@laptop.org wrote:
 on XO-1 and XO-1.5, we were able to discover the model of the laptop
 from the information under /sys/class/dmi/id.  the DMI schema comes
 from the PC world, and we can't expect it to exist on ARM.

 there was also information to be found in /ofw on those machines, like
 serial number, and uuid.  the hex model designator found there was
 used as a fallback if the dmi tree wasn't there (on older XO-1
 firmware).

 on 1.75, there's no dmi tree, and /ofw has moved to /proc/device-tree,
 so we need to modify a lot of places that try and dig up platform
 info.  (see #6)

 so i'm floating the attached script, tentatively named olpc-hwinfo,
 as a strawman.  i think it gives access to the most often needed info,
 and can obviously be expanded if needed.  it would go in olpc-utils,
 which would put it in /usr/sbin (since some clients live in /usr/sbin).

 thoughts/comments?  better approaches?  obvious additions?

Check the CPU? Shouldn't /proc/cpuinfo tell you what you have since
the major change is cpu?



-- 
Stephen J Smoogen.
The core skill of innovators is error recovery, not failure avoidance.
Randy Nelson, President of Pixar University.
Let us be kind, one to another, for most of us are fighting a hard
battle. -- Ian MacLaren
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: identifying a 1.75

2011-08-09 Thread Paul Fox
stephen john smoogen wrote:
  On Tue, Aug 9, 2011 at 16:31, Paul Fox p...@laptop.org wrote:
   on XO-1 and XO-1.5, we were able to discover the model of the laptop
   from the information under /sys/class/dmi/id.  the DMI schema comes
   from the PC world, and we can't expect it to exist on ARM.
  
   there was also information to be found in /ofw on those machines, like
   serial number, and uuid.  the hex model designator found there was
   used as a fallback if the dmi tree wasn't there (on older XO-1
   firmware).
  
   on 1.75, there's no dmi tree, and /ofw has moved to /proc/device-tree,
   so we need to modify a lot of places that try and dig up platform
   info.  (see #6)
  
   so i'm floating the attached script, tentatively named olpc-hwinfo,
   as a strawman.  i think it gives access to the most often needed info,
   and can obviously be expanded if needed.  it would go in olpc-utils,
   which would put it in /usr/sbin (since some clients live in /usr/sbin).
  
   thoughts/comments?  better approaches?  obvious additions?
  
  Check the CPU? Shouldn't /proc/cpuinfo tell you what you have since
  the major change is cpu?

yeah, i thought of that.  it's likely the next OLPC product will use
the same processor, so we'll need something else in the future anyway.
it happens that /proc/cpuinfo even says:
Hardware: OLPC XO-1.75
(since ARM kernels provide slightly different info than x86 kernels),
which makes it very tempting to use that.

but if we're lucky, the next product might share the same kernel (so
that string may change).  in any case, i think i'd prefer using info
that sourced from the hardware or firmware rather than a compiled in
string.

(but maybe i'm missing something here, and that line in /proc/cpuinfo
is exactly what we should be using.  anyone?)

paul
=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: identifying a 1.75

2011-08-09 Thread Martin Langhoff
On Tue, Aug 9, 2011 at 6:31 PM, Paul Fox p...@laptop.org wrote:
 thoughts/comments?  better approaches?  obvious additions?

Hi Paul

timely - I was just hacking on olpc-utils, bitfrost and sugar on
exactly the same thing (while on the plane, no internet).

Something along the lines of what you have is needed, I'll probably
merge it into my hacking. And we need it as part of a mini bash
function library as well, machine identification and other tasks
reading from ofw are spread across olpc-utils at random.

So I'll prolly hack olpc-hwinfo into a shell of what you posted (oh!
the pun!) -- calling into shared function calls. And will refactor
other scripts to match.

cheers,



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- Software Architect - OLPC
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: identifying a 1.75

2011-08-09 Thread Paul Fox
martin wrote:
  On Tue, Aug 9, 2011 at 6:31 PM, Paul Fox p...@laptop.org wrote:
   thoughts/comments?  better approaches?  obvious additions?
  
  Hi Paul
  
  timely - I was just hacking on olpc-utils, bitfrost and sugar on
  exactly the same thing (while on the plane, no internet).
  
  Something along the lines of what you have is needed, I'll probably
  merge it into my hacking. And we need it as part of a mini bash
  function library as well, machine identification and other tasks
  reading from ofw are spread across olpc-utils at random.
  
  So I'll prolly hack olpc-hwinfo into a shell of what you posted (oh!
  the pun!) -- calling into shared function calls. And will refactor
  other scripts to match.

okay.  most clients don't need hw info at high rates, so i figured a
self-contained script would be sufficient (and necessary, for some
clients).  but certainly refactoring into sourceable chunks is a fine
idea.

(and more to the point, i won't commit anything -- ball's in your
court.  :-)

paul
=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel