summaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
authorFrank Haverkamp <haver@vnet.ibm.com>2008-01-07 14:05:00 +0100
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-01-15 12:47:09 +0200
commit50e2cd3f3433c42b1c4104430692acc6bc450646 (patch)
tree6636f1fb445dfbb6642e65fe4f186a1129bbbebc /ubi-utils
parent4bf037f3a2aea4328e10422379f751370d288d46 (diff)
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>
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/TODO13
-rw-r--r--ubi-utils/scripts/Makefile20
-rw-r--r--ubi-utils/scripts/bin2nand2bin_test.sh3
-rw-r--r--ubi-utils/scripts/f128_nand_sample.cfg (renamed from ubi-utils/perl/f128_nand_sample.cfg)6
-rw-r--r--ubi-utils/scripts/f64_nor_sample.cfg (renamed from ubi-utils/perl/f64_nor_sample.cfg)6
-rw-r--r--[-rwxr-xr-x]ubi-utils/scripts/mkpfi (renamed from ubi-utils/perl/mkpfi)0
-rw-r--r--[-rwxr-xr-x]ubi-utils/scripts/ubicrc32.pl (renamed from ubi-utils/perl/ubicrc32.pl)2
-rw-r--r--ubi-utils/sort-me-out/README2
-rw-r--r--ubi-utils/sort-me-out/doc/unubi.roff123
9 files changed, 28 insertions, 147 deletions
diff --git a/ubi-utils/TODO b/ubi-utils/TODO
index 4683bd7..63a0767 100644
--- a/ubi-utils/TODO
+++ b/ubi-utils/TODO
@@ -1,17 +1,8 @@
TODO
====
- * Range checking is broken, reserving 2M and offering 3M binary data
- ... works!? No!
- * Remove the above mysterious statement or make it understandable
- * doc/ directory contains a file which refers images from /home/frank/
- - please fix this or remove the whole doc/ altogether.
- * the tests from the scripts/ directory should live in
+ * The tests from the scripts/ directory should live in
mtd-utils/tests/ubi-tests/ and it would be nice to have a short
description of the tests
- * the stuff from the perl/ directory should go to the scripts/
- * May we pleas split UBI-related stuff and pure NAND-related stuff and
+ * May we please split UBI-related stuff and pure NAND-related stuff and
not to keep this all in one.
-
- * nand2bin and bin2nand need more flexibility to influence the ECC
- data placement.
diff --git a/ubi-utils/scripts/Makefile b/ubi-utils/scripts/Makefile
index ebd9bc6..b8e3c96 100644
--- a/ubi-utils/scripts/Makefile
+++ b/ubi-utils/scripts/Makefile
@@ -39,7 +39,23 @@ compl_img ?= $(compl).img
compl_nand2048_mif=$(compl).$(flashtype)$(pagesize).mif
compl_nand2048_img=$(compl).$(flashtype)$(pagesize).img
-all: $(compl_pfi) $(compl_nand2048_mif)
+all: help
+
+help:
+ @echo "Testcases for the UBI/NAND manufacturing tool-chain"
+ @echo "---------------------------------------------------------------"
+ @echo " make mif_test - Generate a mif (manufacturing "
+ @echo " image file)."
+ @echo " make bin2nand2bin_test - Create binary with ECC information"
+ @echo " in the OOB area. Test ECC generation"
+ @echo " and correction."
+
+mif_test: $(compl_pfi) $(compl_nand2048_mif)
+
+bin2nand2bin_test:
+ chmod a+x ./bin2nand2bin_test.sh
+ chmod a+x ./inject_biterror.pl
+ ./bin2nand2bin_test.sh
$(compl_pfi): $(vmlinux_bin) $(rootfs_bin) $(spl_bin)
$(mkpfi) -c $(mkpfi_cfg)
@@ -69,7 +85,7 @@ $(vmlinux_bin) $(rootfs_bin) $(spl_bin):
$(dd) if=/dev/urandom of=$@ bs=1M count=1
clean:
- $(RM) *.pfi *~
+ $(RM) *.pfi *~ testblock* oob.bin
distclean: clean
$(RM) *.bin *.mif *.oob *.img
diff --git a/ubi-utils/scripts/bin2nand2bin_test.sh b/ubi-utils/scripts/bin2nand2bin_test.sh
index 2192f02..51f048c 100644
--- a/ubi-utils/scripts/bin2nand2bin_test.sh
+++ b/ubi-utils/scripts/bin2nand2bin_test.sh
@@ -10,7 +10,7 @@
# bin -> bin2nand -> mif -> nand2bin -> img
#
-inject_biterror=./scripts/inject_biterror.pl
+inject_biterror=./inject_biterror.pl
pagesize=2048
oobsize=64
@@ -214,4 +214,3 @@ for offs in `seq 0 $oobsize` ; do
echo "ok"
fi
done
-
diff --git a/ubi-utils/perl/f128_nand_sample.cfg b/ubi-utils/scripts/f128_nand_sample.cfg
index e468d9d..bb62600 100644
--- a/ubi-utils/perl/f128_nand_sample.cfg
+++ b/ubi-utils/scripts/f128_nand_sample.cfg
@@ -3,10 +3,10 @@ complete=ipl,spl,bootenv,kernel,rootfs
bootcode=spl,bootenv
# Build sections
-[ipl]
+[ipl]
image=ipl.bin
raw_starts=0x00000000
-raw_total_size=128kiB
+raw_total_size=128kiB
[spl]
image=u-boot.bin
@@ -33,6 +33,6 @@ ubi_names=kernel_0,kernel_1
image=rootfs.bin
ubi_ids=8,9
ubi_alignment=2kiB
-ubi_size=16MiB
+ubi_size=16MiB
ubi_type=dynamic
ubi_names=rootfs_0,rootfs_1
diff --git a/ubi-utils/perl/f64_nor_sample.cfg b/ubi-utils/scripts/f64_nor_sample.cfg
index fd44e27..889d4c2 100644
--- a/ubi-utils/perl/f64_nor_sample.cfg
+++ b/ubi-utils/scripts/f64_nor_sample.cfg
@@ -4,10 +4,10 @@ bootcode=spl,bootenv
rootfs=rootfs
# Build sections
-[ipl]
+[ipl]
image=ipl.bin
raw_starts=0x02FE0000, 0x03FE0000
-raw_total_size=128kiB
+raw_total_size=128kiB
[spl]
image=u-boot.bin
@@ -34,6 +34,6 @@ ubi_names=kernel_0,kernel_1
image=rootfs.bin
ubi_ids=8,9
ubi_alignment=2kiB
-ubi_size=16128kiB
+ubi_size=16128kiB
ubi_type=dynamic
ubi_names=rootfs_0,rootfs_1
diff --git a/ubi-utils/perl/mkpfi b/ubi-utils/scripts/mkpfi
index 2cce587..2cce587 100755..100644
--- a/ubi-utils/perl/mkpfi
+++ b/ubi-utils/scripts/mkpfi
diff --git a/ubi-utils/perl/ubicrc32.pl b/ubi-utils/scripts/ubicrc32.pl
index add5f9d..92711cb 100755..100644
--- a/ubi-utils/perl/ubicrc32.pl
+++ b/ubi-utils/scripts/ubicrc32.pl
@@ -62,7 +62,7 @@ sub crc32_on_file
my $file;
open $file, "<", $path
or die "Error opening '$path'.\n";
-
+
&crc32_on_file($file)
or die "Error reading from '$path'.\n";
close $file;
diff --git a/ubi-utils/sort-me-out/README b/ubi-utils/sort-me-out/README
index 19333a7..7dd45c1 100644
--- a/ubi-utils/sort-me-out/README
+++ b/ubi-utils/sort-me-out/README
@@ -3,5 +3,3 @@ This directory contains various stuff that has to be cleaned up and sorted out.
* jffs2_test.sh: this has nothing to do to UBI. And the test is quite trivial,
so it is questionable if it should not be deleted. Anyway, if we want this,
it has to be moved to mtd-utils.git/tests/fs-tests.
-* doc: contains references to non-existing files. it is unclear how to build
- it
diff --git a/ubi-utils/sort-me-out/doc/unubi.roff b/ubi-utils/sort-me-out/doc/unubi.roff
deleted file mode 100644
index 6cebc46..0000000
--- a/ubi-utils/sort-me-out/doc/unubi.roff
+++ /dev/null
@@ -1,123 +0,0 @@
-.TH UNUBI 1 "NOVEMBER 2006" FSP "FSP Flashutils"
-.SH NAME
-unubi \- extract volumes/eraseblocks from a raw\-UBI image
-.SH SYNOPSIS
-\fBunubi [\-aevEV] [\-d \fIout\-dir\fB] [\-r \fIvolume\-id\fB]
-[\-b \fIblock\-size\fB] \fIimage\-file
-.SH DESCRIPTION
-.PP
-\fBunubi\fR reads an image file containing blocks of UBI headers and data
-(such as produced from \fBnand2bin\fR) and rebuilds the volumes within.
-The default operation (when no flags are given) is to rebuild all valid
-volumes found in the image. \fBunubi\fR can also read straight from the
-onboard MTD device (ex. /dev/mtdblock/NAND).
-.SH OPTIONS
-.IP "\-a, \-\-analyze"
-When flagged, analysis files are generated within the output directory. These
-may include tables and or graphs detailing statistics gathered from the
-eraseblock data. Files are prefixed `analysis_'.
-
-See \fBANALYSIS\fR.
-.IP "\-b, \-\-blocksize \fIblock\-size\fR"
-Specify in bytes the \fIimage\-file\fR eraseblock size. Sizes may be
-postfixed with `KiB' or `MiB' to indicate mebibytes or kibibytes
-respectively. Default is 128KiB.
-.IP "\-d, \-\-dir \fIoutput\-dir\fR"
-Specify the output directory. If no directory is specified, the default
-is `unubi_\fIimage\-file\fR' within the curent working directory. If the
-attempt to create the output directory fails,
-.B unubi
-will try to create it in /tmp before aborting.
-.IP "\-e, \-\-eb\-split"
-When flagged, images are created for each eraseblock in \fIimage\-file\fR
-regardless of its validity. Each image is the complete eraseblock, including
-headers and any space to the end of the eraseblock after where the data may
-end.
-
-Invalid images are named `ebEEEE', where EEEE is the physical index of the
-eraseblock in the image. Valid images are named `ebEEEE_VVV_NNN_RRR' where
-VVV is the known volume ID, NNN is the logical number and RRR is the version
-of the eraseblock data. Note that the version number is in hexadecimal.
-
-Invalid images may also contain this postfix, if the data in the header
-could be valid (ie. the header contains a resonable volume ID, but the
-header and/or data CRCs are not valid). If this is the case, images are named
-`ebEEEE_VVV_NNN_RRR.reason', so as to distinguish known values from
-non\-definite ones.
-
-See \fBREASON SUFFIXES\fR.
-.IP "\-r, \-\-rebuild \fIvolume\-id\fR"
-Specify a volume to rebuild. Can be used successively to specify
-several volumes to be rebuilt.
-
-Images are named `volumeVVV' where VVV is the volume ID. For each missing
-eraseblock, an error message will be printed.
-.IP "\-v, \-\-vol\-split"
-When flagged, images are created for each valid eraseblock in
-\fIimage\-file\fR. Since a vaild eraseblock will have a defined data start and
-data length, only this range will make up the image.
-
-Images are named `volVVV_NNN_RRR_EEEE', where, for the data in the eraseblock,
-VVV is the volume ID, NNN is the logical number, RRR is the version and EEEE
-is the phyisical index of the eraseblock in the image.
-.IP "\-V, \-\-vol\-split!"
-Same as above, only all images are the complete eraseblock (including headers,
-and raw data, even past the point where the data is supposed to end).
-Overrides \-v when both \-v and \-V are flagged.
-.SH ANALYSIS
-The following files will be generated during the analysis:
-.IP "analysis_ec_hdr.data"
-A space delimited table with these two columns for each eraseblock: the
-eraseblock's index or physical position in the image, and the eraseblock's
-erase count. The third column contains the erase count data sorted.
-.IP "analysis_vid_hdr.data"
-A space delimited table with these four colums for each eraseblock: the
-volume ID, the volume logical number, the leb version, and the data size.
-In addition there are a normalized column representing the volume ID and
-volume logical number, a normalized column representing the leb version, and
-a normalized column representing the data_size. These normalized columns are
-used to better draw the the gnuplot image.
-.IP "analysis_ec_hdr.plot"
-A gnuplot script for quickly viewing a sample output from the respective .data
-file.
-.IP "analysis_vid_hdr.plot"
-A gnuplot script for quickly viewing a sample output from the respective .data
-file.
-.SH REASONS SUFFIXES
-When \-\-eb\-split produces possibly invalid, though usable, eraseblocks, the
-known reason suffixes are:
-.IP ".ec_magic"
-The erase counter header did not contain a valid magic field.
-.IP ".ec_hdr_crc"
-The erase counter header did not contain a vaild header CRC field.
-.IP ".vid_magic"
-The volume ID header did not contain a valid magic field.
-.IP ".vid_hdr_crc"
-The volume ID header did not contain a valid header CRC field.
-.IP ".data_crc"
-The volume ID header did not contain a valid data CRC field.
-.SH EXAMPLES
-To extract and rebuild all valid volumes from demo.img (note the output
-directory will be /home/user/unubi_demo.img):
-.sp 1
-.RS
-.B /home/user# unubi demo.img
-.sp 1
-.RE
-To analyze demo.img as well as extract and rebuild volume 7:
-.sp 1
-.RS
-.B /home/user# unubi \-a \-r 7 demo.img
-.sp 1
-.RE
-To split demo.img into raw images for each eraseblock into the folder
-/var/eraseblocks:
-.sp 1
-.RS
-.B /home/user# unubi \-e \-d /var/eraseblocks demo.img
-.SH AUTHORS
-Frank Haverkamp <haver@vnet.ibm.com>
-.sp 0
-Drake Dowsett <dowsett@de.ibm.com>
-.SH CONTACT
-Andreas Arnez <arnez@de.ibm.com>