Skip to contentSkip to conversation

e2fsprogs: propagate LDCONFIG=true

PATCH New Maxime Hadjinlian 4 participants 8 messages Nov 18, 2016 – Mar 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 e2fsprogs: propagate LDCONFIG=true

We correctly set LDCONFIG=true for MAKE_OPTS, but not for the other steps which don't inherit it, to avoid permissions error displayed during the build, we need to set them up.

---
 package/e2fsprogs/e2fsprogs.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/e2fsprogs/e2fsprogs.mk +3 -2
index 022ba52..b01336a 100644
@@ -57,8 +57,9 @@ ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 E2FSPROGS_CONF_ENV += LIBS=-lintl
 endif
 
-E2FSPROGS_MAKE_OPTS = \
-	LDCONFIG=true
+E2FSPROGS_MAKE_OPTS = LDCONFIG=true
+E2FSPROGS_INSTALL_STAGING_OPTS = LDCONFIG=true
+E2FSPROGS_INSTALL_TARGET_OPTS = LDCONFIG=true
 
 define HOST_E2FSPROGS_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install install-libs
Signature · 1 line
2.10.2
#1 lore raw

PATCH 2/2 e2fsprogs: keep util-linux's fsck if chosen

Since e2fsprogs depends on util-linux, it's build after it. It means that if you want the fsck wrapper from util-linux (which is better maintained and you are sure that it's compatible with systemd) and you want e2fsck, it won't work.

Because of the merge of /usr/bin and /bin, we end up deleting the fsck from util-linux.

This makes an attempt at fixing the issues.

---
I am cleary not satisfied by the way I handled that, I am not even sure it works in all cases. I can't spend much more time on this right now, so I need advice/help from the community to fix that in a proper/generic manner.

---
 package/e2fsprogs/e2fsprogs.mk | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
package/e2fsprogs/e2fsprogs.mk +11 -1
index b01336a..97efc9f 100644
@@ -75,7 +75,11 @@ 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
+# don't delete util-linux's fsck if it was selected by the user, especially
+# since e2fsprogs depend's on util-linux.
+ifeq ($(BR2_PACKAGE_UTIL_LINUX_FSCK),)
 E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_FSCK) += usr/sbin/fsck
+endif
 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
@@ -135,11 +139,17 @@ 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
 E2FSPROGS_PRE_INSTALL_TARGET_HOOKS += E2FSPROGS_REMOVE_BUSYBOX_APPLETS
+
+# don't delete util-linux's fsck if it was selected by the user, especially
+# since e2fsprogs depend's on util-linux.
+# It's especially true with the merged /usr when you want to use systemd.
+ifeq ($(BR2_PACKAGE_UTIL_LINUX_FSCK),)
+	E2FSPROGS_REMOVE_BUSYBOX_APPLETS += $(RM) -f $(TARGET_DIR)/sbin/fsck
+endif
 endif
 
 define E2FSPROGS_TARGET_TUNE2FS_SYMLINK
Signature · 1 line
2.10.2
#2 lore raw

PATCH 2/2 e2fsprogs: keep util-linux's fsck if chosen

Quoted 13 lines

From: "Maxime Hadjinlian" <[email protected]>
To: buildroot at buildroot.org
Sent: Friday, November 18, 2016 1:24:27 PM
Subject: [Buildroot] [PATCH 2/2] e2fsprogs: keep util-linux's fsck if chosen

Since e2fsprogs depends on util-linux, it's build after it. It means that if you want the fsck wrapper from util-linux (which is better maintained and you are sure that it's compatible with systemd) and you want e2fsck, it won't work.

Because of the merge of /usr/bin and /bin, we end up deleting the fsck from util-linux.

Quoted 8 lines

This makes an attempt at fixing the issues.

---
I am cleary not satisfied by the way I handled that, I am not even sure it works in all cases. I can't spend much more time on this right now, so I need advice/help from the community to fix that in a proper/generic manner.

What about using something like this, instead?

package/e2fsprogs/Config.in +4 -0
index 4db11e1..c0b48e1 100644
@@ -60,8 +60,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

Carlos Santos (Casantos)
DATACOM, P&D

#3 lore raw

PATCH 2/2 e2fsprogs: keep util-linux's fsck if chosen

Hi there,

Quoted 15 lines · Carlos Santos
Quoted 15 lines

From: "Maxime Hadjinlian" <[email protected]>
To: buildroot at buildroot.org
Sent: Friday, November 18, 2016 1:24:27 PM
Subject: [Buildroot] [PATCH 2/2] e2fsprogs: keep util-linux's fsck if chosen

Since e2fsprogs depends on util-linux, it's build after it. It means that if you want the fsck wrapper from util-linux (which is better maintained and you are sure that it's compatible with systemd) and you want e2fsck, it won't work.

Because of the merge of /usr/bin and /bin, we end up deleting the fsck from util-linux.

This makes an attempt at fixing the issues.

Quoted 7 lines
Quoted 6 lines

---
I am cleary not satisfied by the way I handled that, I am not even sure it works in all cases. I can't spend much more time on this right now, so I need advice/help from the community to fix that in a proper/generic manner.

What about using something like this, instead?

It's indeed better, but you have to keep the bit about the busybox applet due to the merge of /sbin and /usr/sbin

Quoted 23 lines
package/e2fsprogs/Config.in +4 -0
index 4db11e1..c0b48e1 100644
@@ -60,8 +60,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

Carlos Santos (Casantos)
DATACOM, P&D

#4 lore raw

PATCH 2/2 e2fsprogs: keep util-linux's fsck if chosen

Quoted 30 lines

From: "Maxime Hadjinlian" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: "buildroot" <[email protected]>
Sent: Monday, November 21, 2016 12:24:07 PM
Subject: Re: [Buildroot] [PATCH 2/2] e2fsprogs: keep util-linux's fsck if chosen

Hi there,

Quoted 21 lines · Carlos Santos
Quoted 21 lines

From: "Maxime Hadjinlian" <[email protected]>
To: buildroot at buildroot.org
Sent: Friday, November 18, 2016 1:24:27 PM
Subject: [Buildroot] [PATCH 2/2] e2fsprogs: keep util-linux's fsck if chosen

Since e2fsprogs depends on util-linux, it's build after it. It means that if you want the fsck wrapper from util-linux (which is better maintained and you are sure that it's compatible with systemd) and you want e2fsck, it won't work.

Because of the merge of /usr/bin and /bin, we end up deleting the fsck from util-linux.

This makes an attempt at fixing the issues.

---
I am cleary not satisfied by the way I handled that, I am not even sure it works in all cases. I can't spend much more time on this right now, so I need advice/help from the community to fix that in a proper/generic manner.

Quoted 3 lines
Quoted 1 line

What about using something like this, instead?

It's indeed better, but you have to keep the bit about the busybox applet due to the merge of /sbin and /usr/sbin

Right. Looks like combining the changes in Config.in and e2fsprogs.mk is the best approach.

Quoted 22 lines
Quoted 22 lines
package/e2fsprogs/Config.in +4 -0
index 4db11e1..c0b48e1 100644
@@ -60,8 +60,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

Carlos Santos (Casantos)
DATACOM, P&D

#5 lore raw

PATCH 2/2 e2fsprogs: keep util-linux's fsck if chosen

Coming back to this old issue (trigger by the patchwork cleanup initiated by
Thomas)

Quoted 14 lines · Carlos Santos
Quoted 14 lines

From: "Maxime Hadjinlian" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: "buildroot" <[email protected]>
Sent: Monday, November 21, 2016 12:24:07 PM
Subject: Re: [Buildroot] [PATCH 2/2] e2fsprogs: keep util-linux's fsck if chosen

Hi there,

Quoted 5 lines · Carlos Santos
Quoted 4 lines

From: "Maxime Hadjinlian" <[email protected]>
To: buildroot at buildroot.org
Sent: Friday, November 18, 2016 1:24:27 PM
Subject: [Buildroot] [PATCH 2/2] e2fsprogs: keep util-linux's fsck if chosen

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Since e2fsprogs depends on util-linux, it's build after it. It means that if you want the fsck wrapper from util-linux (which is better maintained and you are sure that it's compatible with systemd) and you want e2fsck, it won't work.

Because of the merge of /usr/bin and /bin, we end up deleting the fsck from util-linux.

First of all, I think we should change set --prefix=/ for e2fsprogs. That way,
they are installed in the same location as where busybox and util-linux put them. That removes the need for the E2FSPROGS_REMOVE_BUSYBOX_APPLETS hack.

But then we have the problem that e2fsprogs.mk currently removes all the
programs that it doesn't install. A simple solution would be to remove all the options from Config.in so that the removals are not needed anymore.

Of course, that will do exactly the opposite of what you want to achieve here,
since e2fsprogs will override everything from util-linux... But for that, there happens to be a simple solution: --disable-fsck doesn't build and install fsck (without affecting e2fsck). (Of course, I didn't actually test this, just looked at configure.ac and Makefile.in.)

Quoted 22 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

This makes an attempt at fixing the issues.

---
I am cleary not satisfied by the way I handled that, I am not even sure it works in all cases. I can't spend much more time on this right now, so I need advice/help from the community to fix that in a proper/generic manner.

Quoted 3 lines
Quoted 1 line

What about using something like this, instead?

It's indeed better, but you have to keep the bit about the busybox applet due to the merge of /sbin and /usr/sbin

Right. Looks like combining the changes in Config.in and e2fsprogs.mk is the best approach.

Quoted 7 lines
Quoted 7 lines
package/e2fsprogs/Config.in +0 -0
index 4db11e1..c0b48e1 100644
@@ -60,8 +60,12 @@ config BR2_PACKAGE_E2FSPROGS_FILEFRAG
 
Quoted 3 lines
Quoted 3 lines

package/e2fsprogs/Config.in config BR2_PACKAGE_E2FSPROGS_FILEFRAG · line 63

Quoted 3 lines
package/e2fsprogs/Config.in +1 -0
 config BR2_PACKAGE_E2FSPROGS_FSCK
        bool "fsck"
+       depends on !BR2_PACKAGE_UTIL_LINUX_FSCK

This looks like a good idea.

Quoted 5 lines
Quoted 5 lines

package/e2fsprogs/Config.in config BR2_PACKAGE_E2FSPROGS_FILEFRAG · line 68

Quoted 5 lines
package/e2fsprogs/Config.in +3 -0
        default y
 
+comment "the fsck from util-linux has preference over this one"
+       depends on BR2_PACKAGE_UTIL_LINUX_FSCK
+

I don't think the comment is needed.

Regards,
Arnout

Quoted 12 lines
Quoted 7 lines
Quoted 7 lines
package/e2fsprogs/Config.in +0 -0
 config BR2_PACKAGE_E2FSPROGS_FUSE2FS
        bool "fuse2fs"
        depends on !BR2_STATIC_LIBS # libfuse

Carlos Santos (Casantos)
DATACOM, P&D

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#6 lore raw

PATCH 2/2 e2fsprogs: keep util-linux's fsck if chosen

Quoted 26 lines · Arnout Vandecappelle

Coming back to this old issue (trigger by the patchwork cleanup initiated by
Thomas)

Quoted 14 lines · Carlos Santos
Quoted 14 lines

From: "Maxime Hadjinlian" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: "buildroot" <[email protected]>
Sent: Monday, November 21, 2016 12:24:07 PM
Subject: Re: [Buildroot] [PATCH 2/2] e2fsprogs: keep util-linux's fsck if chosen

Hi there,

