cvs commit: LFS/bootscripts/lfs/init.d console swap

winkie at linuxfromscratch.org winkie at linuxfromscratch.org
Wed May 12 13:59:53 PDT 2004


winkie      04/05/12 14:59:53

  Modified:    bootscripts/lfs/init.d console swap
  Log:
  Fixed console script to not be broken
  
  Revision  Changes    Path
  1.4       +11 -15    LFS/bootscripts/lfs/init.d/console
  
  Index: console
  ===================================================================
  RCS file: /home/cvsroot/LFS/bootscripts/lfs/init.d/console,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- console	4 May 2004 08:26:07 -0000	1.3
  +++ console	12 May 2004 20:59:53 -0000	1.4
  @@ -9,35 +9,31 @@
   . $rc_functions
   
   # Native English speakers probably don't have /etc/sysconfig/console at all
  -
  +if [ -f /etc/sysconfig/console ]; then
  +	. /etc/sysconfig/console
  +else
  +	exit 0
  +fi
   
   case "$1" in
   	start)
  -		if [ ! -f /etc/sysconfig/console ]
  -		then
  -			exit 0
  -		fi
  -		. /etc/sysconfig/console
  -
  -		if [ ! -z "$KEYMAP" ]
  -		then
  +		if [ -n "$KEYMAP" ]; then
   			echo -n "Loading keymap..."
   			loadkeys $KEYMAP
   			evaluate_retval
   		fi
  -		if [ ! -z "$KEYMAP_ CORRECTIONS" ]
  -		then
  +
  +		if [ -n "$KEYMAP_CORRECTIONS" ]; then
   			echo -n "Correcting keymap..."
  -			loadkeys $KEYMAP_CORRECTION
  +			loadkeys $KEYMAP_CORRECTIONS
   			evaluate_retval
   		fi
  -		if [ ! -z "$FONT" ]
  -		then
  +
  +		if [ -n "$FONT" ]; then
   			echo -n "Setting screen font..."
   			setfont $FONT
   			evaluate_retval
   		fi
  -
   		;;
   	*)
   		echo "Usage: $0 {start}"
  
  
  
  1.2       +16 -0     LFS/bootscripts/lfs/init.d/swap
  
  Index: swap
  ===================================================================
  RCS file: /home/cvsroot/LFS/bootscripts/lfs/init.d/swap,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- swap	17 Mar 2004 22:24:23 -0000	1.1
  +++ swap	12 May 2004 20:59:53 -0000	1.2
  @@ -6,6 +6,22 @@
   . /etc/sysconfig/rc
   . $rc_functions
   
  +# Parse fstab.
  +exec 9>&0 < /etc/fstab
  +	while read fs mnt type opts dump pass junk; do
  +		# Ignore comments and blank lines.
  +		case "$fs" in
  +			""|\#*) continue ;;
  +		esac
  +
  +		# Set do_swap if there is swap found.
  +		[ "$type" = swap ] && do_swap=yes
  +	done
  +exec 0>&9 9>&-
  +
  +# If there's no swap found, exit.
  +[ "$do_swap" ] || exit 0
  +
   case "$1" in
   	start)
   		echo "Activating all swap files/partitions..."
  
  
  



More information about the lfs-book mailing list