[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: flash-kernel puts QNAP on its knees



On 11-9-2015 9:51, JM wrote:
> On Sun, Sep 6, 2015 at 1:02 PM, Rob J. Epping <rob.epping@gmail.com> wrote:
> 
>> I hacked flash-kernel to use flashcp from mtd-utils. Where using cat
>> triggers ATA timeout and reset, using flashcp worked flawlessly.
>>
>>
>> GRTNX,
>> RobJE
> 
> That's great news! Would you mind sharing the diff for flash-kernel?

it was a quick hack and probably lacks error handling among other
things, but here it is.

No warranties.

> Regards,
> Jan

GRTNX,
RobJE

--- /usr/share/flash-kernel/functions.orig      2015-06-08 03:01:36.000000000 +0000
+++ /usr/share/flash-kernel/functions   2015-09-12 07:34:16.600353154 +0000
@@ -263,7 +263,9 @@
        {
                set_machine_id "$machine_id"
                cat "$input"
-       } >"$output"
+       } > /tmp/kernel.img
+       output="`echo \"$output\" | sed 's/mtdblock/mtd/g'`"
+       /usr/sbin/flashcp -v /tmp/kernel.img "$output"
 }

 gen_ubootenv() {
@@ -328,7 +330,9 @@
                if [ "$pad" -gt 0 ]; then
                        dd if=/dev/zero bs="$pad" count=1 2>/dev/null
                fi
-       } >"$output_mtd" || error "failed."
+       } > /tmp/initrd.img
+       output_mtd="`echo \"$output_mtd\" | sed 's/mtdblock/mtd/g'`"
+       /usr/sbin/flashcp -v /tmp/initrd.img "$output_mtd" || error "failed."
        echo "done." >&2
 }


Reply to: