[OE-core] [oe-core] udev: update rcS to auto-detect hostname
b19537 at freescale.com
b19537 at freescale.com
Wed Aug 15 03:08:45 UTC 2012
From: Zhenhua Luo <b19537 at freescale.com>
the rootfs image can be reused by targets with same core type
Signed-off-by: Zhenhua Luo <b19537 at freescale.com>
---
meta/recipes-core/sysvinit/sysvinit/rcS | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS b/meta/recipes-core/sysvinit/sysvinit/rcS
index 080b04f..51425ff 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rcS
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS
@@ -22,6 +22,11 @@ export PATH runlevel prevlevel
. /etc/default/rcS
#
+# Update the hostname according to actual board type
+#
+echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"` > /etc/hostname
+
+#
# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
#
trap ":" INT QUIT TSTP
--
1.7.0.4
More information about the Openembedded-core
mailing list