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

Bug#413373: Patch for flash-kernel to improve speed



Package: flash-kernel
Version: 1.1
Tags: Patch

The attached patch reduces the running time of flash-kernel on the
NSLU2 by almost
30 seconds. The change should also apply to the Thecus N2100, but I am
not able to test it.

# /usr/bin/time -f "elapsed %e system %S user %U" flash-kernel
Flashing kernel: done.
Flashing initramfs: done.
elapsed 122.09 system 2.93 user 0.72

# /usr/bin/time -f "elapsed %e system %S user %U" ./flash-kernel
Flashing kernel: done.
Flashing initramfs: done.
elapsed 93.85 system 2.95 user 0.78

Gordon

--
Gordon Farquharson
--- flash-kernel.orig	2007-03-03 11:42:45.000000000 -0700
+++ flash-kernel	2007-03-03 13:30:35.000000000 -0700
@@ -131,10 +131,9 @@
 		size=$(grep "Ramdisk" /proc/mtd | cut -d " " -f 2)
 		size=$(printf "%d" 0x$size)
 		isize=$(wc -c $ifile | awk '{print $1}')
-		cat $ifile > $tmp
 		pad=$(expr $size - $isize - 16)
 		if [ "$pad" -gt 0 ]; then
-			dd if=/dev/zero bs=$pad count=1 2>/dev/null >> $tmp
+			dd if=$ifile of=$tmp ibs=4M conv=sync 2>/dev/null
 		fi
 		(
 			sercomm_header $isize

Reply to: