From: Gary Thomas <gary@mlbassoc.com>
To: meta-freescale@yoctoproject.org
Subject: Re: [meta-fsl-ppc][PATCH] sysvinit: auto detect hostname for qoriq machines
Date: Fri, 01 Aug 2014 05:07:44 -0600 [thread overview]
Message-ID: <53DB7500.8010208@mlbassoc.com> (raw)
In-Reply-To: <1406878578-6899-1-git-send-email-ting.liu@freescale.com>
On 2014-08-01 01:36, ting.liu@freescale.com wrote:
> From: Ting Liu <ting.liu@freescale.com>
>
> 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 <ting.liu@freescale.com>
> ---
> .../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
------------------------------------------------------------
next prev parent reply other threads:[~2014-08-01 11:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 7:36 [meta-fsl-ppc][PATCH] sysvinit: auto detect hostname for qoriq machines ting.liu
2014-08-01 11:07 ` Gary Thomas [this message]
2014-08-01 13:01 ` Otavio Salvador
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53DB7500.8010208@mlbassoc.com \
--to=gary@mlbassoc.com \
--cc=meta-freescale@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.