Browse Source

package/e2fsprogs: add option for e2scrub

The e2scrib tool has various requirements:

  - e2scrub and its associated helpers, are bash scripts

  - e2scrub_all depends on coreutils' readlink; busybox readlink is
    missing some options:
        readlink: invalid option -- 'e'

  - by design, e2scrub only works on an LVM volume

Add an option to enable e2scrub. This is probably seldom used, so it
does not warrant the usual dance about BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
and selecting the tools; we can just depend on the required tools.

Signed-off-by: Tian Yuanhao <tianyuanhao@aliyun.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: James Hilliard <james.hilliard1@gmail.com>
[yann.morin.1998@free.fr:
  - add a kconfig option like for other tools
  - move the conditions to that new option
  - reword the commit log accordingly
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tian Yuanhao 4 years ago
parent
commit
40dee9a19f
2 changed files with 23 additions and 0 deletions
  1. 13 0
      package/e2fsprogs/Config.in
  2. 10 0
      package/e2fsprogs/e2fsprogs.mk

+ 13 - 0
package/e2fsprogs/Config.in

@@ -31,6 +31,19 @@ config BR2_PACKAGE_E2FSPROGS_E2IMAGE
 	help
 	  Save critical ext2/ext3/ext4 filesystem metadata to a file
 
+config BR2_PACKAGE_E2FSPROGS_E2SCRUB
+	bool "e2scrub"
+	depends on BR2_PACKAGE_BASH  # runtime
+	depends on BR2_PACKAGE_COREUTILS  # runtime
+	depends on BR2_PACKAGE_LVM2  # runtime
+	depends on BR2_PACKAGE_UTIL_LINUX  # runtime
+	help
+	  Check the contents of a mounted ext[234] filesystem
+
+comment "e2scrub needs bash, coreutils, lvm2, and util-linux"
+	depends on !BR2_PACKAGE_BASH || !BR2_PACKAGE_COREUTILS \
+		|| !BR2_PACKAGE_LVM2 || !BR2_PACKAGE_UTIL_LINUX
+
 config BR2_PACKAGE_E2FSPROGS_E4DEFRAG
 	bool "e4defrag"
 	depends on !BR2_nios2 # fallocate not implemented

+ 10 - 0
package/e2fsprogs/e2fsprogs.mk

@@ -74,6 +74,16 @@ E2FSPROGS_INSTALL_STAGING_OPTS = \
 	DESTDIR=$(STAGING_DIR) \
 	install-libs
 
+# e2scrub has no associated --enable/disable option
+ifneq ($(BR2_PACKAGE_E2FSPROGS_E2SCRUB),y)
+E2FSPROGS_MAKE_OPTS += E2SCRUB_DIR=
+endif
+
+E2FSPROGS_INSTALL_TARGET_OPTS = \
+	$(E2FSPROGS_MAKE_OPTS) \
+	DESTDIR=$(TARGET_DIR) \
+	install
+
 # Package does not build in parallel due to improper make rules
 define HOST_E2FSPROGS_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D) install install-libs