[oe-commits] [openembedded-core] 05/16: base-files: fix handling of resize

git at git.openembedded.org git at git.openembedded.org
Sat Aug 11 16:11:42 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 318540bde50c4c0febd23004511d8842071cd245
Author: Chen Qi <Qi.Chen at windriver.com>
AuthorDate: Wed Aug 1 13:25:35 2018 +0800

    base-files: fix handling of resize
    
    The current handling of resize is incorrect. Using `resize > /dev/null
    2>&1 && resize > /dev/null' will cause the second resize command to not
    execute because 'resize > /dev/null 2>&1' will fail for resize utility
    from busybox.
    
    What we really should do is just to check whether ${bindir}/resize
    is executable and execute it if so. Using '-x' is sufficient.
    
    Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-core/base-files/base-files/profile   | 6 +-----
 meta/recipes-core/base-files/base-files_3.0.14.bb | 1 +
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index e14cb2d..9e4283e 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -24,11 +24,7 @@ fi
 # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which tries do
 # use ssh
 case $(tty 2>/dev/null) in
-	# The first invocation of resize verifies that it exists, the second
-	# does the actual resizing. This is due to that resize uses stderr to
-	# determine the size of the tty, which does not work if it is redirected
-	# to /dev/null.
-	/dev/tty[A-z]*) resize >/dev/null 2>&1 && resize >/dev/null;;
+	/dev/tty[A-z]*) [ -x @BINDIR@/resize ] && @BINDIR@/resize >/dev/null;;
 esac
 
 export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
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 1c0863b..05c0562 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
@@ -121,6 +121,7 @@ do_install () {
 	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
 	install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
 	sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
+        sed -i 's#@BINDIR@#${bindir}#g' ${D}${sysconfdir}/profile
 	install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
 	install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
 	install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list