summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Tollerton <rich.tollerton@ni.com>2016-10-11 20:08:15 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-15 10:01:42 +0100
commitb7b2e348716161deb21c9864ac5caa5f1df1fa9c (patch)
tree2da3f33ed902ccee6cd64990ee4e62b139095511 /meta
parentf683658705e3426306d1162e0f5b5f8e0b70bbeb (diff)
downloadpoky-b7b2e348716161deb21c9864ac5caa5f1df1fa9c.tar.gz
base-files: fix profile error under < /dev/null
Previous attempts to constrain execution of `resize` to only TTYs did not properly handle situations when `tty` would return the string "not a tty". The symptom is "/etc/profile: line 34: test: too many arguments". Fix this by utilizing the exit code of `tty`. Also use `case` instead of `cut` to eliminate a subshell. (From OE-Core rev: e67637e4472ff3a1e2801b84ee3d69d4e14b9efc) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/base-files/base-files/profile6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index 0a05e455ff..7367fd1e29 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -22,10 +22,12 @@ if [ -d /etc/profile.d ]; then
22 unset i 22 unset i
23fi 23fi
24 24
25if [ -x /usr/bin/resize ];then 25if [ -x /usr/bin/resize ] && termpath="`tty`"; then
26 # Make sure we are on a serial console (i.e. the device used starts with /dev/tty), 26 # Make sure we are on a serial console (i.e. the device used starts with /dev/tty),
27 # otherwise we confuse e.g. the eclipse launcher which tries do use ssh 27 # otherwise we confuse e.g. the eclipse launcher which tries do use ssh
28 test "`tty | cut -c1-8`" = "/dev/tty" && resize >/dev/null 28 case "$termpath" in
29 /dev/tty*) resize >/dev/null
30 esac
29fi 31fi
30 32
31export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM 33export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM