All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] boot/at91bootstrap3: migrate to pkg-kconfig
@ 2015-04-06 21:30 Thomas Petazzoni
  2015-04-07 15:25 ` Patrick Noffke
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2015-04-06 21:30 UTC (permalink / raw)
  To: buildroot

commit: http://git.buildroot.net/buildroot/commit/?id=2016cb30f103024a8dfb50bcfe9a68bfac2f1118
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

In at91bootstrap3, defconfig files are spread out in various
sub-directories, so we can't easily construct the path to those
defconfig files.

As it turns out, there are no two defconfig files named the same; they
all contain at least the board name, plus some extra info. And there is
always only one directory depth below board/ where all defconfig files
are to be found.

Also, at91bootstrap3's own Makefile relies on this single-match as it
runs a 'find' command to locate the defconfig file.

So, even though we do not know the path to the defconfig file, we can
construct a shell-glob quite easily (in the hope that there will never
be more than one directory depth).

Signed-off-by: Mauro Condarelli <mc5686@mclink.it>
[yann.morin.1998 at free.fr:
  - remove custom _CONFIGURE_CMDS, handled by pkg-kconfig  (Thomas)
  - remove redundant intermediate variable
  - fix using internal defconfig files
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 boot/at91bootstrap3/at91bootstrap3.mk |   27 ++++++++++-----------------
 1 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/boot/at91bootstrap3/at91bootstrap3.mk b/boot/at91bootstrap3/at91bootstrap3.mk
index b780617..f35ffc7 100644
--- a/boot/at91bootstrap3/at91bootstrap3.mk
+++ b/boot/at91bootstrap3/at91bootstrap3.mk
@@ -10,10 +10,6 @@ AT91BOOTSTRAP3_SITE = $(call github,linux4sam,at91bootstrap,$(AT91BOOTSTRAP3_VER
 AT91BOOTSTRAP3_INSTALL_IMAGES = YES
 AT91BOOTSTRAP3_INSTALL_TARGET = NO
 
-AT91BOOTSTRAP3_DEFCONFIG = \
-	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))
-AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE = \
-	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
 AT91BOOTSTRAP3_CUSTOM_PATCH_DIR = \
 	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR))
 
@@ -27,16 +23,6 @@ endef
 AT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
 endif
 
-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
-
 define AT91BOOTSTRAP3_BUILD_CMDS
 	$(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D)
 endef
@@ -45,18 +31,25 @@ 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 = $(AT91BOOTSTRAP3_DIR)/board/*/$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))_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))
 
 # Checks to give errors that the user can understand
 ifeq ($(filter source,$(MAKECMDGOALS)),)
 ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
-ifeq ($(AT91BOOTSTRAP3_DEFCONFIG),)
+ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG)),)
 $(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
 endif
 endif
 
 ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
-ifeq ($(AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE),)
+ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE)),)
 $(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
 endif
 endif

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [git commit] boot/at91bootstrap3: migrate to pkg-kconfig
  2015-04-06 21:30 [Buildroot] [git commit] boot/at91bootstrap3: migrate to pkg-kconfig Thomas Petazzoni
@ 2015-04-07 15:25 ` Patrick Noffke
  2015-04-07 17:21   ` Yann E. MORIN
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Noffke @ 2015-04-07 15:25 UTC (permalink / raw)
  To: buildroot

Hi,

I just did a rebase to prepare for submitting a patch, and now at91bootstrap3 doesn't build.  I am using a custom config based on an existing board (at91sam9m10g45ek).  Buildroot copies my custom config to output/build/at91bootstrap3.7.1/.config, then appears to be running make defconfig prior to running make.  make defconfig results in replacing some of my CONFIG_XX settings.  If I manually copy the config and then manually run make (thus skipping make defconfig), then it builds as I expect.

I am not sure if this patch is the cause, or something else.  I may be using at91bootstrap3 incorrectly (perhaps I needed to make a custom board), but I don't see why defconfig should be done with a custom config.

I'm happy to try and make a patch to fix this, but I could use some guidance of where to start.

Thanks,
Patrick

On Monday, April 06, 2015 11:30:48 PM Thomas Petazzoni wrote:
> commit: http://git.buildroot.net/buildroot/commit/?id=2016cb30f103024a8dfb50bcfe9a68bfac2f1118
> branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master
> 
> In at91bootstrap3, defconfig files are spread out in various
> sub-directories, so we can't easily construct the path to those
> defconfig files.
> 
> As it turns out, there are no two defconfig files named the same; they
> all contain at least the board name, plus some extra info. And there is
> always only one directory depth below board/ where all defconfig files
> are to be found.
> 
> Also, at91bootstrap3's own Makefile relies on this single-match as it
> runs a 'find' command to locate the defconfig file.
> 
> So, even though we do not know the path to the defconfig file, we can
> construct a shell-glob quite easily (in the hope that there will never
> be more than one directory depth).
> 
> Signed-off-by: Mauro Condarelli <mc5686@mclink.it>
> [yann.morin.1998 at free.fr:
>   - remove custom _CONFIGURE_CMDS, handled by pkg-kconfig  (Thomas)
>   - remove redundant intermediate variable
>   - fix using internal defconfig files
> ]
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  boot/at91bootstrap3/at91bootstrap3.mk |   27 ++++++++++-----------------
>  1 files changed, 10 insertions(+), 17 deletions(-)
> 
> diff --git a/boot/at91bootstrap3/at91bootstrap3.mk b/boot/at91bootstrap3/at91bootstrap3.mk
> index b780617..f35ffc7 100644
> --- a/boot/at91bootstrap3/at91bootstrap3.mk
> +++ b/boot/at91bootstrap3/at91bootstrap3.mk
> @@ -10,10 +10,6 @@ AT91BOOTSTRAP3_SITE = $(call github,linux4sam,at91bootstrap,$(AT91BOOTSTRAP3_VER
>  AT91BOOTSTRAP3_INSTALL_IMAGES = YES
>  AT91BOOTSTRAP3_INSTALL_TARGET = NO
>  
> -AT91BOOTSTRAP3_DEFCONFIG = \
> -	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))
> -AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE = \
> -	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
>  AT91BOOTSTRAP3_CUSTOM_PATCH_DIR = \
>  	$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR))
>  
> @@ -27,16 +23,6 @@ endef
>  AT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
>  endif
>  
> -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
> -
>  define AT91BOOTSTRAP3_BUILD_CMDS
>  	$(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D)
>  endef
> @@ -45,18 +31,25 @@ 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 = $(AT91BOOTSTRAP3_DIR)/board/*/$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))_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))
>  
>  # Checks to give errors that the user can understand
>  ifeq ($(filter source,$(MAKECMDGOALS)),)
>  ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
> -ifeq ($(AT91BOOTSTRAP3_DEFCONFIG),)
> +ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG)),)
>  $(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
>  endif
>  endif
>  
>  ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
> -ifeq ($(AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE),)
> +ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE)),)
>  $(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
>  endif
>  endif
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [git commit] boot/at91bootstrap3: migrate to pkg-kconfig
  2015-04-07 15:25 ` Patrick Noffke
