Browse Source

- rootfs: change profile handling

master
vanhofen 4 years ago
parent
commit
4b6793d374
  1. 11
      make/target-files.mk
  2. 27
      skel-root/general/files-etc/profile
  3. 7
      skel-root/general/files-etc/profile.d/alias.sh
  4. 1
      skel-root/general/files-etc/profile.d/term.sh

11
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 $(@)

27
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

7
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'

1
skel-root/general/files-etc/profile.d/term.sh

@ -0,0 +1 @@
export TERM=xterm
Loading…
Cancel
Save