diff --git a/make/target-files.mk b/make/target-files.mk index 6f85813f..c7016cd7 100644 --- a/make/target-files.mk +++ b/make/target-files.mk @@ -19,6 +19,7 @@ files-etc: \ $(TARGET_sysconfdir)/passwd \ $(TARGET_sysconfdir)/profile \ $(TARGET_sysconfdir)/profile.local \ + $(TARGET_sysconfdir)/profile.d \ $(TARGET_sysconfdir)/protocols \ $(TARGET_sysconfdir)/services @@ -66,9 +67,6 @@ $(TARGET_sysconfdir)/issue.net: $(TARGET_sysconfdir)/nsswitch.conf: $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/nsswitch.conf $(@) -$(TARGET_sysconfdir)/profile: - $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/profile $(@) - $(TARGET_sysconfdir)/passwd: ifeq ($(PERSISTENT_VAR_PARTITION),yes) $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/passwd $(TARGET_localstatedir)/etc/passwd @@ -76,6 +74,9 @@ else $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/passwd $(@) endif +$(TARGET_sysconfdir)/profile: + $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/profile $(@) + $(TARGET_sysconfdir)/profile.local: ifeq ($(PERSISTENT_VAR_PARTITION),yes) $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/profile.local-var $(TARGET_localstatedir)/etc/profile.local @@ -83,6 +84,10 @@ else $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/profile.local $(@) endif +$(TARGET_sysconfdir)/profile.d: + $(foreach p,$(wildcard $(TARGET_FILES)/files-etc/profile.d/*.sh),\ + $(shell $(INSTALL_DATA) -D $(p) $(TARGET_sysconfdir)/profile.d/$(notdir $(p)))) + $(TARGET_sysconfdir)/services: $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/services $(@) diff --git a/skel-root/general/files-etc/profile b/skel-root/general/files-etc/profile index 013dd082..4ad87bdf 100644 --- a/skel-root/general/files-etc/profile +++ b/skel-root/general/files-etc/profile @@ -7,17 +7,22 @@ if [ -d "/usr/local/bin" ]; then PATH="/usr/local/bin:$PATH" fi -TERM=linux - -PS1='[\h] \w \$ ' +if [ -z "$PS1" ]; then + if [ "`id -u`" -eq 0 ]; then + PS1='[\h] \w \# ' + else + PS1='[\h] \w \$ ' + fi +fi -alias l='ls -al' -alias ll='ls -l' -alias dir='ls -lA' -alias ..='cd ..' -alias mc='mc -a' -alias sc='setconsole' -alias sr='setconsole -r' +if [ -d /etc/profile.d ]; then + for i in /etc/profile.d/*.sh; do + if [ -f $i -a -r $i ]; then + . $i + fi + done + unset i +fi # add user's private modifications if it exists if [ -e /var/etc/profile.local ]; then @@ -25,3 +30,5 @@ if [ -e /var/etc/profile.local ]; then elif [ -e /etc/profile.local ]; then . /etc/profile.local fi + +export PATH PS1 diff --git a/skel-root/general/files-etc/profile.d/alias.sh b/skel-root/general/files-etc/profile.d/alias.sh new file mode 100644 index 00000000..1265e001 --- /dev/null +++ b/skel-root/general/files-etc/profile.d/alias.sh @@ -0,0 +1,7 @@ +alias l='ls -al' +alias ll='ls -l' +alias dir='ls -lA' +alias ..='cd ..' +alias mc='mc -a' +alias sc='setconsole' +alias sr='setconsole -r' diff --git a/skel-root/general/files-etc/profile.d/term.sh b/skel-root/general/files-etc/profile.d/term.sh new file mode 100644 index 00000000..fda1752c --- /dev/null +++ b/skel-root/general/files-etc/profile.d/term.sh @@ -0,0 +1 @@ +export TERM=xterm