diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 4f4e93361f..107d53e74f 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -72,6 +72,7 @@ define Package/base-files/conffiles /etc/services /etc/shadow /etc/shells +/etc/shinit /etc/sysctl.conf /etc/sysupgrade.conf $(call $(TARGET)/conffiles) diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile index 9a3ac069a2..0beff1608f 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -1,4 +1,3 @@ -#!/bin/sh [ -e /tmp/.failsafe ] && export FAILSAFE=1 [ -f /etc/banner ] && cat /etc/banner @@ -13,6 +12,7 @@ export PATH="%PATH%" export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) export HOME=${HOME:-/root} export PS1='\u@\h:\w\$ ' +export ENV=/etc/shinit case "$TERM" in xterm*|rxvt*) @@ -20,16 +20,6 @@ case "$TERM" in ;; esac -[ -x /bin/more ] || alias more=less -[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi - -alias ll='ls -alF --color=auto' - -[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc - -[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; } -[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } - [ -n "$FAILSAFE" ] || { for FILE in /etc/profile.d/*.sh; do [ -e "$FILE" ] && . "$FILE" @@ -48,12 +38,3 @@ in order to prevent unauthorized SSH logins. -------------------------------------------------- EOF fi - -service() { - [ -f "/etc/init.d/$1" ] || { - echo "service "'"'"$1"'"'" not found, the following services are available:" - ls "/etc/init.d" - return 1 - } - /etc/init.d/$@ -} diff --git a/package/base-files/files/etc/shinit b/package/base-files/files/etc/shinit new file mode 100644 index 0000000000..6b715c1ef9 --- /dev/null +++ b/package/base-files/files/etc/shinit @@ -0,0 +1,21 @@ +[ -x /bin/more ] || alias more=less +[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi + +alias ll='ls -alF --color=auto' + +[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc + +[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; } +[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } + +service() { + [ -f "/etc/init.d/$1" ] || { + echo "service "'"'"$1"'"'" not found, the following services are available:" + ls "/etc/init.d" + return 1 + } + /etc/init.d/$@ +} + +[ -n "$KSH_VERSION" -o \! -s "$HOME/.shinit" ] || . "$HOME/.shinit" +[ -z "$KSH_VERSION" -o \! -s "$HOME/.mkshrc" ] || . "$HOME/.mkshrc" diff --git a/package/base-files/files/lib/upgrade/keep.d/base-files-essential b/package/base-files/files/lib/upgrade/keep.d/base-files-essential index 978d4b58bc..7a7a253466 100644 --- a/package/base-files/files/lib/upgrade/keep.d/base-files-essential +++ b/package/base-files/files/lib/upgrade/keep.d/base-files-essential @@ -6,5 +6,6 @@ /etc/profile /etc/shadow /etc/shells +/etc/shinit /etc/sysctl.conf /etc/rc.local