Package: preseed
Version: 1.11
Severity: wishlist
Tags: patch

The patch below adds NFS support to network-pressed.  You can pass a
NFS path in the form of nfs://$host/$path/$file and network-preseed
will mount the NFS share and copy the file to d-i.  Obviously, this
requires NFS support but this can be put on the initrd.  I intend to
do this for Cobalt to allow SSH installations on machines without
serial console.

(I've no idea whether d-i has a program to generate a safe /tmp
directory.)


Index: debian/network-preseed.postinst
===================================================================
--- debian/network-preseed.postinst     (revision 33661)
+++ debian/network-preseed.postinst     (working copy)
@@ -8,15 +8,33 @@
 preseed_fetch () {
        local url="$1"
        local file="$2"
-       iters=0
-       while [ $iters -lt 3 ]; do
-               # TODO proxy support? Would it be useful?
-               # TODO add progress bar
-               if wget -q "$url" -O "$file"; then
+       case "$url" in
+               nfs://*)
+                       url=${url#nfs://}
+                       host=$(echo "$url" | cut -d / -f 1)
+                       url=${url#$host}
+                       path=`dirname $url`
+                       file=`basename $url`
+                       mnt=/tmp/nfs
+                       mkdir $mnt
+                       mount -t nfs $host:$path $mnt
+                       cp $mnt/$file $file
+                       umount $mnt
+                       rmdir $mnt
                        return 0
-               fi
-               iters=$(($iters + 1))
-       done
+                       ;;
+               *)
+                       iters=0
+                       while [ $iters -lt 3 ]; do
+                               # TODO proxy support? Would it be useful?
+                               # TODO add progress bar
+                               if wget -q "$url" -O "$file"; then
+                                       return 0
+                               fi
+                               iters=$(($iters + 1))
+                       done
+                       ;;
+       esac
        return 1
 }
 preseed_relative () {



-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

-- 
Martin Michlmayr
http://www.cyrius.com/


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

Reply via email to