home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / YaST2 / scrconf / proc_cpuinfo.scr < prev    next >
Encoding:
Text File  |  2006-11-29  |  1.3 KB  |  44 lines

  1. /**
  2.  * File:    proc_cpuinfo.scr
  3.  * Summary:    SCR Agent for reading /proc/cpuinfo
  4.  * Author:    Ladislav Slezak <lslezak@suse.cz>
  5.  * Access:    read
  6.  *
  7.  * Example:
  8.  *    read list of processors:  Dir(.proc.cpuinfo.section)
  9.  *        => (["0"])
  10.  *
  11.  *    read available keys:  Dir(.proc.cpuinfo.value.0)
  12.  *        => (["vendor_id", "cpu family", "model", ... ])
  13.  *
  14.  *    read value: Read(.cpu.value.0."model name")
  15.  *        => ("AMD Athlon(tm) XP 1600+")
  16.  *
  17.  * $Id: proc_cpuinfo.scr 13069 2003-12-16 09:30:51Z jsrain $
  18.  *
  19.  * <p>Reads <tt>/proc/cpuinfo</tt> file, each processor is in separate section.</p>
  20.  *
  21.  * <p><b>Note:</b> Keys and values are architecture dependent! (For example i386 has
  22.  * key "cpu MHz" and value "1400.072", but PPC has "clock" with value "668MHz"!)</p>
  23.  */
  24. .proc.cpuinfo
  25.  
  26. `ag_ini(
  27.     `IniAgent( "/proc/cpuinfo",
  28.     $[
  29.         /* allow comments after value, read only file */
  30.         "options"    : [ "comments_last", "read_only" ],
  31.  
  32.         /* empty lines, comments after value and whole-line comments */
  33.         "comments"    : [ "^[ \t]*$", "[ \t]*#.*$", "^[ \t]*#.*$" ],
  34.  
  35.         /* matching rules */
  36.         "sections"    : [
  37.          $[ "begin" : [ "^[ \t]*processor[ \t]*:[ \t]*([^ \t]*)[ \t]*", "%s" ] ]
  38.         ],
  39.         "params"    : [
  40.         $[ "match" : [ "^[ \t]*(.*[^ \t])[ \t]*:[ \t]*(.*[^ \t])[ \t]*", "%s=%s" ] ]
  41.         ],
  42.     ]
  43. ))
  44.