[oe-commits] Ting Liu : base-files: set dynamic COLUMNS via resize command

git at git.openembedded.org git at git.openembedded.org
Mon Aug 11 09:56:34 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: cc6360f4c4d97e0000f9d3545f381224ee99ce7d
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=cc6360f4c4d97e0000f9d3545f381224ee99ce7d

Author: Ting Liu <ting.liu at freescale.com>
Date:   Thu Jul 31 18:21:01 2014 +0800

base-files: set dynamic COLUMNS via resize command

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 at freescale.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 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(+)

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..07f5c54 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
 }
 



More information about the Openembedded-commits mailing list