All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] base-files: profile: Do not assume that the 'command' command exists
@ 2017-09-18  8:39 Mike Looijmans
  2017-09-18  8:39 ` [PATCH 2/2] base-files: profile: Make the "resize" command have the intended effect Mike Looijmans
                   ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: Mike Looijmans @ 2017-09-18  8:39 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mike Looijmans

The "command" shell command appears to be a bashism, the standard
busybox shell doesn't implement it.

This avoids the following error when logging in to a host that does
not have the 'command' command:

    -sh: command: not found

It also simplifies the code and reduces the number of forks.

Fixes: e77cdb761169e404556487ac650dc562000da406
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
---
 meta/recipes-core/base-files/base-files/profile | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index ceaf15f..b5b533c 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -22,14 +22,12 @@ if [ -d /etc/profile.d ]; then
 	unset i
 fi
 
-if command -v resize >/dev/null && command -v tty >/dev/null; then
-	# Make sure we are on a serial console (i.e. the device used starts with
-	# /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which
-	# tries do use ssh
-	case $(tty) in
-		/dev/tty[A-z]*) resize >/dev/null;;
-	esac
-fi
+# Make sure we are on a serial console (i.e. the device used starts with
+# /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which
+# tries do use ssh
+case $(tty 2>/dev/null) in
+	/dev/tty[A-z]*) resize >/dev/null;;
+esac
 
 export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
 
-- 
1.9.1



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

end of thread, other threads:[~2018-05-18 17:33 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-18  8:39 [PATCH 1/2] base-files: profile: Do not assume that the 'command' command exists Mike Looijmans
2017-09-18  8:39 ` [PATCH 2/2] base-files: profile: Make the "resize" command have the intended effect Mike Looijmans
2017-09-18  8:49 ` [PATCH 1/2] base-files: profile: Do not assume that the 'command' command exists Peter Kjellerstedt
2017-09-18 11:31   ` Mike Looijmans
2017-09-18 13:08     ` Burton, Ross
2017-09-18 13:24       ` Mike Looijmans
2017-09-18 13:56         ` Mike Looijmans
2017-10-13  9:53           ` ChenQi
2017-10-13 10:07             ` ChenQi
2018-05-18 10:28               ` Martin Jansa
2018-05-18 16:51                 ` Peter Kjellerstedt
2018-05-18 17:32                   ` Martin Jansa
2017-09-18 14:07       ` [PATCH] base-files: profile: Get rid of "resize" Mike Looijmans
2017-09-18 15:07         ` Peter Kjellerstedt
2017-09-18 15:17           ` Burton, Ross
2017-09-18 18:41             ` Andre McCurdy
2017-09-18 18:43               ` Burton, Ross
2017-09-18 19:01                 ` Andre McCurdy
2017-09-18 19:19                   ` Burton, Ross
2017-09-18 19:30                     ` Andre McCurdy
2017-09-18 20:18                       ` Burton, Ross
2017-09-18 21:11                         ` Andre McCurdy
2017-09-18 23:07                           ` Trevor Woerner
2017-09-19  5:35                             ` Mike Looijmans
2017-09-19 12:34                           ` Burton, Ross
2017-09-19  5:31                     ` Mike Looijmans
2017-09-19  5:26                 ` Mike Looijmans
2017-09-19 12:33                   ` Burton, Ross
2017-09-18 14:30 ` ✗ patchtest: failure for "base-files: profile: Do not as..." and 1 more (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.