Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On 18 September 2017 at 22:11, Andre McCurdywrote: > The "get rid of resize" patch seems to have made it into mut. > It was reverted at 8pm last night but I didn't push. Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On 19 September 2017 at 06:26, Mike Looijmanswrote: > My experience is that it does not, and never has. I run serial consoles > all the time, and if they're not sized to 80x25 weird stuff happens. > > Start vi on a serial terminal and it only uses the top 80x25. If a command > exceed the 80 char mark, the cursor goes all weird. > Running "eval `resize`" fixes that (until you resize the window). Running > just "resize" does not have any effect on that at all. > > Cannot we determine the presence of "tty" and "resize" commands at compile > time? something like: > > if has_command("tty") and has_command("resize"): > install -m 755 ${S}/resize.sh ${D}${sysconfdir}/profile.d/ As part of busybox, yes. Not anywhere else though. Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On 19-09-17 01:07, Trevor Woerner wrote: I use resize quasi-regularly. Ever end up in the situation where you've run vim and now the command-line has no idea how large the console is, so everything wraps or scrolls at the wrong times/places? resize fixes that: # . resize Please don't remove it. We're not removing the "resize" command itself. It's about removing something that started as a simple one-liner in /etc/profile to call "resize" (that did not fix the problem) and grew out to be a monster over time. Kind regards, Mike Looijmans System Expert TOPIC Products Materiaalweg 4, NL-5681 RJ Best Postbus 440, NL-5680 AK Best Telefoon: +31 (0) 499 33 69 79 E-mail: mike.looijm...@topicproducts.com Website: www.topicproducts.com Please consider the environment before printing this e-mail -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On 18-09-17 21:19, Burton, Ross wrote: On 18 September 2017 at 20:01, Andre McCurdy> wrote: > The question is does it do something useful *now*? I don't have a board with a serial console to test at the moment. Busybox hasn't changed in recent memory though, so as long as the resize command does actually get run I presume it's still going to work. Re-read the code. There's a call to ioctl with TIOCSWINSZ which I'm *guessing* is set window size. Google is not useful for this! It does all this on stderr. Google on TIOCSWINSZ yields: https://linux.die.net/man/4/tty_ioctl TIOCSWINSZ const struct winsize *argp Set window size. Of course, there is no explanation on what a "set window size" is supposed to accomplish on the terminal device. So yes it *should* work, but not if you redirect stderr to /dev/null. Yep. Kind regards, Mike Looijmans System Expert TOPIC Products Materiaalweg 4, NL-5681 RJ Best Postbus 440, NL-5680 AK Best Telefoon: +31 (0) 499 33 69 79 E-mail: mike.looijm...@topicproducts.com Website: www.topicproducts.com Please consider the environment before printing this e-mail -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On 18-09-17 20:43, Burton, Ross wrote: On 18 September 2017 at 19:41, Andre McCurdy <armccu...@gmail.com <mailto:armccu...@gmail.com>> wrote: On Mon, Sep 18, 2017 at 8:17 AM, Burton, Ross <ross.bur...@intel.com <mailto:ross.bur...@intel.com>> wrote: > On 18 September 2017 at 16:07, Peter Kjellerstedt > <peter.kjellerst...@axis.com <mailto:peter.kjellerst...@axis.com>> wrote: >> >> > Kind regards, Mike Looijmans System Expert TOPIC Products Materiaalweg 4, NL-5681 RJ Best Postbus 440, NL-5680 AK Best Telefoon: +31 (0) 499 33 69 79 E-mail: mike.looijm...@topicproducts.com Website: www.topicproducts.com Please consider the environment before printing this e-mail -Original Message- >> > From: openembedded-core-boun...@lists.openembedded.org <mailto:openembedded-core-boun...@lists.openembedded.org> >> > [mailto:openembedded-core-boun...@lists.openembedded.org <mailto:openembedded-core-boun...@lists.openembedded.org>] On Behalf Of >> > Mike Looijmans >> > Sent: den 18 september 2017 16:07 >> > To: openembedded-core@lists.openembedded.org <mailto:openembedded-core@lists.openembedded.org> >> > Cc: Mike Looijmans <mike.looijm...@topic.nl <mailto:mike.looijm...@topic.nl>>; Peter Kjellerstedt >> > <peter.kjellerst...@axis.com <mailto:peter.kjellerst...@axis.com>> >> > Subject: [OE-core] [PATCH] base-files: profile: Get rid of "resize" >> > >> > The "resize" command actually outputs shell commands to be executed, for >> > example: >> > >> > $ resize >> > COLUMNS=102; >> > LINES=27; >> > export COLUMNS LINES; >> > >> > The output of "resize" is being discarded to /dev/null so the call has >> > no >> > effect whatsoever, and does not change the environment (it cannot change >> > the >> > environment of its parent). Remove the call and hence solve the messages >> > about shells missing "command" or "tty" or "resize". >> > >> > Signed-off-by: Mike Looijmans <mike.looijm...@topic.nl <mailto:mike.looijm...@topic.nl>> >> > --- >> > meta/recipes-core/base-files/base-files/profile | 9 - >> > 1 file changed, 9 deletions(-) >> > >> > diff --git a/meta/recipes-core/base-files/base-files/profile >> > b/meta/recipes-core/base-files/base-files/profile >> > index a062028..cfd0d69 100644 >> > --- a/meta/recipes-core/base-files/base-files/profile >> > +++ b/meta/recipes-core/base-files/base-files/profile >> > @@ -20,15 +20,6 @@ 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 >> > - >> > export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM >> > >> > umask 022 >> > -- >> > 1.9.1 >> >> Hold on. Looking at busybox' source code for resize, it seems that >> it actually does something besides outputting the shell code to >> set the variables (which is actually enabled by a separate feature >> called ENABLE_FEATURE_RESIZE_PRINT). It also calls >> ioctl(STDERR_FILENO, TIOCSWINSZ, ) where w contains the >> calculated sizes. > > My knowledge of ANSI escapes is incredibly sketchy, but isn't that the code > to *get* the size of the screen? Put the cursor at 999,999, then ask where > it is? The behaviour may have got broken with the various /etc/profile rewrites but it certainly did do something useful originally - it greatly improves usability for shells run on serial consoles. Please don't just remove it. The question is does it do something useful *now*? My experience is that it does not, and never has. I run serial consoles all the time, and if they're not sized to 80x25 weird stuff happens. Start vi on a serial terminal and it only uses the top 80x25. If a command exceed the 80 char mark, the cursor goes all weird. Running "eval `resize`" fixes that (until you resize the window). Running just "resize" does not have any effect on that at all. Cannot we determine the presence of "tty" and "resize" commands at compile time? something like: if has_command("tty") and has_command("resize"): install -m 755 ${S}/resize.sh ${D}${sysconfdir}/profile.d/ -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
I use resize quasi-regularly. Ever end up in the situation where you've run vim and now the command-line has no idea how large the console is, so everything wraps or scrolls at the wrong times/places? resize fixes that: # . resize Please don't remove it. -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On Mon, Sep 18, 2017 at 1:18 PM, Burton, Rosswrote: >> > There's a call to ioctl with TIOCSWINSZ which I'm >> > *guessing* is set window size. Google is not useful for this! It does >> > all this on stderr. >> > >> > So yes it *should* work, but not if you redirect stderr to /dev/null. >> >> We don't redirect stderr to /dev/null, only stdout. > > One of the many patches here does. > > I'm holding off applying any of them right now. :) The "get rid of resize" patch seems to have made it into mut. -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On 18 September 2017 at 20:30, Andre McCurdywrote: > On Mon, Sep 18, 2017 at 12:19 PM, Burton, Ross > wrote: > > On 18 September 2017 at 20:01, Andre McCurdy > wrote: > >> > >> > The question is does it do something useful *now*? > >> > >> I don't have a board with a serial console to test at the moment. > >> Busybox hasn't changed in recent memory though, so as long as the > >> resize command does actually get run I presume it's still going to > >> work. > > > > Re-read the code. > > I've never read the code before, so don't make any claims to know > *how* it works or worked :-) > > > There's a call to ioctl with TIOCSWINSZ which I'm > > *guessing* is set window size. Google is not useful for this! It does > all > > this on stderr. > > > > So yes it *should* work, but not if you redirect stderr to /dev/null. > > We don't redirect stderr to /dev/null, only stdout. One of the many patches here does. I'm holding off applying any of them right now. :) Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On Mon, Sep 18, 2017 at 12:19 PM, Burton, Rosswrote: > On 18 September 2017 at 20:01, Andre McCurdy wrote: >> >> > The question is does it do something useful *now*? >> >> I don't have a board with a serial console to test at the moment. >> Busybox hasn't changed in recent memory though, so as long as the >> resize command does actually get run I presume it's still going to >> work. > > Re-read the code. I've never read the code before, so don't make any claims to know *how* it works or worked :-) > There's a call to ioctl with TIOCSWINSZ which I'm > *guessing* is set window size. Google is not useful for this! It does all > this on stderr. > > So yes it *should* work, but not if you redirect stderr to /dev/null. We don't redirect stderr to /dev/null, only stdout. > Yes, this is a mess. :) > > Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On 18 September 2017 at 20:01, Andre McCurdywrote: > > The question is does it do something useful *now*? > > I don't have a board with a serial console to test at the moment. > Busybox hasn't changed in recent memory though, so as long as the > resize command does actually get run I presume it's still going to > work. > Re-read the code. There's a call to ioctl with TIOCSWINSZ which I'm *guessing* is set window size. Google is not useful for this! It does all this on stderr. So yes it *should* work, but not if you redirect stderr to /dev/null. Yes, this is a mess. :) Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On Mon, Sep 18, 2017 at 11:43 AM, Burton, Ross <ross.bur...@intel.com> wrote: > On 18 September 2017 at 19:41, Andre McCurdy <armccu...@gmail.com> wrote: >> >> On Mon, Sep 18, 2017 at 8:17 AM, Burton, Ross <ross.bur...@intel.com> >> wrote: >> > On 18 September 2017 at 16:07, Peter Kjellerstedt >> > <peter.kjellerst...@axis.com> wrote: >> >> >> >> > -Original Message- >> >> > From: openembedded-core-boun...@lists.openembedded.org >> >> > [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf >> >> > Of >> >> > Mike Looijmans >> >> > Sent: den 18 september 2017 16:07 >> >> > To: openembedded-core@lists.openembedded.org >> >> > Cc: Mike Looijmans <mike.looijm...@topic.nl>; Peter Kjellerstedt >> >> > <peter.kjellerst...@axis.com> >> >> > Subject: [OE-core] [PATCH] base-files: profile: Get rid of "resize" >> >> > >> >> > The "resize" command actually outputs shell commands to be executed, >> >> > for >> >> > example: >> >> > >> >> > $ resize >> >> > COLUMNS=102; >> >> > LINES=27; >> >> > export COLUMNS LINES; >> >> > >> >> > The output of "resize" is being discarded to /dev/null so the call >> >> > has >> >> > no >> >> > effect whatsoever, and does not change the environment (it cannot >> >> > change >> >> > the >> >> > environment of its parent). Remove the call and hence solve the >> >> > messages >> >> > about shells missing "command" or "tty" or "resize". >> >> > >> >> > Signed-off-by: Mike Looijmans <mike.looijm...@topic.nl> >> >> > --- >> >> > meta/recipes-core/base-files/base-files/profile | 9 - >> >> > 1 file changed, 9 deletions(-) >> >> > >> >> > diff --git a/meta/recipes-core/base-files/base-files/profile >> >> > b/meta/recipes-core/base-files/base-files/profile >> >> > index a062028..cfd0d69 100644 >> >> > --- a/meta/recipes-core/base-files/base-files/profile >> >> > +++ b/meta/recipes-core/base-files/base-files/profile >> >> > @@ -20,15 +20,6 @@ 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 >> >> > - >> >> > export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM >> >> > >> >> > umask 022 >> >> > -- >> >> > 1.9.1 >> >> >> >> Hold on. Looking at busybox' source code for resize, it seems that >> >> it actually does something besides outputting the shell code to >> >> set the variables (which is actually enabled by a separate feature >> >> called ENABLE_FEATURE_RESIZE_PRINT). It also calls >> >> ioctl(STDERR_FILENO, TIOCSWINSZ, ) where w contains the >> >> calculated sizes. >> > >> > My knowledge of ANSI escapes is incredibly sketchy, but isn't that the >> > code >> > to *get* the size of the screen? Put the cursor at 999,999, then ask >> > where >> > it is? >> >> The behaviour may have got broken with the various /etc/profile >> rewrites but it certainly did do something useful originally - it >> greatly improves usability for shells run on serial consoles. Please >> don't just remove it. > > > The question is does it do something useful *now*? I don't have a board with a serial console to test at the moment. Busybox hasn't changed in recent memory though, so as long as the resize command does actually get run I presume it's still going to work. > Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On 18 September 2017 at 19:41, Andre McCurdy <armccu...@gmail.com> wrote: > On Mon, Sep 18, 2017 at 8:17 AM, Burton, Ross <ross.bur...@intel.com> > wrote: > > On 18 September 2017 at 16:07, Peter Kjellerstedt > > <peter.kjellerst...@axis.com> wrote: > >> > >> > -Original Message- > >> > From: openembedded-core-boun...@lists.openembedded.org > >> > [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf > Of > >> > Mike Looijmans > >> > Sent: den 18 september 2017 16:07 > >> > To: openembedded-core@lists.openembedded.org > >> > Cc: Mike Looijmans <mike.looijm...@topic.nl>; Peter Kjellerstedt > >> > <peter.kjellerst...@axis.com> > >> > Subject: [OE-core] [PATCH] base-files: profile: Get rid of "resize" > >> > > >> > The "resize" command actually outputs shell commands to be executed, > for > >> > example: > >> > > >> > $ resize > >> > COLUMNS=102; > >> > LINES=27; > >> > export COLUMNS LINES; > >> > > >> > The output of "resize" is being discarded to /dev/null so the call has > >> > no > >> > effect whatsoever, and does not change the environment (it cannot > change > >> > the > >> > environment of its parent). Remove the call and hence solve the > messages > >> > about shells missing "command" or "tty" or "resize". > >> > > >> > Signed-off-by: Mike Looijmans <mike.looijm...@topic.nl> > >> > --- > >> > meta/recipes-core/base-files/base-files/profile | 9 - > >> > 1 file changed, 9 deletions(-) > >> > > >> > diff --git a/meta/recipes-core/base-files/base-files/profile > >> > b/meta/recipes-core/base-files/base-files/profile > >> > index a062028..cfd0d69 100644 > >> > --- a/meta/recipes-core/base-files/base-files/profile > >> > +++ b/meta/recipes-core/base-files/base-files/profile > >> > @@ -20,15 +20,6 @@ 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 > >> > - > >> > export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM > >> > > >> > umask 022 > >> > -- > >> > 1.9.1 > >> > >> Hold on. Looking at busybox' source code for resize, it seems that > >> it actually does something besides outputting the shell code to > >> set the variables (which is actually enabled by a separate feature > >> called ENABLE_FEATURE_RESIZE_PRINT). It also calls > >> ioctl(STDERR_FILENO, TIOCSWINSZ, ) where w contains the > >> calculated sizes. > > > > My knowledge of ANSI escapes is incredibly sketchy, but isn't that the > code > > to *get* the size of the screen? Put the cursor at 999,999, then ask > where > > it is? > > The behaviour may have got broken with the various /etc/profile > rewrites but it certainly did do something useful originally - it > greatly improves usability for shells run on serial consoles. Please > don't just remove it. > The question is does it do something useful *now*? Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On Mon, Sep 18, 2017 at 8:17 AM, Burton, Ross <ross.bur...@intel.com> wrote: > On 18 September 2017 at 16:07, Peter Kjellerstedt > <peter.kjellerst...@axis.com> wrote: >> >> > -Original Message- >> > From: openembedded-core-boun...@lists.openembedded.org >> > [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of >> > Mike Looijmans >> > Sent: den 18 september 2017 16:07 >> > To: openembedded-core@lists.openembedded.org >> > Cc: Mike Looijmans <mike.looijm...@topic.nl>; Peter Kjellerstedt >> > <peter.kjellerst...@axis.com> >> > Subject: [OE-core] [PATCH] base-files: profile: Get rid of "resize" >> > >> > The "resize" command actually outputs shell commands to be executed, for >> > example: >> > >> > $ resize >> > COLUMNS=102; >> > LINES=27; >> > export COLUMNS LINES; >> > >> > The output of "resize" is being discarded to /dev/null so the call has >> > no >> > effect whatsoever, and does not change the environment (it cannot change >> > the >> > environment of its parent). Remove the call and hence solve the messages >> > about shells missing "command" or "tty" or "resize". >> > >> > Signed-off-by: Mike Looijmans <mike.looijm...@topic.nl> >> > --- >> > meta/recipes-core/base-files/base-files/profile | 9 - >> > 1 file changed, 9 deletions(-) >> > >> > diff --git a/meta/recipes-core/base-files/base-files/profile >> > b/meta/recipes-core/base-files/base-files/profile >> > index a062028..cfd0d69 100644 >> > --- a/meta/recipes-core/base-files/base-files/profile >> > +++ b/meta/recipes-core/base-files/base-files/profile >> > @@ -20,15 +20,6 @@ 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 >> > - >> > export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM >> > >> > umask 022 >> > -- >> > 1.9.1 >> >> Hold on. Looking at busybox' source code for resize, it seems that >> it actually does something besides outputting the shell code to >> set the variables (which is actually enabled by a separate feature >> called ENABLE_FEATURE_RESIZE_PRINT). It also calls >> ioctl(STDERR_FILENO, TIOCSWINSZ, ) where w contains the >> calculated sizes. > > My knowledge of ANSI escapes is incredibly sketchy, but isn't that the code > to *get* the size of the screen? Put the cursor at 999,999, then ask where > it is? The behaviour may have got broken with the various /etc/profile rewrites but it certainly did do something useful originally - it greatly improves usability for shells run on serial consoles. Please don't just remove it. > Ross > > -- > ___ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
On 18 September 2017 at 16:07, Peter Kjellerstedt < peter.kjellerst...@axis.com> wrote: > > -Original Message- > > From: openembedded-core-boun...@lists.openembedded.org > > [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of > > Mike Looijmans > > Sent: den 18 september 2017 16:07 > > To: openembedded-core@lists.openembedded.org > > Cc: Mike Looijmans <mike.looijm...@topic.nl>; Peter Kjellerstedt > > <peter.kjellerst...@axis.com> > > Subject: [OE-core] [PATCH] base-files: profile: Get rid of "resize" > > > > The "resize" command actually outputs shell commands to be executed, for > > example: > > > > $ resize > > COLUMNS=102; > > LINES=27; > > export COLUMNS LINES; > > > > The output of "resize" is being discarded to /dev/null so the call has no > > effect whatsoever, and does not change the environment (it cannot change > the > > environment of its parent). Remove the call and hence solve the messages > > about shells missing "command" or "tty" or "resize". > > > > Signed-off-by: Mike Looijmans <mike.looijm...@topic.nl> > > --- > > meta/recipes-core/base-files/base-files/profile | 9 - > > 1 file changed, 9 deletions(-) > > > > diff --git a/meta/recipes-core/base-files/base-files/profile > b/meta/recipes-core/base-files/base-files/profile > > index a062028..cfd0d69 100644 > > --- a/meta/recipes-core/base-files/base-files/profile > > +++ b/meta/recipes-core/base-files/base-files/profile > > @@ -20,15 +20,6 @@ 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 > > - > > export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM > > > > umask 022 > > -- > > 1.9.1 > > Hold on. Looking at busybox' source code for resize, it seems that > it actually does something besides outputting the shell code to > set the variables (which is actually enabled by a separate feature > called ENABLE_FEATURE_RESIZE_PRINT). It also calls > ioctl(STDERR_FILENO, TIOCSWINSZ, ) where w contains the > calculated sizes. > My knowledge of ANSI escapes is incredibly sketchy, but isn't that the code to *get* the size of the screen? Put the cursor at 999,999, then ask where it is? Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] base-files: profile: Get rid of "resize"
> -Original Message- > From: openembedded-core-boun...@lists.openembedded.org > [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of > Mike Looijmans > Sent: den 18 september 2017 16:07 > To: openembedded-core@lists.openembedded.org > Cc: Mike Looijmans <mike.looijm...@topic.nl>; Peter Kjellerstedt > <peter.kjellerst...@axis.com> > Subject: [OE-core] [PATCH] base-files: profile: Get rid of "resize" > > The "resize" command actually outputs shell commands to be executed, for > example: > > $ resize > COLUMNS=102; > LINES=27; > export COLUMNS LINES; > > The output of "resize" is being discarded to /dev/null so the call has no > effect whatsoever, and does not change the environment (it cannot change the > environment of its parent). Remove the call and hence solve the messages > about shells missing "command" or "tty" or "resize". > > Signed-off-by: Mike Looijmans <mike.looijm...@topic.nl> > --- > meta/recipes-core/base-files/base-files/profile | 9 - > 1 file changed, 9 deletions(-) > > diff --git a/meta/recipes-core/base-files/base-files/profile > b/meta/recipes-core/base-files/base-files/profile > index a062028..cfd0d69 100644 > --- a/meta/recipes-core/base-files/base-files/profile > +++ b/meta/recipes-core/base-files/base-files/profile > @@ -20,15 +20,6 @@ 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 > - > export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM > > umask 022 > -- > 1.9.1 Hold on. Looking at busybox' source code for resize, it seems that it actually does something besides outputting the shell code to set the variables (which is actually enabled by a separate feature called ENABLE_FEATURE_RESIZE_PRINT). It also calls ioctl(STDERR_FILENO, TIOCSWINSZ, ) where w contains the calculated sizes. However, I also just learnt that the busybox implementation of resize uses stderr to send control codes to move the cursor to find the tty sizes, which means that if one uses resize 2>/dev/null as my patch suggested, it does not work at all and just times out after three seconds. What a mess... //Peter -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] base-files: profile: Get rid of "resize"
The "resize" command actually outputs shell commands to be executed, for example: $ resize COLUMNS=102; LINES=27; export COLUMNS LINES; The output of "resize" is being discarded to /dev/null so the call has no effect whatsoever, and does not change the environment (it cannot change the environment of its parent). Remove the call and hence solve the messages about shells missing "command" or "tty" or "resize". Signed-off-by: Mike Looijmans--- meta/recipes-core/base-files/base-files/profile | 9 - 1 file changed, 9 deletions(-) diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile index a062028..cfd0d69 100644 --- a/meta/recipes-core/base-files/base-files/profile +++ b/meta/recipes-core/base-files/base-files/profile @@ -20,15 +20,6 @@ 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 - export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM umask 022 -- 1.9.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core