* [PATCH v2] base-files: set dynamic COLUMNS via resize command
@ 2014-07-30 10:23 ting.liu
2014-07-30 10:48 ` Martin Jansa
0 siblings, 1 reply; 2+ messages in thread
From: ting.liu @ 2014-07-30 10:23 UTC (permalink / raw)
To: openembedded-core
From: Ting Liu <ting.liu@freescale.com>
By default, COLUMNS is set to 80. If possible, run 'resize' to
determine what the current dimensions are. This avoids the final
part of long lines overlap the start of the same line.
Signed-off-by: Ting Liu <ting.liu@freescale.com>
---
changes in v2:
* dynamically check for ${bindir} instead of hard code /usr/bin
meta/recipes-core/base-files/base-files/profile | 4 ++++
meta/recipes-core/base-files/base-files_3.0.14.bb | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index 0b2d9d7..88ab8d8 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -26,6 +26,10 @@ if [ -d /etc/profile.d ]; then
unset i
fi
+if [ -x /usr/bin/resize ];then
+ /usr/bin/resize >/dev/null
+fi
+
export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
umask 022
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 30b1bf4..e6109dd 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -102,6 +102,10 @@ do_install () {
install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf
install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd
+ if [ "/usr/bin" != "${bindir}" ]; then
+ sed -i "s,/usr/bin/resize,${bindir}/resize," ${D}${sysconfdir}/profile
+ fi
+
ln -sf /proc/mounts ${D}${sysconfdir}/mtab
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] base-files: set dynamic COLUMNS via resize command
2014-07-30 10:23 [PATCH v2] base-files: set dynamic COLUMNS via resize command ting.liu
@ 2014-07-30 10:48 ` Martin Jansa
0 siblings, 0 replies; 2+ messages in thread
From: Martin Jansa @ 2014-07-30 10:48 UTC (permalink / raw)
To: ting.liu; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 2242 bytes --]
On Wed, Jul 30, 2014 at 06:23:41PM +0800, ting.liu@freescale.com wrote:
> From: Ting Liu <ting.liu@freescale.com>
>
> By default, COLUMNS is set to 80. If possible, run 'resize' to
> determine what the current dimensions are. This avoids the final
> part of long lines overlap the start of the same line.
>
> Signed-off-by: Ting Liu <ting.liu@freescale.com>
> ---
> changes in v2:
> * dynamically check for ${bindir} instead of hard code /usr/bin
>
> meta/recipes-core/base-files/base-files/profile | 4 ++++
> meta/recipes-core/base-files/base-files_3.0.14.bb | 4 ++++
> 2 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
> index 0b2d9d7..88ab8d8 100644
> --- a/meta/recipes-core/base-files/base-files/profile
> +++ b/meta/recipes-core/base-files/base-files/profile
> @@ -26,6 +26,10 @@ if [ -d /etc/profile.d ]; then
> unset i
> fi
>
> +if [ -x /usr/bin/resize ];then
> + /usr/bin/resize >/dev/null
> +fi
> +
> export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
>
> umask 022
> diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
> index 30b1bf4..e6109dd 100644
> --- a/meta/recipes-core/base-files/base-files_3.0.14.bb
> +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
> @@ -102,6 +102,10 @@ do_install () {
> install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf
> install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd
>
> + if [ "/usr/bin" != "${bindir}" ]; then
> + sed -i "s,/usr/bin/resize,${bindir}/resize," ${D}${sysconfdir}/profile
> + fi
> +
Please use consistent whitespace for indentation (I know it's hard with
inconsistent styleguide, but please don't mix tabs and spaces for
indentation).
> ln -sf /proc/mounts ${D}${sysconfdir}/mtab
> }
>
> --
> 1.7.3.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-30 10:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30 10:23 [PATCH v2] base-files: set dynamic COLUMNS via resize command ting.liu
2014-07-30 10:48 ` Martin Jansa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox