Skip to contentSkip to conversation

infra/pkg-kconfig: fix saving the config file

PATCH New Yann E. MORIN 3 participants 3 messages Oct 20, 2014 – Oct 22, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infra/pkg-kconfig: fix saving the config file

When saving (aka updating) the configuration file of a kconfig package, a subsequent call to "make" would rebuild the package, even though the configuration did not actually change.

It took quite a while to understand why. But the reason is so simple and obvious, when you think about it:

- $(@D)/.config depends on the config file $(BUSYBOX_CONFIG_FILE)
- busybox-update-config then copies $(@D)/.config back to the config

    file $(BUSYBOX_CONFIG_FILE)

- so the config file is newer than $(@D)/.config

So, in the next run, pkg-kconfig believes that it has to rebuild busybox. Bummer... :-/

So, the fix is very trivial, and just requires asking "cp" to preserve timestamps, so the dependency does not kick in at the next run.

Cc Thomas De Schampheleire <[email protected]>
---
 package/pkg-kconfig.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-kconfig.mk +1 -1
index 071153a..ec58d69 100644
@@ -66,7 +66,7 @@ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_
 
 # Target to copy back the configuration to the source configuration file
 $(1)-update-config: $$($(2)_DIR)/.stamp_kconfig_fixup_done
-	cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
+	cp --preserve=timestamps -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
 
 endef # inner-kconfig-package
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 infra/pkg-kconfig: fix saving the config file

Quoted 12 lines · Yann E. MORIN

When saving (aka updating) the configuration file of a kconfig package, a subsequent call to "make" would rebuild the package, even though the configuration did not actually change.

It took quite a while to understand why. But the reason is so simple and obvious, when you think about it:

- $(@D)/.config depends on the config file $(BUSYBOX_CONFIG_FILE)
- busybox-update-config then copies $(@D)/.config back to the config

    file $(BUSYBOX_CONFIG_FILE)

- so the config file is newer than $(@D)/.config

Quoted 8 lines

So, in the next run, pkg-kconfig believes that it has to rebuild busybox. Bummer... :-/

So, the fix is very trivial, and just requires asking "cp" to preserve timestamps, so the dependency does not kick in at the next run.

Cc Thomas De Schampheleire <[email protected]>
#2 lore raw

PATCH 1/1 infra/pkg-kconfig: fix saving the config file

In reply to Yann E. MORIN

Dear Yann E. MORIN,

Quoted 12 lines · Yann E. MORIN

When saving (aka updating) the configuration file of a kconfig package, a subsequent call to "make" would rebuild the package, even though the configuration did not actually change.

It took quite a while to understand why. But the reason is so simple and obvious, when you think about it:

- $(@D)/.config depends on the config file $(BUSYBOX_CONFIG_FILE)
- busybox-update-config then copies $(@D)/.config back to the config

    file $(BUSYBOX_CONFIG_FILE)

- so the config file is newer than $(@D)/.config

Quoted 8 lines

So, in the next run, pkg-kconfig believes that it has to rebuild busybox. Bummer... :-/

So, the fix is very trivial, and just requires asking "cp" to preserve timestamps, so the dependency does not kick in at the next run.

Cc Thomas De Schampheleire <[email protected]>

Applied, thanks.

Thomas

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