Skip to contentSkip to conversation

Makefile: move fs/common.mk above external.mk

PATCH New Philippe Reynes 3 participants 7 messages Mar 23, 2014 – May 5, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: move fs/common.mk above external.mk

The file external.mk was included before fs/common.mk, so it was impossible to add rootfs target to external. This change move fs/common.mk before external.mk, so now rootfs target may be added to external.

---
 Makefile |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Makefile +1 -2
index d49d7bf..07e6c74 100644
@@ -391,6 +391,7 @@ include $(sort $(wildcard package/*/*.mk))
 include boot/common.mk
 include linux/linux.mk
 include system/system.mk
+include fs/common.mk
 
 include $(BR2_EXTERNAL)/external.mk
 
@@ -408,8 +409,6 @@ ifeq ($(BR2_ECLIPSE_REGISTER),y)
 TARGETS+=toolchain-eclipse-register
 endif
 
-include fs/common.mk
-
 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS))
 TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
 
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 1/1 Makefile: move fs/common.mk above external.mk

Quoted 25 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Philippe" == Philippe Reynes <[email protected]> writes:

The file external.mk was included before fs/common.mk, so it was impossible to add rootfs target to external. This change move fs/common.mk before external.mk, so now rootfs target may be added to external.

---
 Makefile |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Makefile +1 -0
index d49d7bf..07e6c74 100644
@@ -391,6 +391,7 @@ include $(sort $(wildcard package/*/*.mk))
 include boot/common.mk
 include linux/linux.mk
 include system/system.mk
+include fs/common.mk
 
 include $(BR2_EXTERNAL)/external.mk
 

Makefile ifeq ($(BR2_ECLIPSE_REGISTER),y) · line 412

Quoted 5 lines
Makefile +0 -2
@@ -408,8 +409,6 @@ ifeq ($(BR2_ECLIPSE_REGISTER),y)
 TARGETS+=toolchain-eclipse-register
 endif
 
-include fs/common.mk
-

Hmm, does that really work? Does the locale data get correctly purged / generated before the filesystem images are generated?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 Makefile: move fs/common.mk above external.mk

Hi Peter,

I've done a little test before sending this patch. I've used this useless fs :

define ROOTFS_USERFS_CMD
??? echo "Nothing to do" ; \
??? touch $@
endef

$(eval $(call ROOTFS_TARGET,userfs))

In the file $(BR2_EXTERNAL)/fs/common.mk

Without my patch, the file rootfs.userfs is not created. With my patch, the file rootfs.userfs is created.

I could have missed something.
Do you have an idea of what may failed ?

Regards,
Philippe

Le Mercredi 26 mars 2014 22h39, Peter Korsgaard <[email protected]> a ?crit :

Quoted 29 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Philippe" == Philippe Reynes <[email protected]> writes:

The file external.mk was included before fs/common.mk, so it was impossible to add rootfs target to external. This change move fs/common.mk before external.mk, so now rootfs target may be added to external.

---
? Makefile |? ? 3 +--
? 1 files changed, 1 insertions(+), 2 deletions(-)

Makefile +0 -0
index d49d7bf..07e6c74 100644
@@ -391,6 +391,7 @@ include $(sort $(wildcard package/*/*.mk))

? include boot/common.mk
? include linux/linux.mk
? include system/system.mk
+include fs/common.mk

? include $(BR2_EXTERNAL)/external.mk

Makefile +0 -0
@@ -408,8 +409,6 @@ ifeq ($(BR2_ECLIPSE_REGISTER),y)

? TARGETS+=toolchain-eclipse-register
? endif

Makefile ifeq ($(BR2_ECLIPSE_REGISTER),y) · line 412

Quoted 2 lines
Makefile +0 -2
-include fs/common.mk
-

Hmm, does that really work? Does the locale data get correctly purged / generated before the filesystem images are generated?

Signature · 4 lines
Bye, Peter Korsgaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140327/8e1fef56/attachment.html>
#3 lore raw

PATCH 1/1 Makefile: move fs/common.mk above external.mk

Quoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Philippe" == Philippe Reynes <[email protected]> writes:

Hi Peter,
I've done a little test before sending this patch. I've used this useless fs :

define ROOTFS_USERFS_CMD

    echo "Nothing to do" ; \
    touch $@

endef

$(eval $(call ROOTFS_TARGET,userfs))

Quoted 7 lines

In the file $(BR2_EXTERNAL)/fs/common.mk

Without my patch, the file rootfs.userfs is not created. With my patch, the file rootfs.userfs is created.

I could have missed something.
Do you have an idea of what may failed ?

The specific issue I mentioned was about the externally defined rootfs getting created before target-purgelocales / target-generatelocales gets called. The easiest way to check that is to use a glibc toolchain and enable BR2_ENABLE_LOCALE_PURGE / BR2_GENERATE_LOCALE, and then stick an echo statement in each of them.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 Makefile: move fs/common.mk above external.mk

Hi peter,

I think I understand the issue now (thanks to Thomas and Yann). The filesystem target depend on target-finalize, and target-finalize depends on targets.

grep -n target-finalize Makefile
513:$(TARGETS_ROOTFS): target-finalize
515:target-finalize: $(TARGETS)

So even if we move fs/common.mk above external.mk, the filesystem targets will always be done after targets. So I think that this change should be safe.

Best regards,
Philippe

Le , Peter Korsgaard <[email protected]> a ?crit :

Quoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Philippe" == Philippe Reynes <[email protected]> writes:

Hi Peter,
I've done a little test before sending this patch. I've used this useless fs :

define ROOTFS_USERFS_CMD
? ? echo "Nothing to do" ; \
? ? touch $@
endef

$(eval $(call ROOTFS_TARGET,userfs))

Quoted 7 lines

In the file $(BR2_EXTERNAL)/fs/common.mk

Without my patch, the file rootfs.userfs is not created. With my patch, the file rootfs.userfs is created.

I could have missed something.
Do you have an idea of what may failed ?

The specific issue I mentioned was about the externally defined rootfs getting created before
target-purgelocales / target-generatelocales gets
called. The easiest way to check that is to use a glibc toolchain and enable BR2_ENABLE_LOCALE_PURGE / BR2_GENERATE_LOCALE, and then stick an echo statement in each of them.

Signature · 4 lines
Bye, Peter Korsgaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140330/ee1b7964/attachment.html>
#5 lore raw

PATCH 1/1 Makefile: move fs/common.mk above external.mk

In reply to Peter Korsgaard

Hi Peter,

Quoted 18 lines · Peter Korsgaard
Quoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Philippe" == Philippe Reynes <[email protected]> writes:

Hi Peter,
I've done a little test before sending this patch. I've used this useless fs :

define ROOTFS_USERFS_CMD

    echo "Nothing to do" ; \
    touch $@

endef

$(eval $(call ROOTFS_TARGET,userfs))

In the file $(BR2_EXTERNAL)/fs/common.mk

Without my patch, the file rootfs.userfs is not created. With my patch, the file rootfs.userfs is created.

Quoted 9 lines
Quoted 2 lines

I could have missed something.
Do you have an idea of what may failed ?

The specific issue I mentioned was about the externally defined rootfs getting created before target-purgelocales / target-generatelocales gets called. The easiest way to check that is to use a glibc toolchain and enable BR2_ENABLE_LOCALE_PURGE / BR2_GENERATE_LOCALE, and then stick an echo statement in each of them.

I performed this test, and can confirm that all is well:
purging/generating of locale data is done before the filesystem is created, in the order generate / purge / rootfs.

So moving that line does not impact the behavior with respect to locales.

As the patch does no longer cleanly apply, I'll send a new version. Do you still consider this for 2014.05 or is it too late/risky in your opinion?

Thanks,
Thomas

#6 lore raw

PATCH 1/1 Makefile: move fs/common.mk above external.mk

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas De Schampheleire <[email protected]> writes:

Hi,

Quoted 7 lines
Quoted 6 lines

The specific issue I mentioned was about the externally defined rootfs getting created before target-purgelocales / target-generatelocales gets called. The easiest way to check that is to use a glibc toolchain and enable BR2_ENABLE_LOCALE_PURGE / BR2_GENERATE_LOCALE, and then stick an echo statement in each of them.

Quoted 5 lines

I performed this test, and can confirm that all is well:
purging/generating of locale data is done before the filesystem is created, in the order generate / purge / rootfs.

So moving that line does not impact the behavior with respect to locales.

Thanks!

Quoted 2 lines

As the patch does no longer cleanly apply, I'll send a new version. Do you still consider this for 2014.05 or is it too late/risky in your opinion?

If you tested it then I'm Ok with it ;)

Signature · 1 line
Bye, Peter Korsgaard