@@ -59,8 +59,12 @@ config BR2_PACKAGE_E2FSPROGS_FILEFRAG
config BR2_PACKAGE_E2FSPROGS_FSCK
bool "fsck"
+ depends on !BR2_PACKAGE_UTIL_LINUX_FSCK
default y
+comment "the fsck from util-linux has preference over this one"
+ depends on BR2_PACKAGE_UTIL_LINUX_FSCK
+
config BR2_PACKAGE_E2FSPROGS_FUSE2FS
bool "fuse2fs"
depends on !BR2_STATIC_LIBS # libfuse
@@ -11,7 +11,7 @@ E2FSPROGS_LICENSE = GPL-2.0, BSD-3-Clause (libuuid), MIT-like with advertising c
E2FSPROGS_LICENSE_FILES = NOTICE lib/uuid/COPYING lib/ss/mit-sipb-copyright.h lib/et/internal.h
E2FSPROGS_INSTALL_STAGING = YES
E2FSPROGS_DEPENDENCIES = host-pkgconf util-linux
-# we don't have a host-util-linux
+# We don't need host-util-linux, since we disable libblkid, libuuid.
HOST_E2FSPROGS_DEPENDENCIES = host-pkgconf
# e4defrag doesn't build on older systems like RHEL5.x, and we don't
@@ -24,11 +24,11 @@ E2FSPROGS_CONF_OPTS = \
$(if $(BR2_PACKAGE_E2FSPROGS_DEBUGFS),,--disable-debugfs) \
$(if $(BR2_PACKAGE_E2FSPROGS_E2IMAGE),,--disable-imager) \
$(if $(BR2_PACKAGE_E2FSPROGS_E4DEFRAG),,--disable-defrag) \
+ $(if $(BR2_PACKAGE_E2FSPROGS_FSCK),--enable-fsck,--disable-fsck) \
$(if $(BR2_PACKAGE_E2FSPROGS_RESIZE2FS),,--disable-resizer) \
--disable-uuidd \
--disable-libblkid \
--disable-libuuid \
- --enable-fsck \
--disable-e2initrd-helper \
--disable-testio-debug \
--disable-rpath
@@ -76,7 +76,9 @@ define HOST_E2FSPROGS_INSTALL_CMDS
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install install-libs
endef
-# binaries to keep or remove
+# Binaries to keep or remove. For fsck, there is no conflict with the
+# one from util-linux (because they are mutually exclusive) and fsck
+# from busybox is handled below.
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_BADBLOCKS) += usr/sbin/badblocks
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_CHATTR) += usr/bin/chattr
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_DUMPE2FS) += usr/sbin/dumpe2fs
@@ -86,7 +88,6 @@ E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2LABEL) += usr/sbin/e2label
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E2UNDO) += usr/sbin/e2undo
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_E4DEFRAG) += usr/sbin/e4defrag
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_FILEFRAG) += usr/sbin/filefrag
-E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_FSCK) += usr/sbin/fsck
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_LOGSAVE) += usr/sbin/logsave
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_LSATTR) += usr/bin/lsattr
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_MKE2FS) += usr/sbin/mke2fs
@@ -146,10 +147,16 @@ E2FSPROGS_DEPENDENCIES += busybox
define E2FSPROGS_REMOVE_BUSYBOX_APPLETS
$(RM) -f $(TARGET_DIR)/bin/chattr
$(RM) -f $(TARGET_DIR)/bin/lsattr
- $(RM) -f $(TARGET_DIR)/sbin/fsck
$(RM) -f $(TARGET_DIR)/sbin/tune2fs
$(RM) -f $(TARGET_DIR)/sbin/e2label
endef
+
+# We only build fsck if it's not selected in util-linux, on which e2fsprogs
+# depends, so at this point /sbin/fsck must have come from busybox.
+ifeq ($(BR2_PACKAGE_E2FSPROGS_FSCK),y)
+E2FSPROGS_REMOVE_BUSYBOX_APPLETS += $(RM) -f $(TARGET_DIR)/sbin/fsck
+endif
+
E2FSPROGS_PRE_INSTALL_TARGET_HOOKS += E2FSPROGS_REMOVE_BUSYBOX_APPLETS
endif