Quoted 5 lines · Carlos Santos
Quoted 4 lines

From: "Maxime Hadjinlian" <[email protected]>
To: buildroot at buildroot.org
Sent: Friday, November 18, 2016 1:24:27 PM
Subject: [Buildroot] [PATCH 2/2] e2fsprogs: keep util-linux's fsck if chosen

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Since e2fsprogs depends on util-linux, it's build after it. It means that if you want the fsck wrapper from util-linux (which is better maintained and you are sure that it's compatible with systemd) and you want e2fsck, it won't work.

Because of the merge of /usr/bin and /bin, we end up deleting the fsck from util-linux.

Quoted 7 lines

First of all, I think we should change set --prefix=/ for e2fsprogs. That way,
they are installed in the same location as where busybox and util-linux put them. That removes the need for the E2FSPROGS_REMOVE_BUSYBOX_APPLETS hack.

But then we have the problem that e2fsprogs.mk currently removes all the
programs that it doesn't install. A simple solution would be to remove all the options from Config.in so that the removals are not needed anymore.

Note that this would also fix bug 9436.

Quoted 29 lines

Of course, that will do exactly the opposite of what you want to achieve here,
since e2fsprogs will override everything from util-linux... But for that, there happens to be a simple solution: --disable-fsck doesn't build and install fsck (without affecting e2fsck). (Of course, I didn't actually test this, just looked at configure.ac and Makefile.in.)

Quoted 22 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

This makes an attempt at fixing the issues.

---
I am cleary not satisfied by the way I handled that, I am not even sure it works in all cases. I can't spend much more time on this right now, so I need advice/help from the community to fix that in a proper/generic manner.

Quoted 3 lines
Quoted 1 line

What about using something like this, instead?

It's indeed better, but you have to keep the bit about the busybox applet due to the merge of /sbin and /usr/sbin

Right. Looks like combining the changes in Config.in and e2fsprogs.mk is the best approach.

Quoted 7 lines
Quoted 7 lines
package/e2fsprogs/Config.in +0 -0
index 4db11e1..c0b48e1 100644
@@ -60,8 +60,12 @@ config BR2_PACKAGE_E2FSPROGS_FILEFRAG
 
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

package/e2fsprogs/Config.in config BR2_PACKAGE_E2FSPROGS_FILEFRAG · line 63

Quoted 3 lines
package/e2fsprogs/Config.in +1 -0
 config BR2_PACKAGE_E2FSPROGS_FSCK
        bool "fsck"
+       depends on !BR2_PACKAGE_UTIL_LINUX_FSCK

This looks like a good idea.

Since we agree that the Config.in change is needed as well, I've marked this
patch as Changes Requested.

Regards,
Arnout

Quoted 25 lines
Quoted 6 lines
Quoted 6 lines

package/e2fsprogs/Config.in config BR2_PACKAGE_E2FSPROGS_FILEFRAG · line 68

Quoted 6 lines
package/e2fsprogs/Config.in +3 -0
        default y
 
+comment "the fsck from util-linux has preference over this one"
+       depends on BR2_PACKAGE_UTIL_LINUX_FSCK
+

I don't think the comment is needed.

Regards,
Arnout

Quoted 12 lines
Quoted 7 lines
Quoted 7 lines
package/e2fsprogs/Config.in +0 -0
 config BR2_PACKAGE_E2FSPROGS_FUSE2FS
        bool "fuse2fs"
        depends on !BR2_STATIC_LIBS # libfuse

Carlos Santos (Casantos)
DATACOM, P&D

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#7 lore raw

PATCH 1/2 e2fsprogs: propagate LDCONFIG=true

In reply to Maxime Hadjinlian

Hello,

Quoted 8 lines · Maxime Hadjinlian

We correctly set LDCONFIG=true for MAKE_OPTS, but not for the other steps which don't inherit it, to avoid permissions error displayed during the build, we need to set them up.

---
 package/e2fsprogs/e2fsprogs.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas

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