Bug#465122: dd uses a lot of memory
* Joey Hess <joeyh@debian.org> [2008-02-10 17:22]:
> > Do you have a patch? :)
> Not yet. Do you remember why it uses ibs?
Here's what svn log says, but I really don't understand dd very well.
This was based on a comment on a mailing list or something.
Index: debian/changelog
===================================================================
--- debian/changelog (revision 42551)
+++ debian/changelog (revision 42553)
@@ -1,3 +1,10 @@
+flash-kernel (0.8) unstable; urgency=low
+
+ * Speed up flash-kernel on NSLU2 by reading the second part of the
+ kernel in one go rather than byte by byte.
+
+ -- Martin Michlmayr <tbm@cyrius.com> Fri, 10 Nov 2006 08:12:16 +0000
+
flash-kernel (0.7) unstable; urgency=high
* Copy the ixp400 modules to target if they exist. This code got lost
Index: flash-kernel
===================================================================
--- flash-kernel (revision 42551)
+++ flash-kernel (revision 42553)
@@ -115,7 +115,6 @@
boundary=1441792 # 0x00160000
ksize=$(wc -c $kfile | awk '{print $1}')
ksize1=$(expr $boundary - $offset - 16)
- ksize2=$(expr $ksize - $ksize1)
tmp=$(tempfile)
printf "Flashing kernel: " >&2
(
@@ -123,7 +122,7 @@
dd if=$kfile of=$tmp bs=$ksize1 count=1 2>/dev/null
nslu2_swap $tmp
sercomm_header 131072
- dd if=$kfile of=$tmp bs=1 skip=$ksize1 count=$ksize2 2>/dev/null
+ dd if=$kfile of=$tmp ibs=$ksize1 skip=1 2>/dev/null
nslu2_swap $tmp
rm -f $tmp
) > "$mtdkernel" || error "failed."
--
Martin Michlmayr
http://www.cyrius.com/
Reply to: