* [meta-oe][PATCH] base-files: profile: allow profile.d to set EDITOR
@ 2023-10-13 10:27 SCHNEIDER Johannes
2023-10-14 8:08 ` [OE-core] " Luca Ceresoli
2023-10-14 8:52 ` Luca Ceresoli
0 siblings, 2 replies; 3+ messages in thread
From: SCHNEIDER Johannes @ 2023-10-13 10:27 UTC (permalink / raw)
To: openembedded-core@lists.openembedded.org; +Cc: Jason Wessel, Richard Purdie
From 0013c8a6482018d5476e4eb2f4d537c96551e0c6 Mon Sep 17 00:00:00 2001
From: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Date: Fri, 13 Oct 2023 08:28:38 +0200
Subject: [PATCH v1] base-files: profile: allow profile.d to set EDITOR
With a profile.d configuration in place that sets the EDITOR variable,
the automatic terminal 'resize' logic would not trigger. Which then
would possibly lead to a 80x24 fallback on the debug serial console.
This can simply be avoided by setting a flag variable when the shell
is first opened, then processing all profile.d includes, trigger the
'resize' depending on the flag and shell-level and finally only set
EDITOR to some default if it is still unset.
Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
---
meta/recipes-core/base-files/base-files/profile | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index cc37e1ba77..bded3757cc 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -10,6 +10,12 @@ PATH="/usr/local/bin:/usr/bin:/bin"
# Set the prompt for bash and ash (no other shells known to be in use here)
[ -z "$PS1" ] || PS1='\u@\h:\w\$ '
+# Use the EDITOR not being set as a trigger to call resize later on
+FIRSTTIMESETUP=0
+if [ -z "$EDITOR" ] ; then
+ FIRSTTIMESETUP=1
+fi
+
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -f $i -a -r $i ]; then
@@ -50,17 +56,19 @@ resize() {
}
fi
fi
- # Use the EDITOR not being set as a trigger to call resize
- # and only do this for /dev/tty[A-z] which are typically
+ # only do this for /dev/tty[A-z] which are typically
# serial ports
- if [ -z "$EDITOR" -a "$SHLVL" = 1 ] ; then
+ if [ $FIRSTTIMESETUP -eq 1 -a $SHLVL -eq 1 ] ; then
case $(tty 2>/dev/null) in
/dev/tty[A-z]*) resize >/dev/null;;
esac
fi
fi
-EDITOR="vi" # needed for packages like cron, git-commit
+if [ -z "$EDITOR" ]; then
+ EDITOR="vi" # needed for packages like cron, git-commit
+fi
+
export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
umask 022
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [meta-oe][PATCH] base-files: profile: allow profile.d to set EDITOR
2023-10-13 10:27 [meta-oe][PATCH] base-files: profile: allow profile.d to set EDITOR SCHNEIDER Johannes
@ 2023-10-14 8:08 ` Luca Ceresoli
2023-10-14 8:52 ` Luca Ceresoli
1 sibling, 0 replies; 3+ messages in thread
From: Luca Ceresoli @ 2023-10-14 8:08 UTC (permalink / raw)
To: Johannes Schneider via lists.openembedded.org
Cc: johannes.schneider, openembedded-core@lists.openembedded.org,
Jason Wessel, Richard Purdie
Hello Johannes,
On Fri, 13 Oct 2023 10:27:34 +0000
"Johannes Schneider via lists.openembedded.org"
<johannes.schneider=leica-geosystems.com@lists.openembedded.org> wrote:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As you can see your sender address has been mangled, and as a result
the patch is rejected by the the openembedded git server. This is not
your fault, but we need you to modify your git configuration to prevent
this from happening in the future. Have a look at the wiki for more
info and how to solve that:
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded#Fixing_your_From_identity
I'm taking your patch for testing on the autobuilders fixing it
manually so you don't need to resend your patch this time.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core] [meta-oe][PATCH] base-files: profile: allow profile.d to set EDITOR
2023-10-13 10:27 [meta-oe][PATCH] base-files: profile: allow profile.d to set EDITOR SCHNEIDER Johannes
2023-10-14 8:08 ` [OE-core] " Luca Ceresoli
@ 2023-10-14 8:52 ` Luca Ceresoli
1 sibling, 0 replies; 3+ messages in thread
From: Luca Ceresoli @ 2023-10-14 8:52 UTC (permalink / raw)
To: Johannes Schneider via lists.openembedded.org
Cc: johannes.schneider, openembedded-core@lists.openembedded.org,
Jason Wessel, Richard Purdie
Hello again,
On Fri, 13 Oct 2023 10:27:34 +0000
"Johannes Schneider via lists.openembedded.org"
<johannes.schneider=leica-geosystems.com@lists.openembedded.org> wrote:
> From 0013c8a6482018d5476e4eb2f4d537c96551e0c6 Mon Sep 17 00:00:00 2001
> From: Johannes Schneider <johannes.schneider@leica-geosystems.com>
> Date: Fri, 13 Oct 2023 08:28:38 +0200
> Subject: [PATCH v1] base-files: profile: allow profile.d to set EDITOR
In addition to my previous remark, I noticed that your e-mail is
formatted in an incorrect way. The From/Date/Subject: lines inside the
e-mail body suggest you probably manipulated a git-formatted patch in
an incorrect way. You should review the way you are sending patches,
perhaps you only need to call 'git send-patch -1' or similar instead of
some manipulation you have been doing here.
Again, you don't need to resend for this tome as I have fixed it
locally.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-14 8:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-13 10:27 [meta-oe][PATCH] base-files: profile: allow profile.d to set EDITOR SCHNEIDER Johannes
2023-10-14 8:08 ` [OE-core] " Luca Ceresoli
2023-10-14 8:52 ` Luca Ceresoli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox