| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Handle errors when SHLVL isn't set.
(From OE-Core rev: 5df53fcfe3b70a5312fced3fcc1ba6290f2ee794)
Signed-off-by: Felix Nilsson <felixn@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
(From OE-Core rev: dcdb30c83eb77fb2d5ea04f9b7fd7371da633a34)
Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using an editor or any kind of command line that wraps beyond the
column width of the session on a serial port is quite problematic
unless you are using an 80x24 session.
The original /etc/profile tried to use the resize binary if it was
available. The problem is that you only get the resize binary if
xterm, or busybox is installed.
This updated /etc/profile will add a resize function available to the
shell when no xterm or busybox resize binary is found. More care is
taken in this new version to test that terminal is interactive. The
EDITOR and SHLVL environment variables are checked to prevent resize
from running necessarily.
The function definitions are not indented intentionally to keep them
to the 80 column width.
(From OE-Core rev: 3743892996172c8595a1cbe884c4a0e6ef50dcda)
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current handling of resize is incorrect. Using `resize > /dev/null
2>&1 && resize > /dev/null' will cause the second resize command to not
execute because 'resize > /dev/null 2>&1' will fail for resize utility
from busybox.
What we really should do is just to check whether ${bindir}/resize
is executable and execute it if so. Using '-x' is sufficient.
(From OE-Core rev: 41688279cba3a5afc4fdc65fd245b9bb6ada695e)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the existence of "command" in itself is not guaranteed, using it
to determine if other executables exist is moot. Instead just run the
executables and let the shell determine if they exist. By piping stderr
to /dev/null we avoid unnecessary warnings in case they do not exist.
(From OE-Core rev: ba8510deb73e07f17be051fa15a91731ec10382f)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
| |
It is preferred to use `[ "$FOO" ] || ...` instead of
`[ -z "$FOO" ] && ...` as the latter leaves $? set to 1.
(From OE-Core rev: d76c68505c36dbf383a989f3c2458abc765e2c19)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids the following error when logging in to a host that does
not have the tty command:
-sh: tty: not found
Reported-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
(From OE-Core rev: e77cdb761169e404556487ac650dc562000da406)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
| |
(From OE-Core rev: 479a6202236832367bb48e4e089a6d99818685e5)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't want to run resize on non serial consoles. There's
been an earlier attempt (6557787), so this builds upon that.
The problem we're seeing is that if there is text buffered in
the virtual console (like from a desperate user trying to
enter login details), resize will get stuck while calling
ioctl(tty, TCSETAW);
Since serial consoles are named (not just numbered), this
change limits resize's reach even further to run only on
/dev/tty[A-z] (thus avoiding /dev/tty[0-9]).
(From OE-Core rev: 474ef7c95722aa68ee5dfbae2920d7c3d436d717)
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous attempts to constrain execution of `resize` to only TTYs did
not properly handle situations when `tty` would return the string "not a
tty". The symptom is "/etc/profile: line 34: test: too many arguments".
Fix this by utilizing the exit code of `tty`. Also use `case` instead of
`cut` to eliminate a subshell.
(From OE-Core rev: e67637e4472ff3a1e2801b84ee3d69d4e14b9efc)
Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If no /etc/localtime (or /etc/TZ for uclibc) is found, then the libc
will default to UTC, so setting UTC as a fallback default via the TZ
environment variable is redundant.
Since having the TZ environment variable set causes /etc/localtime
to be ignored, it can cause confusion if /etc/localtime is added
interactively after /etc/profile has been run.
(From OE-Core rev: 98b6420952cbf73ddd1318f36c68d575c330eb71)
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
| |
tty can return "not a tt" which results in warnings when /etc/profile
is executed.
(From OE-Core rev: eed586dd238efe859442b21b425f04e262bcdb2b)
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't need/wan't to run resize on an ssh connection. It's useless and
it breaks the Eclipse SSH debug connection. So, we added a check.
YOCTO #9362
(From OE-Core rev: 655778769f50d3aff74d7a436d28ac31b6aebb11)
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add some safety checks when sourcing files in /etc/profile.d/, in particular:
- source only *.sh files, not every file. This is the practice in use in both
Fedora and Debian/Ubuntu (see
https://help.ubuntu.com/community/EnvironmentVariables#A.2Fetc.2Fprofile.d.2F.2A.sh);
- check the input is actually a file and is readable. This check is especially
important if profile.d is empty, as "*.sh" will get expanded only if
profile.d is not empty. Previously if profile.d was present but empty,
"/etc/profile.d/*" was sourced causing errors on login and breaking stuff, for
example X startup.
(From OE-Core rev: 8961bc4b71723477a3b4a837a1d9c25c1b860b9e)
Signed-off-by: Diego Rondini <diego.ml@zoho.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Setting "EDITOR=/bin/vi" breaks on non-busybox systems, as
vim will populate /usr/bin/vi instead, and you get stuff like:
op3:~/poky/meta-builder$ git commit -s
error: cannot run /bin/vi: No such file or directory
error: unable to start editor '/bin/vi'
Please supply the message using either -m or -F option.
op3:~/poky/meta-builder$ which vi
/usr/bin/vi
op3:~/poky/meta-builder$
Since we've already specified a proper path above in the profile,
we've no need to call out where in the path vi lives, and hence
this will work with busybox and a full vim install w/o busybox.
(From OE-Core rev: dcdaa651f3180e4561d7d08f56bfb29f35f2085f)
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
By default, COLUMNS is set to 80. If possible, run 'resize' to
determine what the current dimensions are. This avoids the final
part of long lines overlap the start of the same line.
(From OE-Core rev: cc6360f4c4d97e0000f9d3545f381224ee99ce7d)
Signed-off-by: Ting Liu <ting.liu@freescale.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While glibc/eglibc looks for the time zone in /etc/localtime, other libc
alternatives (e.g. uclibc) may look for it in /etc/TZ. If /etc/TZ
exists, don't fall back to setting TZ to "UTC" in /etc/profile.
(From OE-Core rev: a69c3ba99be1502c50d3d1eb9ff66f135884ed76)
Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
| |
Use var ROOT_HOME to configure root home directory dynamically.
(From OE-Core rev: 341da5b6e46e0884d60e9462d1306d525fa99b94)
Signed-off-by: Kang Kai <kai.kang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
now the PATH for root user defined in a problematic way
PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:
from eglibc:
/* Two adjacent colons, or a colon at the beginning or the end
of `PATH' means to search the current directory. */
that means current directory is always searched as the last path,
which could generate undesired behavior.
One example is found in LTP cron_deny01 test, which always complains
"sh: cron_deny01 not found"
cron_deny01 is a shell script which setups the initial test preparation
and then invokes itself for real test under a different user:
su $TEST_USER1 -c "$0"
'su' doesn't inherit PATH into the sub-shell, and thus $0 has to
be an absolute path to have right script found.
ltp appends the path of cron_deny01 to $PATH before running the test:
export PATH="${PATH}:${LTPROOT}/testcases/bin"
In ideal way "${LTPROOT}/testcases/bin/cron_deny01" is found and becomes
$0, which works well.
However due to the ending colon in original PATH:
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin::${LTPROOT}/testcases/bin
$0 becomes 'cron_deny01' w/o leading path which makes sub-shell under 'su'
failed to locate cron_deny01.
remove ending colon then fixes this problem.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
|
|
Having one monolithic packages directory makes it hard to find things
and is generally overwhelming. This commit splits it into several
logical sections roughly based on function, recipes.txt gives more
information about the classifications used.
The opportunity is also used to switch from "packages" to "recipes"
as used in OpenEmbedded as the term "packages" can be confusing to
people and has many different meanings.
Not all recipes have been classified yet, this is just a first pass
at separating things out. Some packages are moved to meta-extras as
they're no longer actively used or maintained.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
|