Skip to contentSkip to conversation

e2fsprogs: prevent undesired cleanup with a usr merged target

PATCH New James Knight 2 participants 2 messages Oct 28, 2015 – Nov 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e2fsprogs: prevent undesired cleanup with a usr merged target

The following commit prevents the e2fsprogs package from inadvertently removing its own binaries when a target includes BusyBox and is targeting a usr-merged environment.

While an action has been added to cleanup BusyBox-provided (if any) ext2-related tools when including e2fsprogs, the action will delete desired e2fsprogs binaries in an already prepared usr-merged target. Adjusting the cleanup to occur before installing e2fsprogs binaries so that if a usr-merged target exists, it will first delete the previous binaries (if any) followed by installing new binaries.

---
 package/e2fsprogs/e2fsprogs.mk | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
package/e2fsprogs/e2fsprogs.mk +11 -4
index 178372b..4b81b44 100644
@@ -106,9 +106,16 @@ ifeq ($(BR2_PACKAGE_E2FSPROGS_E2FSCK),y)
 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_E2FSCK_SYMLINKS
 endif
 
-# Remove busybox tune2fs and e2label, since we want the e2fsprogs full
-# blown variants to take precedence, but they are not installed in the
-# same location.
+# If BusyBox is included, its configuration may supply its own variant
+# of ext2-related tools. Since Buildroot desires having full blown
+# variants take precedence (in this case, e2fsprogs), we want to remove
+# BusyBox's variant of e2fsprogs provided binaries. e2fsprogs targets
+# /usr/{bin,sbin} where BusyBox targets /{bin,sbin}. We will attempt to
+# remove BusyBox-generated ext2-related tools from /{bin,sbin}. We need
+# to do this in the pre-install stage to ensure we do not accidentally
+# remove e2fsprogs's binaries in usr-merged environments (ie. if they
+# are removed, they would be re-installed in this package's install
+# stage).
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 E2FSPROGS_DEPENDENCIES += busybox
 
@@ -119,7 +126,7 @@ define E2FSPROGS_REMOVE_BUSYBOX_APPLETS
 	$(RM) -f $(TARGET_DIR)/sbin/tune2fs
 	$(RM) -f $(TARGET_DIR)/sbin/e2label
 endef
-E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_REMOVE_BUSYBOX_APPLETS
+E2FSPROGS_PRE_INSTALL_TARGET_HOOKS += E2FSPROGS_REMOVE_BUSYBOX_APPLETS
 endif
 
 define E2FSPROGS_TARGET_TUNE2FS_SYMLINK
Signature · 1 line
1.9.5.msysgit.1
#1 lore raw

PATCH 1/1 e2fsprogs: prevent undesired cleanup with a usr merged target

Dear James Knight,

Quoted 11 lines · James Knight

The following commit prevents the e2fsprogs package from inadvertently removing its own binaries when a target includes BusyBox and is targeting a usr-merged environment.

While an action has been added to cleanup BusyBox-provided (if any) ext2-related tools when including e2fsprogs, the action will delete desired e2fsprogs binaries in an already prepared usr-merged target. Adjusting the cleanup to occur before installing e2fsprogs binaries so that if a usr-merged target exists, it will first delete the previous binaries (if any) followed by installing new binaries.

Quoted 4 lines
---
 package/e2fsprogs/e2fsprogs.mk | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com