core/pkg-kconfig: handle generated defconfigs
As of Linux kernel commit
ea4d1a8 "powerpc/configs: Replace
pseries_le_defconfig with a Makefile target using merge_config" some
kconfig defconfigs (one so far: "pseries_le_defconfig") can be
generated using "make <defconfig>" and they do not exist on disk as a
single defconfig file.
This causes buildroot's build to fail for those configs with:
'arch/powerpc/configs/pseries_le_defconfig' for 'linux' does not exist
To handle this case and keep the makefile steps as simple as possible,
introduce a new package variable, *_KCONFIG_DEFCONFIG, that can be
used to indicate that a defconfig rule is being used, rather than a
file.
This allows the rule that generates the .config file to use either the
provided file (by copying) or a generated defconfig (by running "make
<defconfig>") as its starting point. merge_config.sh can then be run the
same way in either case, using .config as both input and output.
Note that merge_config.sh is now modifying .config in-place but this
is safe because it uses a temporary copy while making changes.
This patch introduces the new variable but does not make use of it.
Use of the new variable will be introduced in separate patches.
Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
[yann.morin.1998@free.fr:
- include all the other kconfig-package hunks into this one patch
- do not transform the 'echo "..."; exit 1' into $(error ...) calls
- use a make $(if)-block instead of a shell if-block to copy the file
or run make (like is done to check the kconfig snippets)
- misc typoes and rephrasing in the commit log
- do not force the _defconfig suffix in the infra (Thomas)
]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>