base-files: add /etc/profile.d support
authorJohn Crispin <john@openwrt.org>
Tue, 1 Mar 2016 08:15:04 +0000 (08:15 +0000)
committerJohn Crispin <john@openwrt.org>
Tue, 1 Mar 2016 08:15:04 +0000 (08:15 +0000)
commit592289b29e41356d3fdbcda8c3c17145fd074a95
treea8a811e917d15f203617dfd18a5986999a992bcf
parent3ea8b6a4dc8bf2d7509e11cb7038b295933eda23
base-files: add /etc/profile.d support

OpenWrt should support an optional /etc/profile.d directory like
most other Linux distributions. This allows packages to install
their own scripts into /etc/profile.d/ directory.

The file suffix should make clear, that these scripts
are (sourced) shell-snippets. If the user needs e.g. php or lua,
one must make sure that the interpreter is called.
The reverse failsafe test makes sure, that the effective returncode is 0.

A typcal usecase is the inclusion of private helpers,
special variables or aliases, which at the moment needs
patching the sourcecode and is not well maintainable.
Now the builder can simply add there files.

v1 initial work of Hendrik Lüth <hendrik@linux-nerds.de>
v2 changes regarding RFC (e.g. thomas.langer@lantiq.com)
v3 changes regarding RFC (e.g. mschiffer@universe-factory.net)
v4 keep it simple and mimic OpenWrt style

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>
Backport of r46965

SVN-Revision: 48862
package/base-files/files/etc/profile