@ 2015-04-07 17:21   ` Yann E. MORIN
       [not found]     ` <1742152.8gskvjVAdm@noffke.mortara.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2015-04-07 17:21 UTC (permalink / raw)
  To: buildroot

Patrick, All,

[Please, wrap lines to ~72 chars; ultra-long lines are a pain to read.]

On 2015-04-07 10:25 -0500, Patrick Noffke spake thusly:
> Hi,
> 
> I just did a rebase to prepare for submitting a patch, and now
> at91bootstrap3 doesn't build.  I am using a custom config based on an
> existing board (at91sam9m10g45ek).  Buildroot copies my custom config
> to output/build/at91bootstrap3.7.1/.config, then appears to be running
> make defconfig prior to running make.

CAn you share the last 100-or-so lines of the build log (what's on the
console), because the pkg-kconfig infra does not run defconfig. You can
see what it's doing in: package/pkg-kconfig.mk , and it's basically:

    cp $(YOUR_CONFIG_FILE)  $(AT91BOOTSTRAP3_DIR)/.config
    make oldconfig

So, if htere's a defconfig run, it's not Buildroot doing it...

I'll try to see if I can reproduce a failure here. Results to come
later...

>  make defconfig results in
> replacing some of my CONFIG_XX settings.  If I manually copy the
> config and then manually run make (thus skipping make defconfig), then
> it builds as I expect.
> 
> I am not sure if this patch is the cause, or something else.  I may be
> using at91bootstrap3 incorrectly (perhaps I needed to make a custom
> board), but I don't see why defconfig should be done with a custom
> config.

