Artem Bityutskiy [Wed, 23 Jan 2008 17:34:52 +0000 (19:34 +0200)]
ubi-utils: remove all old tools
Remove all old tools because I cannot maintain them and the original
authors do not seem to have time for this. Some of the tools do not
work properly, some are just vague and undocumented and seem to be
oriented to the environment of the IBM guys. Nevertheless, I'll
return the tool as is in the next commit, becouse they are still
useful.
This commit also adds a ubinize utility to generate UBI images.
Artem Bityutskiy [Wed, 16 Jan 2008 14:52:45 +0000 (16:52 +0200)]
ubi-utils: fix bytes output
Fix incorrect output of ubinfo like
"Amount of available logical eraseblocks: 00 bytes)"
which should look like
"Amount of available logical eraseblocks: 0 (0 bytes)"
Frank Haverkamp [Mon, 7 Jan 2008 13:05:00 +0000 (14:05 +0100)]
ubi-utils: Remove obsolete code/data
Artem figured out that certain stuff is obsolete. He also sugested that we
move the code from the perl directory into the scripts directory to reduce
the number of directories.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Frank Haverkamp [Mon, 7 Jan 2008 13:05:00 +0000 (14:05 +0100)]
ubi-utils: bin2nand, nand2bin add support of different ecc layouts
Both tools were lacking support of alternate ECC layouts. Only our intitial
format was supported. With this change, it should be very easy to add more
layouts in addtion to the already supported ones, which are: IBM (our format),
and the MTD default layout. NAND OOB sizes of 512 and 2048 are currently
supported.
In contrast to the old version of bin2nand, the holes inbetween the ECC data
is now not filled with 0x00 anymore but instead 0xff (like deleted flash) is
used. This should not cause any difference. The testcase reflects the different
layouts too.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Adrian Hunter [Mon, 7 Jan 2008 07:49:25 +0000 (09:49 +0200)]
ubi-utils: fix bug using readdir
Library functions never reset errno to zero, so if you want
to use its value to check for errors then you must set it to zero
before calling the library function (in this case readdir).
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Artem Bityutskiy [Sat, 22 Dec 2007 15:47:22 +0000 (17:47 +0200)]
ubi-utils: add ubiupdate
Add an 'ubiupdate' utility which is basically a changed and cleaned-up
version of ubiupdatevol. It is also consistent with other ubi tools.
ubiupdatevol should go away, because it has features which should not
be present in tools for end users. If one needs debugging capabilities,
he should create a separate program.
So, I do not delete ubiupdatevol, but it will be moved somwthere later.
Artem Bityutskiy [Sat, 22 Dec 2007 13:43:19 +0000 (15:43 +0200)]
ubi-utils: introduce ubinfo utility
Add new handy UBI utility which prints various type of UBI information.
This commit also includes a lot of fixes and cleanups in libubi, and
other utilities. It was quite complex to separate this all out and
I figured that nobody anyway would really need this, and decided to
save my time for more useful things.
Ricard Wanderlof [Thu, 20 Dec 2007 11:46:38 +0000 (22:46 +1100)]
mkfs.jffs2: Set mkfs.jffs2 page size runtime instead of fixed
This patch reads the default PAGE_SIZE from sysconf(), i.e. the system
mkfs.jffs2 is running on, instead of just setting it to 4096 (which of
course is valid for most systems but not all).
This is useful if mkfs.jffs2 is running on the target system, e.g. to
create a backup image during firmware upgrade, so that the page size does
not have to be set explicitly using a command line parameter.
The --pagesize option is supported just as before.
If the user has not set the page size explicitly with --pagesize, and
the system page size is anything other than 4096, warn the user that
an unusual page size is being used, since this behavior is different
from before.
David Woodhouse [Sat, 15 Dec 2007 00:33:35 +0000 (19:33 -0500)]
mkfs.jffs2.c: detect hardlinks
... with the stupidest possible algorithm for storing them and looking
them up. Optimising that is simple enough, but left as an exercise for
the user. This is userspace, after all. It's not as if I care.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Frank Haverkamp [Sat, 24 Nov 2007 10:04:51 +0000 (11:04 +0100)]
ubi-utils: nand2bin had ECC calculation problems
Fixed a problem when ECC was checked. The correction was not properly
done by subpage. Added more output for the moment to be able to figure
out more potential problems.
Added testcase: bin2nand2bin.sh and biterror inject program inject_biterror.pl
Interface
o ECC correction disabled by default. Switch to turn it
explicitly on. The user must specify what he wants to be done.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Frank Haverkamp [Sat, 24 Nov 2007 10:04:51 +0000 (11:04 +0100)]
ubi-utils: various fixes in unubi
The extraction of data from blocks used for dynamic volumes was
totally broken. The data size was calculated wrong. This fix is not
perfect, the alignment is still ignored.
The parameter "header-size" is very misleading. It does not reflect
the vid hdr offset properly. I assume therefor that it only works for
the layout I am using where the vid hdr is at the _end_ of the 1st
NAND page (2048).
I added the generation of a textfile with information about the blocks
which are going into the internal graph representation.
Instead of a graph I think that a simple array will simplify the code
very much. The array must than be sorted properly to cope with older
and newer block-copies but that should not be a problem.
discussed the tool with my coleage Andreas Arnez and we found that it
might be a good idea to replace it even with a perl program for the
same purpose since that would offer the flexibility to change it on
the fly when needed. The tool is mainly used for crash analysis so it
could be an advantage to change it without needing a C-compiler.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Frank Haverkamp [Sat, 24 Nov 2007 10:04:50 +0000 (11:04 +0100)]
ubi-utils: Update and bugfix unubi
Drake Dawsett had done some changes to our unubi which where not yet
published. I hereby send his latest code and integrated the parameter
handling which was changed in our version. When reviewing this very
huge patch we need to ensure that possible changes of others are not
reversed.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Frank Haverkamp [Wed, 26 Sep 2007 11:40:10 +0000 (13:40 +0200)]
ubi-utils: Nand2bin add more information when bad blocks occur
When bad blocks occur more debug information is needed.
To identify the bad blocks the blocksize is required.
The split block mode was added to generate files per
block. In split mode the bad block markers are analyzed
and a summary is printed at the end.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Artem Bityutskiy [Wed, 29 Aug 2007 15:51:07 +0000 (18:51 +0300)]
ubi-utils: get rid of compile warnings
Just silly hacks. Also remove udevsettle() invocation from UBI
library. If it must be called, it is not library's business
anyway. Wa added it to make scripts which use ubimkvol utility
run, so it is the only caller that really needs this. So
just move the cruft to the utility.
David Woodhouse [Tue, 14 Aug 2007 14:54:49 +0000 (22:54 +0800)]
Switch multicast distribution system to round-robin mode
Send one packet from each eraseblock in turn, rather than all packets
for one eraseblock together. This means that bursts of loss are evenly
spread between blocks. It also makes the client side a bit more complex
if you can't assume that there's anywhere except the flash to store its
intermediate data.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
David Woodhouse [Fri, 10 Aug 2007 06:40:01 +0000 (14:40 +0800)]
Fine-tine the TX timing for serve_image.
It just busy-waits until it's time to send the next packet now. Which
sucks, but gives us good timing for debugging. Needs work (and actually
if we have hrtimers we probably _can_ sleep and still have proper
timing).
Signed-off-by: David Woodhouse <dwmw2@infradead.org>