Do not use deprecated path to functions.sh (/etc/functions.sh -> /lib/functions.sh)
[openwrt/staging/dedeckeh.git] / target / linux / ar71xx / base-files / sbin / wget2nand
index 10eb59f18fd900f232722a53b039e328f4101f43..f80eecd21926958fdf7a652a9ea1d73cfcef3c5a 100755 (executable)
@@ -6,7 +6,7 @@
 # Licence GPL V2
 # Author david.goodenough@linkchoose.co.uk
 # Based on cf2nand from RB532 support
-. /etc/functions.sh
+. /lib/functions.sh
 
 wget2nand_dir=/tmp/wget2nand
 mnt_kernel=$wget2nand_dir/mnt_kernel
@@ -27,8 +27,8 @@ url=$1
         exit 1
 }
 
-url_kernel=$url/openwrt-ar71xx-vmlinux.elf
-url_rootfs=$url/openwrt-ar71xx-rootfs.tgz
+url_kernel=$url/openwrt-ar71xx-nand-vmlinux-lzma.elf
+url_rootfs=$url/openwrt-ar71xx-nand-rootfs.tar.gz
 
 mtd_kernel="$(find_mtd_part 'kernel')"
 mtd_rootfs="$(find_mtd_part 'rootfs')"
@@ -37,10 +37,6 @@ mtd_rootfs="$(find_mtd_part 'rootfs')"
        exit 1
 }
 
-# first get an address for br-lan using udhcpc
-killall udhcpc
-/sbin/udhcpc -i br-lan
-
 mkdir "$wget2nand_dir"
 wget $url_kernel -O "$src_kernel" || {
        echo "Unable to download $url_kernel"
@@ -64,7 +60,10 @@ mount -t yaffs2 "$mtd_kernel" "$mnt_kernel"
 mount -t yaffs2 "$mtd_rootfs" "$mnt_rootfs"
 
 echo "Copying kernel..."
-cp $src_kernel $mnt_kernel/kernel
+cp $src_kernel $mnt_kernel/kernel || {
+       echo "Error occured while copying the kernel"
+       exit 1
+}
 chmod +x $mnt_kernel/kernel
 
 echo "Preparing filesystem..."