]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Bashpromt erweitert und FTP Upload wieder funktionierend gemacht...
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Thu, 25 Jan 2007 19:04:11 +0000 (19:04 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Thu, 25 Jan 2007 19:04:11 +0000 (19:04 +0000)
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@397 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

16 files changed:
config/etc/bashrc [new file with mode: 0644]
config/etc/profile
config/profile.d/dircolors.sh [new file with mode: 0644]
config/profile.d/extra-promt.sh [new file with mode: 0644]
config/profile.d/extrapaths.sh [new file with mode: 0644]
config/profile.d/readline.sh [new file with mode: 0644]
config/profile.d/umask.sh [new file with mode: 0644]
config/rootfiles/common/coreutils
config/rootfiles/common/initscripts
config/rootfiles/common/stage2
lfs/coreutils
lfs/initscripts
lfs/stage2
make.sh
src/initscripts/init.d/random [new file with mode: 0644]
tools/make-functions

diff --git a/config/etc/bashrc b/config/etc/bashrc
new file mode 100644 (file)
index 0000000..e54dc86
--- /dev/null
@@ -0,0 +1,32 @@
+# 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
index 6804fc42fc13a304e445dca1c89c65594f26387b..49e8678c594b30ea77a25c07e5224253d8583cb5 100644 (file)
@@ -1,49 +1,64 @@
-# /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
diff --git a/config/profile.d/dircolors.sh b/config/profile.d/dircolors.sh
new file mode 100644 (file)
index 0000000..873d91b
--- /dev/null
@@ -0,0 +1,9 @@
+# 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'
diff --git a/config/profile.d/extra-promt.sh b/config/profile.d/extra-promt.sh
new file mode 100644 (file)
index 0000000..bf877dc
--- /dev/null
@@ -0,0 +1,2 @@
+PROMPT_COMMAND='echo -ne "\e[1m${USER}@${HOSTNAME} : ${PWD}\e[0m\a"'
+export PROMPT_COMMAND
diff --git a/config/profile.d/extrapaths.sh b/config/profile.d/extrapaths.sh
new file mode 100644 (file)
index 0000000..bb8f720
--- /dev/null
@@ -0,0 +1,15 @@
+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
diff --git a/config/profile.d/readline.sh b/config/profile.d/readline.sh
new file mode 100644 (file)
index 0000000..816d7c1
--- /dev/null
@@ -0,0 +1,5 @@
+# Setup the INPUTRC environment variable.
+if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
+        INPUTRC=/etc/inputrc
+fi
+export INPUTRC
diff --git a/config/profile.d/umask.sh b/config/profile.d/umask.sh
new file mode 100644 (file)
index 0000000..9a3f824
--- /dev/null
@@ -0,0 +1,6 @@
+# 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
index d66701c31a12dcce554a0fbce900c99d571e8b44..bfd47de10899e8c45250f9d09ae0ed6698f3f9b1 100644 (file)
@@ -22,6 +22,7 @@ bin/sync
 bin/true
 #bin/uname
 bin/uname.bak
+etc/dircolors
 usr/bin/[
 usr/bin/basename
 #usr/bin/cksum
index c0e7129e9d86e4f46e48e97b186922b2a2c3b793..52b00b42794c1dff971eaab1bb40611386b80637 100644 (file)
@@ -18,6 +18,7 @@ etc/rc.d/init.d/modules
 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
@@ -34,6 +35,7 @@ etc/rc.d/init.d/udev_retry
 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
@@ -44,6 +46,7 @@ etc/rc.d/rc0.d/S99halt
 #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
@@ -51,6 +54,7 @@ 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
index d74a54623840f4794bcd595db637a428b74cb943..a4b8914d23ccf2fe1c09f04c9af03d3cb7466b63 100644 (file)
@@ -6,6 +6,7 @@ bin/stty
 #boot
 dev/null
 dev/console
+etc/bashrc
 etc/certparams
 etc/fstab
 etc/group
@@ -23,6 +24,11 @@ etc/nsswitch.conf
 #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
index 5c0284c7ed1305c2460e65f5230111515e20892e..db1eb15db16489dd1891a1a6a8c7ed776f31fd37 100644 (file)
@@ -109,6 +109,7 @@ ifeq "$(ROOT)" ""
        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
index 3d89d52021973d478556691e6ac528ca1e5f7c8e..570a181079faed3f4adac46743fa67e77978c157 100644 (file)
@@ -97,6 +97,9 @@ $(TARGET) :
        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
index 623467c73bb43bb12d16450c846c4cf809a89fae..49747d51aa7f1baa247299f316b445df834dc085 100644 (file)
@@ -79,6 +79,11 @@ $(TARGET) :
        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 \
diff --git a/make.sh b/make.sh
index 4119f6e248a2722753bc43aef841402451dc919d..02d2a776e2cd03205f01035f47f486918fafc486 100644 (file)
--- a/make.sh
+++ b/make.sh
@@ -917,13 +917,13 @@ uploadsrc)
        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
@@ -932,15 +932,6 @@ uploadsrc)
                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
        ;;
@@ -956,10 +947,10 @@ EOF
                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
@@ -967,7 +958,7 @@ EOF
                        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)
diff --git a/src/initscripts/init.d/random b/src/initscripts/init.d/random
new file mode 100644 (file)
index 0000000..26c64e3
--- /dev/null
@@ -0,0 +1,35 @@
+#!/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
index c288f71c934cc5d18f7a314eb0d00573789d827f..f3ce22007b18fbf41730beec18d808c4a9b4db11 100644 (file)
@@ -123,7 +123,7 @@ beautify()
                        ;;
                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