Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] [Krogoth] base-files: fix tty resize check
@ 2016-10-25 23:59 brian avery
  2016-10-25 23:59 ` [PATCH 1/1] This is a backport from master of 2 consecutive fixes brian avery
  0 siblings, 1 reply; 2+ messages in thread
From: brian avery @ 2016-10-25 23:59 UTC (permalink / raw)
  To: openembedded-core

This backports the 2 changes to base-files /etc/profile that addressed
problems with the way the tty was being checked to decide whether to run
resize or not.  When the tty check has errors, it prevents Eclipse debugging
from working.

-brian avery


The following changes since commit 40f4a6d075236265086cc79400dea3c14720383a:

  bsp-guide: Updated the yocto-bsp create selections in the example. (2016-10-13 23:16:56 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib bavery/krogoth/basefiles-tty
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/krogoth/basefiles-tty

Jussi Kukkonen (1):
  This is a backport from master of 2 consecutive fixes.

 meta/recipes-core/base-files/base-files/profile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] This is a backport from master of 2 consecutive fixes.
  2016-10-25 23:59 [PATCH 0/1] [Krogoth] base-files: fix tty resize check brian avery
@ 2016-10-25 23:59 ` brian avery
  0 siblings, 0 replies; 2+ messages in thread
From: brian avery @ 2016-10-25 23:59 UTC (permalink / raw)
  To: openembedded-core

From: Jussi Kukkonen <jussi.kukkonen@intel.com>

First fix commit:
1100af93cb07caf24d568c039d52fb0c80714c30
Second fix commit:
b7b2e348716161deb21c9864ac5caa5f1df1fa9c

The error these commits fix can prevent Eclipse debugging on
certain target configurations.

* base-files: Add shell test quoting

  tty can return "not a tt" which results in warnings when /etc/profile
  is executed.

  (From OE-Core rev: eed586dd238efe859442b21b425f04e262bcdb2b)

  Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
  Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

* 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>

Signed-off-by: brian avery <brian.avery@intel.com>
---
 meta/recipes-core/base-files/base-files/profile | 6 ++++--
 1 file 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 ba1b9ba..1f02e52 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -28,10 +28,12 @@ if [ -d /etc/profile.d ]; then
   unset i
 fi
 
-if [ -x /usr/bin/resize ];then
+if [ -x /usr/bin/resize ] && termpath="`tty`"; then
   # Make sure we are on a serial console (i.e. the device used starts with /dev/tty),
   # otherwise we confuse e.g. the eclipse launcher which tries do use ssh
-  test `tty | cut -c1-8` = "/dev/tty" && resize >/dev/null
+  case "$termpath" in
+  /dev/tty*) resize >/dev/null
+  esac
 fi
 
 export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-25 23:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-25 23:59 [PATCH 0/1] [Krogoth] base-files: fix tty resize check brian avery
2016-10-25 23:59 ` [PATCH 1/1] This is a backport from master of 2 consecutive fixes brian avery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox