瀏覽代碼

ar71xx: Make wget2nand fail if copying the kernel fails and use the correct file extension for the rootfs image

wget2nand didnt check the exit status after copying the kernel, if the
copying failed for some reason ( for example not enougs space on the
kernel partition) it simply continued extracting the rootfs.
I also changed the filename, which wget2nand trys to download (
.tar.gz instead of .tgz ).

Signed-off-by: Marko Foerster <[email protected]>

SVN-Revision: 21444
Gabor Juhos 16 年之前
父節點
當前提交
65dba323f7
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      target/linux/ar71xx/base-files/sbin/wget2nand

+ 5 - 2
target/linux/ar71xx/base-files/sbin/wget2nand

@@ -28,7 +28,7 @@ url=$1
 }
 }
 
 
 url_kernel=$url/openwrt-ar71xx-vmlinux.elf
 url_kernel=$url/openwrt-ar71xx-vmlinux.elf
-url_rootfs=$url/openwrt-ar71xx-rootfs.tgz
+url_rootfs=$url/openwrt-ar71xx-rootfs.tar.gz
 
 
 mtd_kernel="$(find_mtd_part 'kernel')"
 mtd_kernel="$(find_mtd_part 'kernel')"
 mtd_rootfs="$(find_mtd_part 'rootfs')"
 mtd_rootfs="$(find_mtd_part 'rootfs')"
@@ -60,7 +60,10 @@ mount -t yaffs2 "$mtd_kernel" "$mnt_kernel"
 mount -t yaffs2 "$mtd_rootfs" "$mnt_rootfs"
 mount -t yaffs2 "$mtd_rootfs" "$mnt_rootfs"
 
 
 echo "Copying kernel..."
 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
 chmod +x $mnt_kernel/kernel
 
 
 echo "Preparing filesystem..."
 echo "Preparing filesystem..."