From: Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] /etc/profile: read in /etc/profile.d/*.sh files
Date: Wed, 19 Oct 2011 09:36:02 +0200 [thread overview]
Message-ID: <2973c12cb594abeecc60.1318932277@devws108> (raw)
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>
---
fs/skeleton/etc/profile | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/skeleton/etc/profile b/fs/skeleton/etc/profile
--- 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
next reply other threads:[~2011-10-19 7:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-19 7:36 Thomas De Schampheleire [this message]
2011-10-28 9:41 ` [Buildroot] [PATCH] /etc/profile: read in /etc/profile.d/*.sh files Thomas De Schampheleire
2011-10-28 12:59 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2973c12cb594abeecc60.1318932277@devws108 \
--to=patrickdepinguin+buildroot@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.