I added support for KuroBox Pro to oldsys-preseed.

The patch is tested and works. (I'll submit tests/arm
later when I have created them.)

The default IP address is 192.168.11.150, there is no
default gateway and ns but I set it to 192.168.11.1
because that is what I would have expected by default.


-- Per

Index: oldsys-preseed
===================================================================
--- oldsys-preseed      (revision 53630)
+++ oldsys-preseed      (working copy)
@@ -174,6 +174,43 @@
                        fi
                        umount $path/sda1 || true
                        rmdir $path/sda1 $path || true
+               elif echo "$machine" | grep -q "^Buffalo/Revogear Kurobox Pro"; 
then
+                       check_file /proc/mtd
+                       rootfs=$(get_mtdblock "rootfs")
+                       if [ -z "$rootfs" ]; then
+                               log "Can't find rootfs MTD partition"
+                               exit
+                       fi
+                       path=/tmp/oldsys-preseed
+                       mkdir -p $path/rootfs
+                       mount -t jffs2 -o ro /dev/mtdblock2 $path/rootfs || true
+                       INTERFACE=eth0
+                       parse_unix_tree "$path/rootfs"
+                       netinfo=$path/rootfs/etc/netinfo
+                       if [ -e "$netinfo" ]; then
+                               usage=$(cat "$netinfo" | grep "^my_ipaddress" | 
sed 's/.*=//')
+                               if [ "$usage" = "dhcp" ]; then
+                                       NET_CONFIG=dhcp
+                               else
+                                       NET_CONFIG=static
+                                       IP_ADDRESS=$(cat "$netinfo" | grep 
"^my_ipaddress" | sed 's/.*=//')
+                                       NETMASK=$(cat "$netinfo" | grep 
"^my_subnetmask" | sed 's/.*=//')
+                                       GATEWAY=$(cat "$netinfo" | grep 
"^my_dgw" | sed 's/.*=//')
+                               fi
+                       fi
+                       hostinfo=$path/rootfs/etc/host.info
+                       if [ -e "$hostinfo" ]; then
+                               HOSTNAME=$(cat "$hostinfo" | grep "^hostname" | 
sed 's/.*=//')
+                       fi
+                       if [ "$NET_CONFIG" != "static" ]; then
+                               IPADDRESS=192.168.11.150
+                               NETMASK=255.255.255.0
+                               GATEWAY=192.168.11.1
+                               [ -z "$NAMESERVERS" ] && 
NAMESERVERS=192.168.11.1
+                               dhcp_fallback $FILE
+                       fi
+                       umount $path/rootfs
+                       rmdir $path/rootfs $path
                else
                        exit_unknown
                fi


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

Reply via email to