Skip to content

Commit ea4d1a8

Browse files
cyrilbur-ibmmpe
authored andcommitted
powerpc/configs: Replace pseries_le_defconfig with a Makefile target using merge_config
Rather than continuing to maintain a copy of pseries_defconfig with CONFIG_CPU_LITTLE_ENDIAN enabled, use the generic merge_config script and use an le.config to enable little endian on top of pseries_defconfig without the need for a duplicated _defconfig file. This method will require less maintenance in the future and will ensure that both 'defconfigs' are always in sync. It is worth noting that the seemingly more simple approach of: pseries_le_defconfig: pseries_defconfig $(Q)$(MAKE) le.config Will not work when building using O=builddir. The obvious fix to that: pseries_le_defconfig: $(Q)$(MAKE) -f $(srctree)/Makefile pseries_defconfig le.config Also does not work. This is because if we have for example: config FOO depends on CPU_BIG_ENDIAN select BAR Then BAR will be enabled by the first call to kconfig (via pseries_defconfig), and then will remain enabled after we merge le.config, even though FOO will have been turned off. The solution is to ensure to only invoke the kconfig logic once, after we have merged all the config fragments. This ensures nothing is select'ed on that should then be disabled by the later merged configs. This is done through the explicit call to make olddefconfig Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Reviewed-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> [mpe: Massage change log, fix white space and use ARCH not SRCARCH] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent a1c97df commit ea4d1a8

3 files changed

Lines changed: 16 additions & 319 deletions

File tree

‎arch/powerpc/Makefile‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,21 @@ bootwrapper_install:
269269
%.dtb: scripts
270270
$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
271271

272+
# Used to create 'merged defconfigs'
273+
# To use it $(call) it with the first argument as the base defconfig
274+
# and the second argument as a space separated list of .config files to merge,
275+
# without the .config suffix.
276+
define merge_into_defconfig
277+
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
278+
-m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \
279+
$(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config)
280+
+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
281+
endef
282+
283+
PHONY += pseries_le_defconfig
284+
pseries_le_defconfig:
285+
$(call merge_into_defconfig,pseries_defconfig,le)
286+
272287
define archhelp
273288
@echo '* zImage - Build default images selected by kernel config'
274289
@echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'

‎arch/powerpc/configs/le.config‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_CPU_LITTLE_ENDIAN=y

‎arch/powerpc/configs/pseries_le_defconfig‎

Lines changed: 0 additions & 319 deletions
This file was deleted.

0 commit comments

Comments
 (0)