ppcrcd/trunk/conf.dir/usr/lib/ppcrcd: hw-detect rc.live

sparky cvs at pld-linux.org
Fri Mar 3 01:30:27 CET 2006


Author: sparky
Date: Fri Mar  3 01:30:21 2006
New Revision: 7073

Modified:
   ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/hw-detect
   ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/rc.live
Log:
- add swap option support


Modified: ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/hw-detect
==============================================================================
--- ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/hw-detect	(original)
+++ ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/hw-detect	Fri Mar  3 01:30:21 2006
@@ -47,13 +47,13 @@
 [ -n "$cddevs" ] && cddevs=$(lastlink $cddevs)
 cddevs=" $cddevs "
 
-for cdrom in /dev/{dvd,cdwriter,cdrom} /dev/{dvd,cdwriter,cdrom}*; do
-	verbose 4 " +-Checking cdrom: $cdrom"
+for cdrom in /dev/{dvdrw,dvd,cdwriter,cdrom} /dev/{dvdrw,dvd,cdwriter,cdrom}*; do
+	verbose 5 " (Checking cdrom: $cdrom)"
 	[ -r $cdrom ] || continue
 	cddev=$(lastlink $cdrom)
 	echo "$cddevs" | grep -q " $cddev " && continue
 	cddevs="$cddevs $cddev "
-	verbose 4 "    +-Found cdrom: $cdrom"
+	verbose 4 " +-Found cdrom: $cdrom"
 	echo "$cdrom /media/$(basename $cdrom) iso9660,udf,hfsplus,hfs defaults,ro,user,noauto" \
 																>> /etc/fstab
 	mkdir -p /media/$(basename $cdrom)
@@ -80,8 +80,13 @@
 				;;
 			*linux*swap)
 				mnt=
-				echo "#$dev swap swap defaults 0 0" >> /etc/fstab
-				verbose 4 "type: swap (not activating)"
+				if [[ -e /tmp/swapon ]]; then
+					echo "$dev swap swap defaults 0 0" >> /etc/fstab
+					verbose 4 "type: swap (activating)"
+				else
+					echo "#$dev swap swap defaults 0 0" >> /etc/fstab
+					verbose 4 "type: swap (not activating)"
+				fi
 				;;
 			*linux*raid*|*linux*lvm*|*linux*plaintext*)
 				mnt=
@@ -135,8 +140,13 @@
 		case "$(tl $type)" in
 			*linux*swap*)
 				mnt=
-				echo "#$dev swap swap defaults 0 0" >> /etc/fstab
-				verbose 4 "type: swap (not activating)"
+				if [[ -e /tmp/swapon ]]; then
+					echo "$dev swap swap defaults 0 0" >> /etc/fstab
+					verbose 4 "type: swap (activating)"
+				else
+					echo "#$dev swap swap defaults 0 0" >> /etc/fstab
+					verbose 4 "type: swap (not activating)"
+				fi
 				;;
 			*linux*)
 				echo "$dev $mnt auto defaults,noauto,noatime 0 0" >> /etc/fstab

Modified: ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/rc.live
==============================================================================
--- ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/rc.live	(original)
+++ ppcrcd/trunk/conf.dir/usr/lib/ppcrcd/rc.live	Fri Mar  3 01:30:21 2006
@@ -50,28 +50,33 @@
 sh $SHD /usr/lib/ppcrcd/load-conf
 CONF_LOADED=$?
 
+### swap #####################################################################
+if cmdopt swap || { ! cmdopt nonvswap && nvopt swap}; then
+	swap=$(cmdvar "swap")
+	if [ -z "$swap" ]; then
+		swap=$(nvvar swap)
+	fi
+	if [ -z "$swap" ]; then
+		touch /tmp/swapon
+	else
+		for DEV in $(echo $swap | tr "," " " ); do
+			[[ $DEV == /dev/* ]] || DEV="/dev/$DEV"
+			echo "$DEV swap swap defaults 0 0" >> /etc/fstab
+		done
+	fi
+fi
 
-### net-detect ###############################################################
-sh $SHD /usr/lib/ppcrcd/net-detect
 
+### hw/net-detect ############################################################
 cmdopt nodetect || ( \
 	[ "$CONF_LOADED" -ne 0 ] && \
 		sh $SHD /usr/lib/ppcrcd/hw-detect )
 		
+sh $SHD /usr/lib/ppcrcd/net-detect
+
 cmdopt nonet && \
 	sed -i -e 's/ONBOOT=.*/ONBOOT=no/' /etc/sysconfig/interfaces/ifcfg-*
 
-
-### swap #####################################################################
-swap=$(cmdvar "swap")
-if [ -z "$swap" ]; then
-	cmdopt nonvswap || swap=$(nvvar swap)
-fi
-if [ -n "$swap" ]; then
-	echo "######### !!!!!!!!!!!!!!!!!!!!!!!!!!!! TODO"
-fi
-
-
 ### modules ##################################################################
 modules=$(cmdvar "modules")
 if [ -z "$modules" ]; then


More information about the pld-cvs-commit mailing list