X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/356535ffd7bc1343ce6bc2fc367f788cc2c1bd24..5392583e7d1f7b372ede703dcd169792d2262f4b:/target/linux/rb532-2.6/base-files/sbin/cf2nand?ds=sidebyside diff --git a/target/linux/rb532-2.6/base-files/sbin/cf2nand b/target/linux/rb532-2.6/base-files/sbin/cf2nand index f8576beaa..169f7eb8d 100755 --- a/target/linux/rb532-2.6/base-files/sbin/cf2nand +++ b/target/linux/rb532-2.6/base-files/sbin/cf2nand @@ -6,16 +6,11 @@ copy_kernel() { local output="$2" local cmdline="$3" size="$(echo -n "$cmdline" | wc -c)" - dd if="$input" bs=3M count=1 | ( - dd bs=4112 count=1 - echo -n "$cmdline" - dd if=/dev/zero bs="$((512 - $size))" count=1 - dd bs=512 count=1 of=/dev/null - cat - ) > "$output" + dd if="$input" bs=3M count=1 > "$output" + /sbin/patch-cmdline "$output" "$cmdline" } -fstype="$(mount | grep ' / ' | awk '{print $5}')" +fstype="$(mount | grep ' / ' | awk '$1 != "rootfs" {print $5}')" case "$fstype" in ext2|jffs2) echo "Copying from $fstype to yaffs2";; *) echo "Invalid filesystem."; exit 1;;