From: Michael Tremer Date: Mon, 2 Feb 2009 16:40:05 +0000 (+0100) Subject: Updated bash login stuff. X-Git-Tag: v3.0-alpha1~44^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da5e21dce7278488dc5832ac3588835c26db8237;p=ipfire-3.x.git Updated bash login stuff. Added system-release file. --- diff --git a/config/etc/bashrc b/config/etc/bashrc index e35209f33..dce7184d9 100644 --- a/config/etc/bashrc +++ b/config/etc/bashrc @@ -1,13 +1,4 @@ # Begin /etc/bashrc -# Written for Beyond Linux From Scratch -# by James Robertson -# updated by Bruce Dubbs - -# Make sure that the terminal is set up properly for each shell - -if [ -f /etc/profile.d/tinker-term.sh ]; then - source /etc/profile.d/tinker-term.sh -fi # System wide aliases and functions. @@ -20,19 +11,6 @@ fi # /etc/profile. alias ls='ls --color=auto' -alias ll='ls -la' -alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' - -# Make the shell a little bit more interactive -# to prevent the deletion of some files -alias mv='mv -i' -alias rm='rm -i' -alias cp='cp -i' - -# Midnight Commander isn't compatible to UTF8. -# So we use it in ACSII-Mode. - -alias mc='mc -a' # Provides prompt for non-login shells, specifically shells started # in the X environment. [Review the LFS archive thread titled diff --git a/config/etc/profile b/config/etc/profile index 3c2921908..70ff901bb 100644 --- a/config/etc/profile +++ b/config/etc/profile @@ -1,7 +1,4 @@ # Begin /etc/profile -# Written for Beyond Linux From Scratch -# by James Robertson -# modifications by Dagmar d'Surreal # System wide environment variables and startup programs. @@ -49,6 +46,7 @@ fi # Setup some environment variables. export HISTSIZE=1000 export HISTIGNORE="&:[bf]g:exit" + export PS1="[\u@\h \w]\\$ " #export PS1='\u@\h:\w\$ ' diff --git a/config/profile.d/i18n.sh b/config/profile.d/i18n.sh index ac68d6782..2f66e89c3 100644 --- a/config/profile.d/i18n.sh +++ b/config/profile.d/i18n.sh @@ -1,2 +1,10 @@ # Set up i18n variables -export LANG=en_US.utf8 + +if [ -f "/etc/sysconfig/console" ]; then + . /etc/sysconfig/console +else + LANG=en_US.UTF-8 +fi + +unset KEYMAP FONT UNICODE KEYMAP_CORRECTIONS LEGACY_CHARSET +export LANG diff --git a/config/root/.bash_logout b/config/root/.bash_logout new file mode 100644 index 000000000..3762d94b5 --- /dev/null +++ b/config/root/.bash_logout @@ -0,0 +1,7 @@ +# Begin ~/.bash_logout + +# Personal items to perform on logout. + +echo "Bye bye." + +# End ~/.bash_logout diff --git a/config/root/.bash_profile b/config/root/.bash_profile new file mode 100644 index 000000000..8201233b8 --- /dev/null +++ b/config/root/.bash_profile @@ -0,0 +1,33 @@ +# Begin ~/.bash_profile + +# Personal environment variables and startup programs. + +# Personal aliases and functions should go in ~/.bashrc. System wide +# environment variables and startup programs are in /etc/profile. +# System wide aliases and functions are in /etc/bashrc. + +append () { + # First remove the directory + local IFS=':' + local NEWPATH + for DIR in $PATH; do + if [ "$DIR" != "$1" ]; then + NEWPATH=${NEWPATH:+$NEWPATH:}$DIR + fi + done + + # Then append the directory + export PATH=$NEWPATH:$1 +} + +if [ -f "$HOME/.bashrc" ] ; then + source $HOME/.bashrc +fi + +if [ -d "$HOME/bin" ] ; then + append $HOME/bin +fi + +unset append + +# End ~/.bash_profile diff --git a/config/root/.bashrc b/config/root/.bashrc new file mode 100644 index 000000000..d89eefd1e --- /dev/null +++ b/config/root/.bashrc @@ -0,0 +1,14 @@ +# Begin ~/.bashrc + +# Personal aliases and functions. + +# Personal environment variables and startup programs should go in +# ~/.bash_profile. System wide environment variables and startup +# programs are in /etc/profile. System wide aliases and functions are +# in /etc/bashrc. + +if [ -f "/etc/bashrc" ] ; then + source /etc/bashrc +fi + +# End ~/.bashrc diff --git a/lfs/stage2 b/lfs/stage2 index 7a66e220e..3ae693b56 100644 --- a/lfs/stage2 +++ b/lfs/stage2 @@ -80,7 +80,10 @@ $(OBJECT) : # Config files for i in $(DIR_SRC)/config/etc/*; do \ - [ -f $$i ] && cp $$i /etc; \ + cp -vf $$i /etc; \ + done + for i in $(DIR_CONFIG)/root/*; do \ + cp -vf $$i /root; \ done -mkdir -pv /etc/modprobe.d cp -av $(DIR_CONF)/modprobe.d/* /etc/modprobe.d/ @@ -95,6 +98,7 @@ endif echo "\n running on \s \r \m" >> /etc/issue echo "$(NAME) Release $(VERSION) ($(SLOGAN))" > /etc/$(SNAME)-release + ln -svf $(SNAME)-release /etc/system-release touch /var/run/utmp /var/log/{btmp,lastlog,wtmp} #chgrp -v utmp /var/run/utmp /var/log/lastlog