Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/3] Transformation of package 'at91bootstrap3' to KConfig style.
Date: Mon, 06 Apr 2015 16:16:37 +0200	[thread overview]
Message-ID: <55229545.4010103@mind.be> (raw)
In-Reply-To: <20150406133219.GE4369@free.fr>

On 06/04/15 15:32, Yann E. MORIN wrote:
> Thomas, Mauro, All,
> 
> On 2015-04-06 12:20 +0200, Thomas Petazzoni spake thusly:
>> Adding our kconfig-package guys Yann and Thomas DS in Cc. See below for
>> some comments.
>>
>> On Sun,  8 Mar 2015 22:37:08 +0100, Mauro Condarelli wrote:
>>>
>>> Signed-off-by: Mauro Condarelli <mc5686@mclink.it>
>>> ---
>>>  boot/at91bootstrap3/at91bootstrap3.mk |    9 ++++++++-
>>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/boot/at91bootstrap3/at91bootstrap3.mk b/boot/at91bootstrap3/at91bootstrap3.mk
>>> index 098e7bf..37e1bdd 100644
>>> --- a/boot/at91bootstrap3/at91bootstrap3.mk
>>> +++ b/boot/at91bootstrap3/at91bootstrap3.mk
>>> @@ -46,7 +46,14 @@ define AT91BOOTSTRAP3_INSTALL_IMAGES_CMDS
>>>  	cp $(@D)/binaries/*.bin $(BINARIES_DIR)
>>>  endef
>>>  
>>> -$(eval $(generic-package))
>>> +ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
>>> +AT91BOOTSTRAP3_KCONFIG_FILE = $(call qstrip,$(AT91BOOTSTRAP3_DEFCONFIG))
>>> +else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
>>> +AT91BOOTSTRAP3_KCONFIG_FILE = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
>>> +endif
>>> +AT91BOOTSTRAP3_KCONFIG_EDITORS = menuconfig xconfig gconfig
>>> +AT91BOOTSTRAP3_KCONFIG_OPTS = $(AT91BOOTSTRAP3_MAKE_OPTS)
>>> +$(eval $(kconfig-package))
>>
>> This is not going far enough: the kconfig-package infra is taking care
>> of implementing the <pkg>_CONFIGURE_CMDS for you. So the following
>> chunk of code should go away:
>>
>> ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
>> define AT91BOOTSTRAP3_CONFIGURE_CMDS
>>         $(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D) $(AT91BOOTSTRAP3_DEFCONFIG)_defconfig
>> endef
>> else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
>> define AT91BOOTSTRAP3_CONFIGURE_CMDS
>>         cp $(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE) $(@D)/.config
>> endef
>> endif
>>
>> and be replaced by a chunk of code that sets
>> AT91BOOTSTRAP3_KCONFIG_FILE.
> 
> Indeed.
> 
>> However, while this is reasy to do for the
>> BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG case, it is much more
>> complicated for the BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG case. This
>> is because we do not know the path to the defconfig file in the
>> at91bootstrap3 source tree.
>>
>> For the linux and barebox package, when a defconfig name is passed, its
>> path in the linux or barebox source tree is easily found: it's
>> arch/<ARCH>/configs/<name>_defconfig. But for at91bootstrap3, defconfig
>> files are spread throughout the tree, in directories named after the
>> board. There is no real way of inferring the location of the defconfig
>> file just by looking at its name.
>>
>> Therefore, I am not sure how we can initialize
>> AT91BOOTSTRAP3_KCONFIG_FILE in such a situation.
>>
>> Thomas DS, Yann, am I missing something?
> 
> Well, it looks like the defconfig files are all in sub-directories of
> boards/ and that each defconfig is unique in name.
> 
> So, we could probably do something like:
> 
>     AT91BOOTSTRAP3_KCONFIG_FILE = boards/*/$(call qstrip,$(AT91BOOTSTRAP3_DEFCONFIG))_defconfig

 Add a $(wildcard ...) around it, then you'll get the missing config file error
if it doesn't match anything.

 Regards,
 Arnout

> 
> This would be resolved by the 'cp' we do at the very begining, but is
> not very robust (and would anyway warrant a big fat comment).
> 
> I'll see if that would work.
> 
> Regards,
> Yann E. MORIN.
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  reply	other threads:[~2015-04-06 14:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-08 21:37 [Buildroot] [PATCH 1/3] Added new package 'mc' (Midnight Commander) Mauro Condarelli
2015-03-08 21:37 ` [Buildroot] [PATCH 2/3] Transformation of package 'at91bootstrap3' to KConfig style Mauro Condarelli
2015-04-06 10:20   ` Thomas Petazzoni
2015-04-06 13:32     ` Yann E. MORIN
2015-04-06 14:16       ` Arnout Vandecappelle [this message]
2015-04-06 14:18         ` Arnout Vandecappelle
2015-03-08 21:37 ` [Buildroot] [PATCH 3/3] Added support for PHP/SQLite3 (non PDO) Mauro Condarelli
2015-03-09 12:26   ` Gustavo Zacarias
2015-03-09 13:08   ` Thomas Petazzoni
2015-03-09  4:46 ` [Buildroot] [PATCH 1/3] Added new package 'mc' (Midnight Commander) Baruch Siach
2015-03-09  8:33 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55229545.4010103@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox