--- /dev/null
+# Begin /etc/bashrc
+# Written for Beyond Linux From Scratch
+# by James Robertson <jameswrobertson@earthlink.net>
+# updated by Bruce Dubbs <bdubbs@linuxfromscratch.org>
+
+# 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.
+
+# System wide environment variables and startup programs should go into
+# /etc/profile. Personal environment variables and startup programs
+# should go into ~/.bash_profile. Personal aliases and functions should
+# go into ~/.bashrc
+
+# Provides a colored /bin/ls command. Used in conjunction with code in
+# /etc/profile.
+
+alias ls='ls --color=auto'
+
+# Provides prompt for non-login shells, specifically shells started
+# in the X environment. [Review the LFS archive thread titled
+# PS1 Environment Variable for a great case study behind this script
+# addendum.]
+
+#export PS1="[\u@\h \w]\\$ "
+export PS1='\u@\h:\w\$ '
+
+# End /etc/bashrc
-# /etc/bashrc
-
-umask 022
-unset i
-
-# are we an interactive shell?
-if [ "$PS1" ]; then
- if [ -x /usr/bin/tput ]; then
- if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
- stty erase `tput kbs`
- elif [ -x /usr/bin/wc ]; then
- if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal
- stty erase `tput kbs`
- fi
- fi
- fi
-fi
+# Begin /etc/profile
+# Written for Beyond Linux From Scratch
+# by James Robertson <jameswrobertson@earthlink.net>
+# modifications by Dagmar d'Surreal <rivyqntzne@pbzpnfg.arg>
+
+# System wide environment variables and startup programs.
-# Path manipulation
-PATH="/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin"
+# System wide aliases and functions should go in /etc/bashrc. Personal
+# environment variables and startup programs should go into
+# ~/.bash_profile. Personal aliases and functions should go into
+# ~/.bashrc.
-# No core files by default
-ulimit -S -c 0 > /dev/null 2>&1
+# Functions to help us manage paths. Second argument is the name of the
+# path variable to be modified (default: PATH)
+pathremove () {
+ local IFS=':'
+ local NEWPATH
+ local DIR
+ local PATHVARIABLE=${2:-PATH}
+ for DIR in ${!PATHVARIABLE} ; do
+ if [ "$DIR" != "$1" ] ; then
+ NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
+ fi
+ done
+ export $PATHVARIABLE="$NEWPATH"
+}
-USER=`id -un`
-LOGNAME=$USER
+pathprepend () {
+ pathremove $1 $2
+ local PATHVARIABLE=${2:-PATH}
+ export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
+}
-HOSTNAME=`/bin/hostname`
-HISTSIZE=250
+pathappend () {
+ pathremove $1 $2
+ local PATHVARIABLE=${2:-PATH}
+ export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
+}
-if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
- INPUTRC=/etc/inputrc
+
+# Set the initial path
+export PATH=/bin:/usr/bin
+
+if [ $EUID -eq 0 ] ; then
+ pathappend /sbin:/usr/sbin
+ unset HISTFILE
fi
-export PATH USER LOGNAME HOSTNAME HISTSIZE INPUTRC
+# Setup some environment variables.
+export HISTSIZE=1000
+export HISTIGNORE="&:[bf]g:exit"
+#export PS1="[\u@\h \w]\\$ "
+export PS1='\u@\h:\w\$ '
-# LS Colors
-alias dir='ls'
-alias ll='ls -l --color=tty'
-alias ls='ls --color=tty'
+for script in /etc/profile.d/*.sh ; do
+ if [ -r $script ] ; then
+ . $script
+ fi
+done
-# IPFire language settings
-LANG=en_US.utf8
-PS1='\[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;31m\]\w \[\033[1;36m\]\$ \[\033[0m\]'
-echo -n -e '\033%G'
+# Now to clean up
+unset pathremove pathprepend pathappend
-export LANG PS1
-export TERM=linux
-export COLORTERM=1
+# End /etc/profile
--- /dev/null
+# Setup for /bin/ls to support color, the alias is in /etc/bashrc.
+if [ -f "/etc/dircolors" ] ; then
+ eval $(dircolors -b /etc/dircolors)
+
+ if [ -f "$HOME/.dircolors" ] ; then
+ eval $(dircolors -b $HOME/.dircolors)
+ fi
+fi
+alias ls='ls --color=auto'
--- /dev/null
+PROMPT_COMMAND='echo -ne "\e[1m${USER}@${HOSTNAME} : ${PWD}\e[0m\a"'
+export PROMPT_COMMAND
--- /dev/null
+if [ -d /usr/local/bin ]; then
+ pathprepend /usr/local/bin
+fi
+if [ -d /usr/local/sbin -a $EUID -eq 0 ]; then
+ pathprepend /usr/local/sbin
+fi
+for directory in $(find /opt/*/bin -type d 2>/dev/null); do
+ pathappend $directory
+done
+if [ -d ~/bin ]; then
+ pathprepend ~/bin
+fi
+#if [ $EUID -gt 99 ]; then
+# pathappend .
+#fi
--- /dev/null
+# Setup the INPUTRC environment variable.
+if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
+ INPUTRC=/etc/inputrc
+fi
+export INPUTRC
--- /dev/null
+# By default we want the umask to get set.
+if [ "$(id -gn)" = "$(id -un)" -a $EUID -gt 99 ] ; then
+ umask 002
+else
+ umask 022
+fi
bin/true
#bin/uname
bin/uname.bak
+etc/dircolors
usr/bin/[
usr/bin/basename
#usr/bin/cksum
etc/rc.d/init.d/mountfs
etc/rc.d/init.d/mountkernfs
etc/rc.d/init.d/network
+etc/rc.d/init.d/random
etc/rc.d/init.d/rc
etc/rc.d/init.d/reboot
etc/rc.d/init.d/red
etc/rc.d/rc0.d/K08fcron
etc/rc.d/rc0.d/K28apache
etc/rc.d/rc0.d/K30sshd
+etc/rc.d/rc0.d/K45random
etc/rc.d/rc0.d/K80network
etc/rc.d/rc0.d/K90sysklogd
etc/rc.d/rc0.d/S60sendsignals
#etc/rc.d/rc3.d
etc/rc.d/rc3.d/S10sysklogd
etc/rc.d/rc3.d/S20network
+etc/rc.d/rc3.d/S25random
etc/rc.d/rc3.d/S30sshd
etc/rc.d/rc3.d/S32apache
etc/rc.d/rc3.d/S40fcron
etc/rc.d/rc6.d/K08fcron
etc/rc.d/rc6.d/K28apache
etc/rc.d/rc6.d/K30sshd
+etc/rc.d/rc6.d/K45random
etc/rc.d/rc6.d/K80network
etc/rc.d/rc6.d/K90sysklogd
etc/rc.d/rc6.d/S60sendsignals
#boot
dev/null
dev/console
+etc/bashrc
etc/certparams
etc/fstab
etc/group
#etc/opt
etc/passwd
etc/profile
+etc/profile.d/dircolors.sh
+etc/profile.d/extra-promt.sh
+etc/profile.d/extrapaths.sh
+etc/profile.d/readline.sh
+etc/profile.d/umask.sh
etc/resolv.conf
etc/securetty
etc/sysctl.conf
echo '#!/bin/bash' > /bin/uname
echo '/bin/uname.bak $$* | sed 's/i.86/$(MACHINE)/g'' >> /bin/uname
chmod 755 /bin/uname
+ dircolors -p > /etc/dircolors
else
rm /tools/bin/hostname
mv -f /tools/bin/uname /tools/bin/uname.bak
ln -sf ../init.d/network /etc/rc.d/rc0.d/K80network
ln -sf ../init.d/network /etc/rc.d/rc3.d/S20network
ln -sf ../init.d/network /etc/rc.d/rc6.d/K80network
+ ln -sf ../init.d/random /etc/rc.d/rc0.d/K45random
+ ln -sf ../init.d/random /etc/rc.d/rc3.d/S25random
+ ln -sf ../init.d/random /etc/rc.d/rc6.d/K45random
ln -sf ../init.d/mountkernfs /etc/rc.d/rcsysinit.d/S00mountkernfs
ln -sf ../init.d/modules /etc/rc.d/rcsysinit.d/S05modules
echo "===============================" >> /etc/issue
echo "\n running on \s \r \m" >> /etc/issue
+ # Bash startup files
+ install --directory --mode=0755 --owner=root --group=root /etc/profile.d
+ for i in $(DIR_SRC)/config/profile.d/*; do \
+ [ -f $$i ] && cp $$i /etc/profile.d; \
+ done
# Scripts
for i in `find $(DIR_SRC)/src/scripts -maxdepth 1 -type f`; do \
PWD=`pwd`
cd $BASEDIR/cache/
echo -e "Uploading cache to ftp server:"
- ncftpls -u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT ftp://$IPFIRE_FTP_URL_INT$IPFIRE_FTP_PATH_INT/ > /var/tmp/ftplist
+ ncftpls -u $FTP_CACHE_USER -p $FTP_CACHE_PASS ftp://$FTP_CACHE_URL$FTP_CACHE_PATH/ > /var/tmp/ftplist
for i in *; do
if [ "$i" == "toolchains" ]; then continue; fi
grep -q $i /var/tmp/ftplist
if [ "$?" -ne "0" ]; then
echo -ne "$i"
- ncftpput -bb -u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT $IPFIRE_FTP_URL_INT $IPFIRE_FTP_PATH_INT/ $i >> $BASEDIR/log/_build.uploadsrc.log 2>&1
+ ncftpput -u $FTP_CACHE_USER -p $FTP_CACHE_PASS $FTP_CACHE_URL $FTP_CACHE_PATH/ $i
if [ "$?" -eq "0" ]; then
beautify message DONE
else
fi
done
rm -f /var/tmp/ftplist
- UL_TIME_START=`date +'%s'`
- ncftpbatch -d > /dev/null 2>&1
- while ps acx | grep -q ncftpbatch
- do
- UL_TIME=$(expr `date +'%s'` - $UL_TIME_START)
- echo -ne "\r ${UL_TIME}s : Upload is running..."
- sleep 1
- done
- beautify message DONE
cd $PWD
exit 0
;;
ncftp -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT < .ftp-commands
rm -f .ftp-commands
md5sum ipfire-install-$VERSION.i386.iso > ipfire-install-$VERSION.i386.iso.md5
- ncftpput -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-install-$VERSION.i386.iso
- ncftpput -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-install-$VERSION.i386.iso.md5
- ncftpput -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-source-r$SVN_REVISION.tar.gz
- ncftpput -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ svn_status
+ ncftpput -u $FTP_ISO_USER -p $FTP_ISO_PASS $FTP_ISO_URL $FTP_ISO_PATH/ ipfire-install-$VERSION.i386.iso
+ ncftpput -u $FTP_ISO_USER -p $FTP_ISO_PASS $FTP_ISO_URL $FTP_ISO_PATH/ ipfire-install-$VERSION.i386.iso.md5
+ ncftpput -u $FTP_ISO_USER -p $FTP_ISO_PASS $FTP_ISO_URL $FTP_ISO_PATH/ ipfire-source-r$SVN_REVISION.tar.gz
+ ncftpput -u $FTP_ISO_USER -p $FTP_ISO_PASS $FTP_ISO_URL $FTP_ISO_PATH/ svn_status
if [ "$?" -eq "0" ]; then
echo -e "The iso of Revision $SVN_REVISION was successfully uploaded to $IPFIRE_FTP_URL_EXT$IPFIRE_FTP_PATH_EXT/."
else
exit 1
fi
if [ "$3" = "--with-sources-cd" ]; then
- ncftpput -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-sources-cd-$VERSION.$MACHINE.iso
+ ncftpput -u $FTP_ISO_USER -p $FTP_ISO_PASS $FTP_ISO_URL $FTP_ISO_PATH/ ipfire-sources-cd-$VERSION.$MACHINE.iso
fi
;;
paks)
--- /dev/null
+#!/bin/sh
+# Begin $rc_base/init.d/random
+
+# Based on sysklogd script from LFS-3.1 and earlier.
+# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
+# Random script elements by Larry Lawrence
+
+. /etc/sysconfig/rc
+. $rc_functions
+
+case "$1" in
+ start)
+ boot_mesg "Initializing kernel random number generator..."
+ if [ -f /var/tmp/random-seed ]; then
+ /bin/cat /var/tmp/random-seed >/dev/urandom
+ fi
+ /bin/dd if=/dev/urandom of=/var/tmp/random-seed \
+ count=1 &>/dev/null
+ evaluate_retval
+ ;;
+
+ stop)
+ boot_mesg "Saving random seed..."
+ /bin/dd if=/dev/urandom of=/var/tmp/random-seed \
+ count=1 &>/dev/null
+ evaluate_retval
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/random
;;
build_end)
BUILD_TIME_END=`date +%s`
- echo -ne "${BOLD}***Build is finished now!\nThis took:\t\t\t $[ $BUILD_TIME_END - $BUILD_TIME_START ] (secs)${NORMAL}\n"
+ echo -ne "${DONE}***Build is finished now and took $[ $BUILD_TIME_END - $BUILD_TIME_START ] secs!${NORMAL}\n"
;;
make_pkg)
echo "$2" | while read PKG_VER PROGRAM OPTIONS