From b1a0ca3cab726d6578196a7d29660ec1ca0fec66 Mon Sep 17 00:00:00 2001 From: Felix Nilsson Date: Wed, 12 Jun 2024 04:39:09 +0200 Subject: [PATCH] base-files: profile: fix error sh: 1: unknown operand Handle errors when SHLVL isn't set. (From OE-Core rev: 7ef2c9ab669785e5e073d6f925f1a3f447fc31d9) Signed-off-by: Felix Nilsson Signed-off-by: Richard Purdie (cherry picked from commit 5df53fcfe3b70a5312fced3fcc1ba6290f2ee794) Signed-off-by: Peter Kjellerstedt Signed-off-by: Steve Sakoman --- meta/recipes-core/base-files/base-files/profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile index bded3757cc..5e8393c91c 100644 --- a/meta/recipes-core/base-files/base-files/profile +++ b/meta/recipes-core/base-files/base-files/profile @@ -58,7 +58,7 @@ resize() { fi # only do this for /dev/tty[A-z] which are typically # serial ports - if [ $FIRSTTIMESETUP -eq 1 -a $SHLVL -eq 1 ] ; then + if [ $FIRSTTIMESETUP -eq 1 -a ${SHLVL:-1} -eq 1 ] ; then case $(tty 2>/dev/null) in /dev/tty[A-z]*) resize >/dev/null;; esac