Skip to contentSkip to conversation

e2fsprogs: remove busybox tune2fs when installing full version

PATCH New Ryan Barnett 3 participants 3 messages Jul 8, 2015 – Jul 22, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 e2fsprogs: remove busybox tune2fs when installing full version

Currently, busybox installs a version of tune2fs in /sbin/ while e2fsprogs installs at /usr/sbin/. This causes issues if a user is expecting the to use the full version from a prompt via 'tune2fs' since busybox's tune2fs will be found first from the default path search.

Fix this by removing the busybox version of tune2fs when a user has selected the option to install tune2fs from e2fsprogs.

---
Changes v1 -> v2:
- add condition depenencies on busybox (suggested by Baruch)

---
 package/e2fsprogs/e2fsprogs.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
package/e2fsprogs/e2fsprogs.mk +6 -1
index e0c4ee2..e6a5027 100644
@@ -36,7 +36,8 @@ ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 E2FSPROGS_CONF_ENV += LIBS=-lintl
 endif
 
-E2FSPROGS_DEPENDENCIES = host-pkgconf util-linux
+E2FSPROGS_DEPENDENCIES = host-pkgconf util-linux \
+	$(if $(BR2_PACKAGE_BUSYBOX),busybox)
 
 E2FSPROGS_MAKE_OPTS = \
 	LDCONFIG=true
@@ -102,7 +103,11 @@ ifeq ($(BR2_PACKAGE_E2FSPROGS_E2FSCK),y)
 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_E2FSCK_SYMLINKS
 endif
 
+# Remove busybox tune2fs and e2label since that will take precedence full version
 define E2FSPROGS_TARGET_TUNE2FS_SYMLINK
+	$(if $(BR2_PACKAGE_BUSYBOX), \
+		rm -f $(TARGET_DIR)/sbin/tune2fs; \
+		rm -f $(TARGET_DIR)/sbin/e2label;)
 	ln -sf e2label $(TARGET_DIR)/usr/sbin/tune2fs
 endef
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 e2fsprogs: remove busybox tune2fs when installing full version

Hi Ryan,

Quoted 10 lines · Ryan Barnett

Currently, busybox installs a version of tune2fs in /sbin/ while e2fsprogs installs at /usr/sbin/. This causes issues if a user is expecting the to use the full version from a prompt via 'tune2fs' since busybox's tune2fs will be found first from the default path search.

Fix this by removing the busybox version of tune2fs when a user has selected the option to install tune2fs from e2fsprogs.

baruch

Quoted 32 lines

---
Changes v1 -> v2:
- add condition depenencies on busybox (suggested by Baruch)

---
 package/e2fsprogs/e2fsprogs.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
package/e2fsprogs/e2fsprogs.mk +6 -1
index e0c4ee2..e6a5027 100644
@@ -36,7 +36,8 @@ ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 E2FSPROGS_CONF_ENV += LIBS=-lintl
 endif
 
-E2FSPROGS_DEPENDENCIES = host-pkgconf util-linux
+E2FSPROGS_DEPENDENCIES = host-pkgconf util-linux \
+	$(if $(BR2_PACKAGE_BUSYBOX),busybox)
 
 E2FSPROGS_MAKE_OPTS = \
 	LDCONFIG=true
@@ -102,7 +103,11 @@ ifeq ($(BR2_PACKAGE_E2FSPROGS_E2FSCK),y)
 E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_E2FSCK_SYMLINKS
 endif
 
+# Remove busybox tune2fs and e2label since that will take precedence full version
 define E2FSPROGS_TARGET_TUNE2FS_SYMLINK
+	$(if $(BR2_PACKAGE_BUSYBOX), \
+		rm -f $(TARGET_DIR)/sbin/tune2fs; \
+		rm -f $(TARGET_DIR)/sbin/e2label;)
 	ln -sf e2label $(TARGET_DIR)/usr/sbin/tune2fs
 endef
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH v2 1/1 e2fsprogs: remove busybox tune2fs when installing full version

In reply to Ryan Barnett

Dear Ryan Barnett,

package/e2fsprogs/e2fsprogs.mk ifeq ($(BR2_PACKAGE_E2FSPROGS_E2FSCK),y) · line 112

Quoted 7 lines · Ryan Barnett
package/e2fsprogs/e2fsprogs.mk +4 -0
+# Remove busybox tune2fs and e2label since that will take precedence full version
 define E2FSPROGS_TARGET_TUNE2FS_SYMLINK
+	$(if $(BR2_PACKAGE_BUSYBOX), \
+		rm -f $(TARGET_DIR)/sbin/tune2fs; \
+		rm -f $(TARGET_DIR)/sbin/e2label;)
 	ln -sf e2label $(TARGET_DIR)/usr/sbin/tune2fs
 endef

I really didn't like the hijacking of E2FSPROGS_TARGET_TUNE2FS_SYMLINK for the purposes of Busybox related issues, so I've separated the Busybox related handling into a different post install target hook and committed.

Please check
http://git.buildroot.net/buildroot/commit/?id=aa02829240b2927b2cb379eb904b6f40ff751237

Thanks!

Thomas

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