diff mbox

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

Message ID 1395583071-10016-1-git-send-email-tremyfr@yahoo.fr
State Superseded
Headers show

Commit Message

trem March 23, 2014, 1:57 p.m. UTC
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.

Signed-off-by: Philippe Reynes <tremyfr@yahoo.fr>
---
 Makefile |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

Peter Korsgaard March 26, 2014, 9:39 p.m. UTC | #1
>>>>> "Philippe" == Philippe Reynes <tremyfr@yahoo.fr> 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.

 > Signed-off-by: Philippe Reynes <tremyfr@yahoo.fr>
 > ---
 >  Makefile |    3 +--
 >  1 files changed, 1 insertions(+), 2 deletions(-)

 > diff --git a/Makefile b/Makefile
 > index d49d7bf..07e6c74 100644
 > --- a/Makefile
 > +++ b/Makefile
 > @@ -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
 > -

Hmm, does that really work? Does the locale data get correctly purged /
generated before the filesystem images are generated?
trem March 27, 2014, 6:17 p.m. UTC | #2
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 <jacmet@uclibc.org> a écrit :
 
>>>>> "Philippe" == Philippe Reynes <tremyfr@yahoo.fr> 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.

> Signed-off-by: Philippe Reynes <tremyfr@yahoo.fr>
> ---
>  Makefile |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)

> diff --git a/Makefile b/Makefile
> index d49d7bf..07e6c74 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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
> -

Hmm, does that really work? Does the locale data get correctly purged /
generated before the filesystem images are generated?
Peter Korsgaard March 27, 2014, 9:32 p.m. UTC | #3
>>>>> "Philippe" == Philippe Reynes <tremyfr@yahoo.fr> 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.

 > 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.
trem March 30, 2014, 7:02 p.m. UTC | #4
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 <jacmet@uclibc.org> a écrit :
 
>>>>> "Philippe" == Philippe Reynes <tremyfr@yahoo.fr> 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.

> 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.
Thomas De Schampheleire May 5, 2014, 7:47 a.m. UTC | #5
Hi Peter,

On Thu, Mar 27, 2014 at 10:32 PM, Peter Korsgaard <jacmet@uclibc.org> wrote:
>>>>>> "Philippe" == Philippe Reynes <tremyfr@yahoo.fr> 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.
>
>  > 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
Peter Korsgaard May 5, 2014, 9:37 a.m. UTC | #6
>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:

Hi,

 >> 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.

Thanks!

 > 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 ;)
diff mbox

Patch

diff --git a/Makefile b/Makefile
index d49d7bf..07e6c74 100644
--- a/Makefile
+++ b/Makefile
@@ -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))