]> www.infradead.org Git - mtd-utils.git/commitdiff
ubi-utils: Remove obsolete code/data
authorFrank Haverkamp <haver@vnet.ibm.com>
Mon, 7 Jan 2008 13:05:00 +0000 (14:05 +0100)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 15 Jan 2008 10:47:09 +0000 (12:47 +0200)
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>
ubi-utils/TODO
ubi-utils/scripts/Makefile
ubi-utils/scripts/bin2nand2bin_test.sh
ubi-utils/scripts/f128_nand_sample.cfg [moved from ubi-utils/perl/f128_nand_sample.cfg with 92% similarity]
ubi-utils/scripts/f64_nor_sample.cfg [moved from ubi-utils/perl/f64_nor_sample.cfg with 91% similarity]
ubi-utils/scripts/mkpfi [moved from ubi-utils/perl/mkpfi with 100% similarity, mode: 0644]
ubi-utils/scripts/ubicrc32.pl [moved from ubi-utils/perl/ubicrc32.pl with 99% similarity, mode: 0644]
ubi-utils/sort-me-out/README
ubi-utils/sort-me-out/doc/unubi.roff [deleted file]

index 4683bd782b478ddfb98c1a89ccd40069a176128c..63a07671cf79cf240134c1d5917340c0bc0f888d 100644 (file)
@@ -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.
index ebd9bc6c083b3ae2450f4450f33db243bd66dbe7..b8e3c961ac39c235c3b705899f1e798aef6b5d1d 100644 (file)
@@ -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
index 2192f02dfddcf11a83f7866c40caf4baeed3930e..51f048cc58b0313b9e2524a8576fa8e694ea7551 100644 (file)
@@ -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
-
similarity index 92%
rename from ubi-utils/perl/f128_nand_sample.cfg
rename to ubi-utils/scripts/f128_nand_sample.cfg
index e468d9d03c3973a407db44602b071929b43d8f91..bb6260062d27fe8d2aea68a1b884fa551839dbf8 100644 (file)
@@ -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
similarity index 91%
rename from ubi-utils/perl/f64_nor_sample.cfg
rename to ubi-utils/scripts/f64_nor_sample.cfg
index fd44e2773c0818e25fd2234504cedc0a17369e07..889d4c2138b85cd568f187768230d21b9b1b0f83 100644 (file)
@@ -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
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from ubi-utils/perl/mkpfi
rename to ubi-utils/scripts/mkpfi
old mode 100755 (executable)
new mode 100644 (file)
similarity index 99%
rename from ubi-utils/perl/ubicrc32.pl
rename to ubi-utils/scripts/ubicrc32.pl
index add5f9d..92711cb
@@ -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;
index 19333a7e426f64f685cd7fa301b64b39fd367015..7dd45c1f027d3086ae0cebbe9dc0fdad2bae32f2 100644 (file)
@@ -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 (file)
index 6cebc46..0000000
+++ /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>