initscripts: functions machine id xilinx virtex5 platforms
authorAdrian Alonso <aalonso00@gmail.com>
Tue, 3 Aug 2010 06:23:21 +0000 (06:23 +0000)
committerFrans Meulenbroeks <fransmeulenbroeks@gmail.com>
Wed, 4 Aug 2010 17:47:03 +0000 (19:47 +0200)
* Add machine_id support for xilinx virtex platforms
  used in xserver-common for args settings.
* On Xilinx platforms there is no line `Hardware`. Instead it is
  stored in the line starting with `platform`.
* Bump PR
* v2 nicer machine_id function for handling xilinx virtex platforms

Signed-off-by: Adrian Alonso <aalonso00@gmail.com>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
recipes/initscripts/files/functions
recipes/initscripts/initscripts_1.0.bb

index fb9a914..51c1f13 100644 (file)
@@ -5,7 +5,11 @@
 #
 
 machine_id() {         # return the machine ID
-    awk 'BEGIN { FS=": " } /Hardware/ { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo
+    id=`awk 'BEGIN { FS=": " } /Hardware/ { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo`
+    if [ -n "$id" ]; then
+        id=`awk 'BEGIN { FS=": " } /platform/ { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo`
+    fi
+    echo -n "$id"
 }
 
 killproc() {           # kill the named process(es)
index 1b0a94c..38fe85e 100644 (file)
@@ -4,7 +4,7 @@ PRIORITY = "required"
 DEPENDS = "makedevs"
 RDEPENDS_${PN} = "makedevs"
 LICENSE = "GPL"
-PR = "r121"
+PR = "r122"
 
 SRC_URI = "file://functions \
            file://halt \