Update of /cvsroot/devil-linux/build/config/etc/initrd
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17070
Modified Files:
Tag: rel-1-2-patches
linuxrc
Added Files:
Tag: rel-1-2-patches
colordefs
Log Message:
factor out the color definitions and replace the alias beep by a function
Index: linuxrc
===================================================================
RCS file: /cvsroot/devil-linux/build/config/etc/initrd/linuxrc,v
retrieving revision 1.70.2.7
retrieving revision 1.70.2.8
diff -u -d -r1.70.2.7 -r1.70.2.8
--- linuxrc 23 Apr 2006 13:28:53 -0000 1.70.2.7
+++ linuxrc 3 May 2006 17:44:35 -0000 1.70.2.8
@@ -13,14 +13,10 @@
# - starts up the real system
#
-NORMAL="echo -en \\033[0;39m"
-GREEN="echo -en \\033[1;32m"
-YELLOW="echo -en \\033[1;33m"
-RED="echo -en \\033[1;31m"
-BLUE="echo -en \\033[1;34m"
-alias beep='echo -en "\007"'
+export PATH=$PATH:/sbin:/usr/sbin:/
-alias l="ls -la"
+# include our color definitions
+. colordefs
$RED
echo
@@ -33,7 +29,21 @@
echo
$NORMAL
-export PATH=$PATH:/sbin:/usr/sbin
+beep() {
+ # $1 = optional, number of times to beep (default=1)
+ # $2 = optional, sleep that many seconds between beeps (default=1)
+ # $3 = optional, print this with 'echo -n' after each sleep
+ local count=${1:-1}
+ local waitcnt=${2:-1}
+ local string=$3
+
+ while [ $count -gt 0 ]; do
+ echo -en "\007"
+ [ -n "$string" ] && echo -en "$string"
+ let count--
+ [ $count -gt 0 ] && sleep $waitcnt
+ done
+}
scan_devices_for_config() {
# $1 = filename
@@ -132,7 +142,7 @@
* )
$RED
echo -n "Improper config parameter : \"$CONFIG_USER\". Ignored."
- beep; sleep 1; echo -n "."; sleep 1; beep; echo "."
+ beep 2 1 "."
$NORMAL
;;
esac
@@ -231,7 +241,7 @@
umount /floppy # in case user swaps floppy when we are accepting input
# offer to copy the configuration file if device is not a CD
if [ ! "${CFG_SRC##/*/}" = "cd" ];then
- beep;
+ beep
$YELLOW
echo -e "\n*** Found empty configuration media - $CFG_SRC. ***"
$NORMAL
@@ -259,7 +269,7 @@
fi
done
- beep; sleep 1; beep; sleep 1; beep;
+ beep 3
$RED
echo -e "Would you really like to load DL without Configuration Media?"
$NORMAL
@@ -338,7 +348,7 @@
echo "* *"
echo "* !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! *"
echo "********************************************************************************"
- beep; sleep 1; beep; sleep 1; beep; sleep 1; beep; sleep 1; beep; sleep 1; beep;
+ beep 6
$NORMAL
echo
echo -n "Do you want to continue? "
--- NEW FILE: colordefs ---
#!/bin/sh
# $Id: colordefs,v 1.1.2.1 2006/05/03 17:44:35 friedl Exp $
#
# $Source: /cvsroot/devil-linux/build/config/etc/initrd/Attic/colordefs,v $
# $Revision: 1.1.2.1 $
# $Date: 2006/05/03 17:44:35 $
#
# http://www.devil-linux.org
#
# color definitions for use by initrd script
#
NORMAL="echo -en \\033[0;39m"
GREEN="echo -en \\033[1;32m"
YELLOW="echo -en \\033[1;33m"
RED="echo -en \\033[1;31m"
BLUE="echo -en \\033[1;34m"
|