summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas De Schampheleire <patrickdepinguin+buildroot@gmail.com>2011-10-19 07:36:02 (GMT)
committer Peter Korsgaard <jacmet@sunsite.dk>2011-10-28 12:59:27 (GMT)
commit2c8502e8211d6153830929110611ce18956ae42c (patch)
treea93ca57160e106c6e4e72214d21849cc33d197b5
parenteb8f0522f89c3f679fe73d1acff673110fe38107 (diff)
downloadbuildroot-2c8502e8211d6153830929110611ce18956ae42c.tar.gz
buildroot-2c8502e8211d6153830929110611ce18956ae42c.tar.bz2
/etc/profile: read in /etc/profile.d/*.sh files
For custom projects, it is more maintainable to add custom profile settings in a separate file, than directly in /etc/profile. This patch modifies /etc/profile to read in *.sh files from /etc/profile.d/, a technique commonly used in Linux distributions. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
-rw-r--r--fs/skeleton/etc/profile7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/skeleton/etc/profile b/fs/skeleton/etc/profile
index cc2e0be..31d3180 100644
--- a/fs/skeleton/etc/profile
+++ b/fs/skeleton/etc/profile
@@ -46,3 +46,10 @@ if [ "$PS1" ]; then
alias calc='calc -Cd '
alias bc='calc -Cd '
fi;
+
+# Source configuration files from /etc/profile.d
+for i in /etc/profile.d/*.sh ; do
+ if [ -r "$i" ]; then
+ . $i
+ fi
+done