From patchwork Wed Aug 15 03:08:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: udev: update rcS to auto-detect hostname Date: Wed, 15 Aug 2012 03:08:45 -0000 From: Zhenhua Luo X-Patchwork-Id: 34623 Message-Id: <1345000125-3865-1-git-send-email-b19537@freescale.com> To: From: Zhenhua Luo the rootfs image can be reused by targets with same core type Signed-off-by: Zhenhua Luo --- 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