mtd-utils: add mtd test tools
authorMiquel Raynal <miquel.raynal@free-electrons.com>
Mon, 14 Aug 2017 20:21:50 +0000 (22:21 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sat, 23 Sep 2017 19:59:50 +0000 (21:59 +0200)
Add the possibility to choose more test tools than only integck
from the MTD utils test-suite.

Move the hidden BR2_PACKAGE_MTD_TESTS configuration to the bottom
of the page and make it visible. When checked, a new list of available
binaries is displayed and may be selected and compiled into the image
with the --enable-install-tests configure script option:
- flash_torture
- flash_stress
- flash_speed
- nandbiterrs
- flash_readtest
- nandpagetest
- nandsubpagetest

Most of these tests may be performed by inserting kernel modules
which are almost legacy so having the userspace tools available
might become useful.

Legacy handling for users who had BR2_PACKAGE_MTD_INTEGCK selected is
not needed: they also have the BR2_PACKAGE_MTD_TESTS option enabled in
their .config. That option has now become a selectable option so it is
not removed any more by oldconfig.

Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
[Arnout:
 - fix threads and MMU dependency;
 - order Config.in options and mtd.mk lines alphabetically;
 - add note on legacy handling to commit message.]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
fixup

package/mtd/Config.in
package/mtd/mtd.mk

index 37e4b4ab1bbea123ae9ab1f75a9877a7d2417cc5..590ca7f5efb0bf714b514ba493d198cefd830ba4 100644 (file)
@@ -7,8 +7,8 @@ config BR2_PACKAGE_MTD
 
 if BR2_PACKAGE_MTD
 
-# The three hidden options below match mtd configure script options
-# --enable-jffs, --enable-ubifs and --enable-tests.
+# The two hidden options below match mtd configure script options
+# --enable-jffs and --enable-ubifs
 
 config BR2_PACKAGE_MTD_JFFS_UTILS
        bool
@@ -22,10 +22,6 @@ config BR2_PACKAGE_MTD_UBIFS_UTILS
        select BR2_PACKAGE_UTIL_LINUX_LIBUUID
        select BR2_PACKAGE_ZLIB
 
-config BR2_PACKAGE_MTD_TESTS
-       bool
-       depends on BR2_TOOLCHAIN_HAS_THREADS
-
 comment "MTD tools selection"
 
 config BR2_PACKAGE_MTD_DOCFDISK
@@ -173,16 +169,43 @@ config BR2_PACKAGE_MTD_UBIBLOCK
        bool "ubiblock"
        default y
 
+config BR2_PACKAGE_MTD_TESTS
+       bool "MTD test tools"
+       depends on BR2_USE_MMU # fork() in fstests
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       help
+         Build and install tools for testing MTD devices and drivers.
+
+if BR2_PACKAGE_MTD_TESTS
+
+config BR2_PACKAGE_MTD_FLASH_READTEST
+       bool "flash_readtest"
+
+config BR2_PACKAGE_MTD_FLASH_SPEED
+       bool "flash_speed"
+
+config BR2_PACKAGE_MTD_FLASH_STRESS
+       bool "flash_stress"
+
+config BR2_PACKAGE_MTD_FLASH_TORTURE
+       bool "flash_torture"
+
 config BR2_PACKAGE_MTD_INTEGCK
        bool "integck"
-       depends on BR2_TOOLCHAIN_HAS_THREADS # mtd-tests
-       depends on BR2_USE_MMU # fork()
-       select BR2_PACKAGE_MTD_TESTS
-       help
-         Install the integck test program.
 
-comment "integck needs a toolchain w/ threads"
-       depends on !BR2_TOOLCHAIN_HAS_THREADS
+config BR2_PACKAGE_MTD_NANDBITERRS
+       bool "nandbiterrs"
+
+config BR2_PACKAGE_MTD_NANDPAGETEST
+       bool "nandpagetest"
+
+config BR2_PACKAGE_MTD_NANDSUBPAGETEST
+       bool "nandsubpagetest"
+
+endif
+
+comment "MTD test tools need a toolchain w/ threads"
        depends on BR2_USE_MMU
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
 
 endif
index e666bf077c1d10b8393c958d4e067d00770c1e47..a69ef4082e984a372fa384d173e3f82d635c89f4 100644 (file)
@@ -26,9 +26,9 @@ MTD_CONF_OPTS += --without-ubifs
 endif
 
 ifeq ($(BR2_PACKAGE_MTD_TESTS),y)
-MTD_CONF_OPTS += --enable-tests
+MTD_CONF_OPTS += --enable-tests --enable-install-tests
 else
-MTD_CONF_OPTS += --disable-tests
+MTD_CONF_OPTS += --disable-tests --disable-install-tests
 endif
 
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
@@ -90,7 +90,14 @@ MTD_TARGETS_$(BR2_PACKAGE_MTD_UBIRSVOL)              += ubirsvol
 MTD_TARGETS_$(BR2_PACKAGE_MTD_UBIUPDATEVOL)    += ubiupdatevol
 MTD_TARGETS_$(BR2_PACKAGE_MTD_UBIBLOCK)                += ubiblock
 MTD_TARGETS_$(BR2_PACKAGE_MTD_MKFSUBIFS)       += mkfs.ubifs
+MTD_TARGETS_$(BR2_PACKAGE_MTD_FLASH_READTEST)  += flash_readtest
+MTD_TARGETS_$(BR2_PACKAGE_MTD_FLASH_SPEED)     += flash_speed
+MTD_TARGETS_$(BR2_PACKAGE_MTD_FLASH_STRESS)    += flash_stress
+MTD_TARGETS_$(BR2_PACKAGE_MTD_FLASH_TORTURE)   += flash_torture
 MTD_TARGETS_$(BR2_PACKAGE_MTD_INTEGCK)         += integck
+MTD_TARGETS_$(BR2_PACKAGE_MTD_NANDBITERRS)     += nandbiterrs
+MTD_TARGETS_$(BR2_PACKAGE_MTD_NANDPAGETEST)    += nandpagetest
+MTD_TARGETS_$(BR2_PACKAGE_MTD_NANDSUBPAGETEST) += nandsubpagetest
 
 define MTD_INSTALL_TARGET_CMDS
        $(foreach f,$(MTD_TARGETS_y), \