Well, it's pretty easy to see if this patch is the culprit:

    git checkout 2016cb30f103024a8dfb50bcfe9a68bfac2f1118^

then test your config and see if it works. If it does, then the patch
may be the culprit (i.e. uncover a bug somewhere, maybe in Buildroot,
maybe in at91bootstrap3 itself); if the config does not work, then the
bug pre-existed that patch.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [git commit] boot/at91bootstrap3: migrate to pkg-kconfig
       [not found]     ` <1742152.8gskvjVAdm@noffke.mortara.com>
@ 2015-04-07 21:08       ` Yann E. MORIN
  0 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2015-04-07 21:08 UTC (permalink / raw)
  To: buildroot

Patrick, All,

On 2015-04-07 12:40 -0500, Patrick Noffke spake thusly:
> On Tuesday, April 07, 2015 07:21:00 PM you wrote:
> > see what it's doing in: package/pkg-kconfig.mk , and it's basically:
> >
> >     cp $(YOUR_CONFIG_FILE)  $(AT91BOOTSTRAP3_DIR)/.config
> >     make oldconfig
> >
> This is my problem.  I didn't know about oldconfig -- I thought
> defconfig was
> getting run.
>
> make oldconfig is replacing some of my settings for the at91bootstrap3
> package.
>
> In particular, in my custom config, I have
>
> #CONFIG_MACH_TYPE="1830"
> CONFIG_MACH_TYPE="0xFFFFFFFF"
> CONFIG_SDRAM=y
>
> and these are getting replaced with
>
> CONFIG_MACH_TYPE="1830"
> # CONFIG_SDRAM is not set
>
> Should oldconfig be doing this?

Yes, this is expected behaviour of oldconfig, and that's what we're
calling it for: to apply the configuration statements and make them
aligned with the actual possibilities offered by the Kconfig files.

Looking at at91bootstrap3's Kconfig fies, CONFIG_SDRAM can only be
selected by another option; it can't be set all by itself. Which means
seeting it "manually" by editing the .config file is wrong.

So, in your case, it means that your "new board" definition is
incorrect. Something should select it.

> > Well, it's pretty easy to see if this patch is the culprit:
> >
> >     git checkout 2016cb30f103024a8dfb50bcfe9a68bfac2f1118^
> >
> > then test your config and see if it works. If it does, then the
> > patch
> > may be the culprit (i.e. uncover a bug somewhere, maybe in
> > Buildroot,
> > maybe in at91bootstrap3 itself); if the config does not work, then
> > the
> > bug pre-existed that patch.
>
> When I checkout this revision, the package builds fine.

Maybe, but still the board definition (or whatever it is called in
at91bootstrap3) that you wrote is incorrect.

I'm highly tempted to say that this is not a problem of using
pkg-kconfig that is causing you troubles, but merely that this switch is
exposing an problem on your side.

See how other boards are doing it:

    $ make at91bootstrap3-patch
    $ cd output/build/at91bootstrap3-v3.7.1
    $ grep -r -E 'select[[:space:]]+CONFIG_SDRAM' .
    ./board/at91sam9261ek/Config.in.board:  select CONFIG_SDRAM
    ./board/at91sam9rlek/Config.in.board:   select CONFIG_SDRAM
    ./board/at91sam9260ek/Config.in.board:  select CONFIG_SDRAM
    ./board/at91sam9g10ek/Config.in.board:  select CONFIG_SDRAM
    ./board/at91sam9g20ek/Config.in.board:  select CONFIG_SDRAM
    ./board/at91sam9263ek/Config.in.board:  select CONFIG_SDRAM
    ./board/at91sam9xeek/Config.in.board:   select CONFIG_SDRAM

Then look at how those files are defining the board's capabilities
(hint: it is very straightforward!).

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-07 21:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-06 21:30 [Buildroot] [git commit] boot/at91bootstrap3: migrate to pkg-kconfig Thomas Petazzoni
2015-04-07 15:25 ` Patrick Noffke
2015-04-07 17:21   ` Yann E. MORIN
     [not found]     ` <1742152.8gskvjVAdm@noffke.mortara.com>
2015-04-07 21:08       ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.