Patchwork udev: update rcS to auto-detect hostname

login
register
mail settings
Submitter Zhenhua Luo
Date Aug. 15, 2012, 3:08 a.m.
Message ID <1345000125-3865-1-git-send-email-b19537@freescale.com>
Download mbox | patch
Permalink /patch/34623/
State Rejected
Headers show

Comments

Khem Raj - Aug. 15, 2012, 3:01 a.m.
On Tue, Aug 14, 2012 at 8:08 PM,  <b19537@freescale.com> wrote:
> echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`

$ echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz

is that what we want ?
Zhenhua Luo - Aug. 15, 2012, 3:08 a.m.
From: Zhenhua Luo <b19537@freescale.com>

    the rootfs image can be reused by targets with same core type

Signed-off-by: Zhenhua Luo <b19537@freescale.com>
---
 meta/recipes-core/sysvinit/sysvinit/rcS |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
McClintock Matthew-B29882 - Aug. 15, 2012, 4:06 a.m.
On Tue, Aug 14, 2012 at 10:01 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Tue, Aug 14, 2012 at 8:08 PM,  <b19537@freescale.com> wrote:
>> echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
>
> $ echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
>
> is that what we want ?

I think we need an option to turn it on or off and or make it
configurable from a BSP layer. We are looking for a way to make a rfs
for all e500v2 or e500mc, etc and say the right machine type on the
prompt.

-M

>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Chris Larson - Aug. 15, 2012, 4:12 a.m.
On Tue, Aug 14, 2012 at 9:06 PM, McClintock Matthew-B29882
<B29882@freescale.com> wrote:
> On Tue, Aug 14, 2012 at 10:01 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> On Tue, Aug 14, 2012 at 8:08 PM,  <b19537@freescale.com> wrote:
>>> echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
>>
>> $ echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
>>
>> is that what we want ?
>
> I think we need an option to turn it on or off and or make it
> configurable from a BSP layer. We are looking for a way to make a rfs
> for all e500v2 or e500mc, etc and say the right machine type on the
> prompt.

This sounds like something that really does belong in your own
supplementary layer, rather than oe-core.
McClintock Matthew-B29882 - Aug. 15, 2012, 4:21 a.m.
On Tue, Aug 14, 2012 at 11:12 PM, Chris Larson <clarson@kergoth.com> wrote:
> On Tue, Aug 14, 2012 at 9:06 PM, McClintock Matthew-B29882
> <B29882@freescale.com> wrote:
>> On Tue, Aug 14, 2012 at 10:01 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>> On Tue, Aug 14, 2012 at 8:08 PM,  <b19537@freescale.com> wrote:
>>>> echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
>>>
>>> $ echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
>>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
>>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
>>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
>>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
>>>
>>> is that what we want ?
>>
>> I think we need an option to turn it on or off and or make it
>> configurable from a BSP layer. We are looking for a way to make a rfs
>> for all e500v2 or e500mc, etc and say the right machine type on the
>> prompt.
>
> This sounds like something that really does belong in your own
> supplementary layer, rather than oe-core.

Seemed like a valuable option for making rfs for multiple machines /
targets, but if we don't want it (or some of the bits) in oe-core
that's fine by me too.

-M

> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Koen Kooi - Aug. 15, 2012, 7:41 a.m.
Op 15 aug. 2012, om 05:01 heeft Khem Raj <raj.khem@gmail.com> het volgende geschreven:

> On Tue, Aug 14, 2012 at 8:08 PM,  <b19537@freescale.com> wrote:
>> echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
> 
> $ echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> 
> is that what we want ?

On ARM it will be empty:

root@beaglebone:~# echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`

root@beaglebone:~#
Richard Purdie - Aug. 15, 2012, 1:53 p.m.
On Wed, 2012-08-15 at 04:21 +0000, McClintock Matthew-B29882 wrote:
> On Tue, Aug 14, 2012 at 11:12 PM, Chris Larson <clarson@kergoth.com> wrote:
> > On Tue, Aug 14, 2012 at 9:06 PM, McClintock Matthew-B29882
> > <B29882@freescale.com> wrote:
> >> On Tue, Aug 14, 2012 at 10:01 PM, Khem Raj <raj.khem@gmail.com> wrote:
> >>> On Tue, Aug 14, 2012 at 8:08 PM,  <b19537@freescale.com> wrote:
> >>>> echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
> >>>
> >>> $ echo `cat /proc/cpuinfo | grep model | cut -d "," -f 2 | tr "[A-Z]" "[a-z]"`
> >>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> >>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> >>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> >>> model : 23 model name : intel(r) core(tm)2 quad cpu q9300 @ 2.50ghz
> >>>
> >>> is that what we want ?
> >>
> >> I think we need an option to turn it on or off and or make it
> >> configurable from a BSP layer. We are looking for a way to make a rfs
> >> for all e500v2 or e500mc, etc and say the right machine type on the
> >> prompt.
> >
> > This sounds like something that really does belong in your own
> > supplementary layer, rather than oe-core.
> 
> Seemed like a valuable option for making rfs for multiple machines /
> targets, but if we don't want it (or some of the bits) in oe-core
> that's fine by me too.

At the very least its powerpc only since it gives crazy results on other
arches. Does it work for all powerpc machines? Its also adding 4 execs
to every boot and those calls mount up and impact boot time.

Cheers,

Richard
Otavio Salvador - Aug. 15, 2012, 2:01 p.m.
On Wed, Aug 15, 2012 at 12:08 AM,  <b19537@freescale.com> wrote:
> +#       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.

This seems to fit well to a BSP init script; seems to be very machine
specific so it doesn't seem to be supported by other arch and
machines.

Patch

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