[OE-core] [PATCH] base-files: profile: Get rid of "resize"

Burton, Ross ross.burton at intel.com
Mon Sep 18 18:43:26 UTC 2017


On 18 September 2017 at 19:41, Andre McCurdy <armccurdy at gmail.com> wrote:

> On Mon, Sep 18, 2017 at 8:17 AM, Burton, Ross <ross.burton at intel.com>
> wrote:
> > On 18 September 2017 at 16:07, Peter Kjellerstedt
> > <peter.kjellerstedt at axis.com> wrote:
> >>
> >> > -----Original Message-----
> >> > From: openembedded-core-bounces at lists.openembedded.org
> >> > [mailto:openembedded-core-bounces at lists.openembedded.org] On Behalf
> Of
> >> > Mike Looijmans
> >> > Sent: den 18 september 2017 16:07
> >> > To: openembedded-core at lists.openembedded.org
> >> > Cc: Mike Looijmans <mike.looijmans at topic.nl>; Peter Kjellerstedt
> >> > <peter.kjellerstedt at 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.looijmans at 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, &w) 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170918/e6da2e59/attachment-0002.html>


More information about the Openembedded-core mailing list