From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 47F1AE006B7; Fri, 1 Aug 2014 04:07:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail.chez-thomas.org (mail.mlbassoc.com [65.100.170.105]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 5EB16E00572 for ; Fri, 1 Aug 2014 04:07:29 -0700 (PDT) Received: by mail.chez-thomas.org (Postfix, from userid 1998) id 3799BF811FD; Fri, 1 Aug 2014 05:07:28 -0600 (MDT) Received: from [192.168.1.114] (zeus [192.168.1.114]) by mail.chez-thomas.org (Postfix) with ESMTP id E2F9DF811DC; Fri, 1 Aug 2014 05:07:25 -0600 (MDT) Message-ID: <53DB7500.8010208@mlbassoc.com> Date: Fri, 01 Aug 2014 05:07:44 -0600 From: Gary Thomas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: meta-freescale@yoctoproject.org References: <1406878578-6899-1-git-send-email-ting.liu@freescale.com> In-Reply-To: <1406878578-6899-1-git-send-email-ting.liu@freescale.com> Subject: Re: [meta-fsl-ppc][PATCH] sysvinit: auto detect hostname for qoriq machines X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 11:07:34 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 2014-08-01 01:36, ting.liu@freescale.com wrote: > From: Ting Liu > > If a rootfs only contains core specific pkgs (no machine specific > ones), it is convenient and possible to share a common rootfs image > for all the machines with same core. > > Add a patch (only works for fsl qoriq boards) to auto set hostname. What if one wanted to have a permanent setting of /etc/hostname that is neither from the boot command line nor the automatic setting? I don't think your patch allows for that. > > Also add support to set hostname via bootargs/cmdline. > > Signed-off-by: Ting Liu > --- > .../sysvinit/qoriq-ppc/auto-detect-hostname.patch | 18 ++++++++++++++++++ > recipes-core/sysvinit/sysvinit_2.88dsf.bbappend | 7 ++++++- > 2 files changed, 24 insertions(+), 1 deletion(-) > create mode 100644 recipes-core/sysvinit/sysvinit/qoriq-ppc/auto-detect-hostname.patch > > diff --git a/recipes-core/sysvinit/sysvinit/qoriq-ppc/auto-detect-hostname.patch b/recipes-core/sysvinit/sysvinit/qoriq-ppc/auto-detect-hostname.patch > new file mode 100644 > index 0000000..533f92e > --- /dev/null > +++ b/recipes-core/sysvinit/sysvinit/qoriq-ppc/auto-detect-hostname.patch > @@ -0,0 +1,18 @@ > +diff -uNr sysvinit/rcS sysvinit-new/rcS > +--- sysvinit/rcS 2014-07-09 11:19:59.000000000 +0800 > ++++ sysvinit-new/rcS 2014-08-01 15:01:54.000000000 +0800 > +@@ -21,6 +21,14 @@ > + # > + . /etc/default/rcS > + > ++# auto detect hostname > ++# > ++if test -r /proc/cmdline && grep -q hostname= /proc/cmdline; then > ++ sed -e "s,.*hostname=\(\S*\)\s*.*,\1," /proc/cmdline >/etc/hostname > ++elif test -r /proc/cpuinfo && grep -q ^model.*, /proc/cpuinfo; then > ++ grep ^model /proc/cpuinfo | cut -d, -f2 | tr [A-Z] [a-z] >/etc/hostname > ++fi > ++ > + # > + # Trap CTRL-C &c only in this shell so we can interrupt subprocesses. > + # > diff --git a/recipes-core/sysvinit/sysvinit_2.88dsf.bbappend b/recipes-core/sysvinit/sysvinit_2.88dsf.bbappend > index 72d991c..b87dd6b 100644 > --- a/recipes-core/sysvinit/sysvinit_2.88dsf.bbappend > +++ b/recipes-core/sysvinit/sysvinit_2.88dsf.bbappend > @@ -1 +1,6 @@ > -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" > +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" > + > +SRC_URI_append_qoriq-ppc = " \ > + file://auto-detect-hostname.patch;patchdir=../ \ > +" > + > -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------