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

2008-02-15 Thread debian
From: [EMAIL PROTECTED]

---
 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




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-02-15 Thread maximilian attems
On Fri, 15 Feb 2008, [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 

ok read the description from the other mail,
for quicker response description above patch helps :)
 ---
  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

why should it be exported twice?

 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

i prefer the more readable version at the start of the function:

# networking already configured thus bail out
[ -e /tmp/net-${DEVICE}.conf ]  return 0

care to resend that hook?



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-02-15 Thread debian

+export CONFDIR
 export MODULESDIR
 export version
 export CONFDIR


why should it be exported twice?


just to _really_ be sure... ;)
no, honestly, i have no idea why i thought that was missing. probably 
got confused with the /scripts/*/* scripts where it's hardcoded.



i prefer the more readable version at the start of the function:

# networking already configured thus bail out
[ -e /tmp/net-${DEVICE}.conf ]  return 0

care to resend that hook?


done



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]