[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#465901: [PATCH] 465901 (cryptroot remote unlocking on boot feature)



From: <debian@x.ray.net>

---
 mkinitramfs       |    1 +
 scripts/functions |   63 +++++++++++++++++++++++++++-------------------------
 2 files changed, 34 insertions(+), 30 deletions(-)

diff --git a/mkinitramfs b/mkinitramfs
index 06d2149..13219af 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -168,6 +168,7 @@ DPKG_ARCH=`dpkg --print-installation-architecture`
 
 # Export environment for hook scripts.
 #
+export CONFDIR
 export MODULESDIR
 export version
 export CONFDIR
diff --git a/scripts/functions b/scripts/functions
index fdd808f..bbfb2b8 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -273,35 +273,38 @@ parse_numeric() {
 
 configure_networking()
 {
-	# support ip options see linux sources Documentation/nfsroot.txt
-	case ${IPOPTS} in
-	none|off)
-		# Do nothing
-		;;
-	""|on|any)
-		# Bring up device
-		ipconfig ${DEVICE}
-		;;
-	dhcp|bootp|rarp|both)
-		ipconfig -c ${IPOPTS} -d ${DEVICE}
-		;;
-	*)
-		ipconfig -d $IPOPTS
-
-		# grab device entry from ip option
-		NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}
-		if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then
-			NEW_DEVICE=${NEW_DEVICE%:*}
-		else
-			# wrong parse, possibly only a partial string
-			NEW_DEVICE=
-		fi
-		if [ -n "${NEW_DEVICE}" ]; then
-			DEVICE="${NEW_DEVICE}"
-		fi
-		;;
-	esac
+	if [ ! -e /tmp/net-${DEVICE}.conf ]; then
 
-	# source relevant ipconfig output
-	. /tmp/net-${DEVICE}.conf
+		# support ip options see linux sources Documentation/nfsroot.txt
+		case ${IPOPTS} in
+		none|off)
+			# Do nothing
+			;;
+		""|on|any)
+			# Bring up device
+			ipconfig ${DEVICE}
+			;;
+		dhcp|bootp|rarp|both)
+			ipconfig -c ${IPOPTS} -d ${DEVICE}
+			;;
+		*)
+			ipconfig -d $IPOPTS
+
+			# grab device entry from ip option
+			NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}
+			if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then
+				NEW_DEVICE=${NEW_DEVICE%:*}
+			else
+				# wrong parse, possibly only a partial string
+				NEW_DEVICE=
+			fi
+			if [ -n "${NEW_DEVICE}" ]; then
+				DEVICE="${NEW_DEVICE}"
+			fi
+			;;
+		esac
+
+		# source relevant ipconfig output
+		. /tmp/net-${DEVICE}.conf
+	fi
 }
-- 
1.5.3.8




Reply to: