r1429 - trunk/scripts

alexander at linuxfromscratch.org alexander at linuxfromscratch.org
Wed Mar 1 06:54:02 PST 2006


Author: alexander
Date: 2006-03-01 07:54:01 -0700 (Wed, 01 Mar 2006)
New Revision: 1429

Modified:
   trunk/scripts/net-setup
Log:
Fixed some net-setup bugs:

1) Swapped configurators for dialup and gprs
2) The official name for our "setting" is "profile"
3) Wrong ppp module loaded for pppoe connections
4) Password is set for dialup, even if it applies to pppoe connections
5) Password entry field misplaced for pppoe



Modified: trunk/scripts/net-setup
===================================================================
--- trunk/scripts/net-setup	2006-03-01 13:23:04 UTC (rev 1428)
+++ trunk/scripts/net-setup	2006-03-01 14:54:01 UTC (rev 1429)
@@ -105,7 +105,7 @@
         if [ -z "$ERRMSG" ] ; then
                 F_DEVICE=/dev/ttyS1
                 F_SPEED=115200
-		F_SETTING=1
+		F_PROFILE=1
         fi
 
         DLG_COMMAND="dialog --title \"GPRS Device Configuration\" --no-cancel \
@@ -113,18 +113,18 @@
         \"APN:\" 1 1 \"$F_APN\" 1 25 30 0 \
         \"Device:\" 2 1 \"$F_DEVICE\" 2 25 20 0 \
         \"Speed:\" 3 1 \"$F_SPEED\" 3 25 10 0 \
-	\"Setting Number:\" 4 1 \"$F_SETTING\" 4 25 4 0"
+	\"Profile Number:\" 4 1 \"$F_PROFILE\" 4 25 4 0"
         SELECTION=`eval $DLG_COMMAND 3>&2 2>&1 1>&3`
 
 	[ $? -eq 0 ] || exit 1
 
-	unset F_APN F_DEVICE F_SPEED F_SETTING
+	unset F_APN F_DEVICE F_SPEED F_PROFILE
         eval "`echo "$SELECTION" | sed -e '1s,^,F_APN=",' -e '2s,^,F_DEVICE=",' \
-              -e '3s,^,F_SPEED=",' -e '4s,^,F_SETTING=",' | sed -e 's,$,",'`"
+              -e '3s,^,F_SPEED=",' -e '4s,^,F_PROFILE=",' | sed -e 's,$,",'`"
 
         # Validate entries (All values are required.)
         unset ERRMSG
-	if [ -z "$F_APN" -o -z "$F_DEVICE" -o -z "$F_SPEED" -o -z "$F_SETTING" ] ; then
+	if [ -z "$F_APN" -o -z "$F_DEVICE" -o -z "$F_SPEED" -o -z "$F_PROFILE" ] ; then
 		ERRMSG="All fields are required to setup your GPRS device."
 	fi
 
@@ -140,10 +140,10 @@
 		       -e "s at 115200@$F_SPEED at g" /etc/ppp/peers/gprs
 
 		# Alter /etc/ppp/gprs.chat (advanced setting)
-		sed -i -e "s at CGDCONT=1 at CGDCONT=$F_SETTING at g" \
-                       -e "s@\*\*\*1@\*\*\*$F_SETTING at g" /etc/ppp/gprs.chat
+		sed -i -e "s at CGDCONT=1 at CGDCONT=$F_PROFILE at g" \
+                       -e "s@\*\*\*1@\*\*\*$F_PROFILE at g" /etc/ppp/gprs.chat
 
-                unset F_APN F_DEVICE F_SPEED F_SETTING DLG_COMMAND
+                unset F_APN F_DEVICE F_SPEED F_PROFILE DLG_COMMAND
                 unset SELECTION ERRMSG
         else
 		dialog --title "Validation Error" --msgbox "$ERRMSG" 6 60
@@ -204,8 +204,8 @@
 set_pppoe_cfg(){
         DLG_COMMAND="dialog --title \"Modem Configuration\" --no-cancel \
         --form \"Please enter the modem details below:\" 0 0 2 \
-        \"User:\" 1 1 \"$F_USERNAME\" 2 25 30 0 \
-        \"Password:\" 2 1 \"$F_PASSWORD\" 3 25 30 0"
+        \"User:\" 1 1 \"$F_USERNAME\" 1 25 30 0 \
+        \"Password:\" 2 1 \"$F_PASSWORD\" 2 25 30 0"
         SELECTION=`eval $DLG_COMMAND 3>&2 2>&1 1>&3`
 
         [ $? -eq 0 ] || exit 1
@@ -232,7 +232,7 @@
 	cp /etc/ppp/pap-secrets{.orig,}
 
 	# Alter /etc/ppp/pap-secrets
-	echo $F_USERNAME dialup $F_PASSWORD >> /etc/ppp/pap-secrets
+	echo $F_USERNAME \* $F_PASSWORD >> /etc/ppp/pap-secrets
 }
 
 # Main Menu for network devices
@@ -276,9 +276,9 @@
 	
 		pppoe)
 			set_pppoe_cfg;
-			modprobe ppp ; modprobe pppoe
+			modprobe ppp_generic ; modprobe pppoe ; sleep 1
 			ip link set $DEV up
-			pppd plugin rp-pppoe.so $DEV user $PPPOEUSER noauth
+			pppd plugin rp-pppoe.so $DEV user $PPPOEUSER noauth updetach
 			;;
 		*)
 			exit 0
@@ -303,13 +303,14 @@
         case "$SERVICE" in
 
                 configure)
-			[ "$DEV" = "gprs" ] && set_modem_cfg;
-			[ "$DEV" = "dialup" ] && set_gprs_cfg;
+			[ "$DEV" = "gprs" ] && set_gprs_cfg;
+			[ "$DEV" = "dialup" ] && set_modem_cfg;
                         ;;
 
                 dial)
-                        [ -e /dev/ppp ] || mknod /dev/ppp c 108 0
-                        modprobe ppp-generic ; pppd call $DEV
+                        # "sleep 1" is for udev race
+                        modprobe ppp-generic ; sleep 1
+                        pppd call $DEV updetach
                         exit 0
                         ;;
 




More information about the livecd mailing list