Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 5480] New: Choose default kernel configuration depending on the current architecture selected.
@ 2012-08-30 11:28 bugzilla at busybox.net
  2012-09-02 12:58 ` Arnout Vandecappelle
  2013-05-26  9:30 ` [Buildroot] [Bug 5480] Choose default kernel configuration depending on the current architecture selected bugzilla at busybox.net
  0 siblings, 2 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2012-08-30 11:28 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=5480

           Summary: Choose default kernel configuration depending on the
                    current architecture selected.
           Product: buildroot
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Other
        AssignedTo: unassigned at buildroot.uclibc.org
        ReportedBy: rsanchezs at infoglobal.es
                CC: buildroot at uclibc.org
   Estimated Hours: 0.0


Created attachment 4526
  --> https://bugs.busybox.net/attachment.cgi?id=4526
linux: Choose default kernel configuration depending on the current
architecture selected.

Hello:

  I've found out that after initial configuration, including enabling of linux
kernel compilation, the default kernel config is not set and almost all make
targets fail with:

"linux/linux.mk:304: *** No kernel defconfig name specified, check your
BR2_LINUX_KERNEL_DEFCONFIG setting."

  One possible solution would have been tweaking the build system to avoid that
message or at least, be able to run the linux-menuconfig target. I didn't find
an easy way to do this and therefore I chose another option which is setting
kernel default configs depending on target architecture.

  Find the patch attached, regards,

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

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

* [Buildroot] [Bug 5480] New: Choose default kernel configuration depending on the current architecture selected.
  2012-08-30 11:28 [Buildroot] [Bug 5480] New: Choose default kernel configuration depending on the current architecture selected bugzilla at busybox.net
@ 2012-09-02 12:58 ` Arnout Vandecappelle
  2012-09-02 15:05   ` [Buildroot] [PATCH] linux: add default defconfig Arnout Vandecappelle
  2013-05-26  9:30 ` [Buildroot] [Bug 5480] Choose default kernel configuration depending on the current architecture selected bugzilla at busybox.net
  1 sibling, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2012-09-02 12:58 UTC (permalink / raw)
  To: buildroot

  [Replying to the list, because that's where we review patches]

On 08/30/12 13:28, bugzilla at busybox.net wrote:
>    I've found out that after initial configuration, including enabling of linux
> kernel compilation, the default kernel config is not set and almost all make
> targets fail with:
>
> "linux/linux.mk:304: *** No kernel defconfig name specified, check your
> BR2_LINUX_KERNEL_DEFCONFIG setting."
>
>    One possible solution would have been tweaking the build system to avoid that
> message or at least, be able to run the linux-menuconfig target. I didn't find
> an easy way to do this and therefore I chose another option which is setting
> kernel default configs depending on target architecture.
>
>    Find the patch attached, regards,
>

  Maybe a better option is to default to using the arch-dependent 'defconfig'
target in the kernel itself.  It doesn't exist for microblaze but it's more
maintainable for the other archs at least.

  Especially our x86 users will be happy with this change, I think.

  Patch follows.

  Regards,
  Arnout
-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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

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

* [Buildroot] [PATCH] linux: add default defconfig
  2012-09-02 12:58 ` Arnout Vandecappelle
@ 2012-09-02 15:05   ` Arnout Vandecappelle
  2012-09-02 15:16     ` Yann E. MORIN
  2013-05-26 15:54     ` Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2012-09-02 15:05 UTC (permalink / raw)
  To: buildroot

Buildroot currently requires a defconfig to be supplied for the kernel:
either a custom supplied one, or one from the kernel tree.  However,
the kernel can (usually) also select a default defconfig, based on
the architecture.  So make this option available to buildroot.

We also make this the default, so the user can compile a kernel with
minimal effort.

Microblaze currently (linux-3.5) doesn't have a default defconfig.
Older versions also lack it for some architectures (e.g. mips was
introduced in 2.6.35) but that's nearly impossible to check for at
buildroot level.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

---
 linux/Config.in |    8 +++++++-
 linux/linux.mk  |   15 ++++++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/linux/Config.in b/linux/Config.in
index 9c63215..1165bc9 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -101,7 +101,13 @@ config BR2_LINUX_KERNEL_PATCH
 
 choice
 	prompt "Kernel configuration"
-	default BR2_LINUX_KERNEL_USE_DEFCONFIG
+	# microblaze doesn't have an in-kernel defconfig (as of 3.5)
+	default BR2_LINUX_KERNEL_USE_DEFCONFIG if BR2_microblazeel || BR2_microblazebe
+	default BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG
+
+config BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG
+	bool "Using the default supplied by the kernel"
+	depends on !(BR2_microblazeel || BR2_microblazebe)
 
 config BR2_LINUX_KERNEL_USE_DEFCONFIG
 	bool "Using a defconfig"
diff --git a/linux/linux.mk b/linux/linux.mk
index c4bdf90..a248ae4 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -146,6 +146,13 @@ endef
 
 LINUX_POST_PATCH_HOOKS += LINUX_APPLY_PATCHES
 
+ifeq ($(BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG),y)
+
+define LINUX_BASE_CONFIGURE_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) defconfig
+endef
+
+else # BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG
 
 ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
 KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
@@ -153,10 +160,16 @@ else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
 endif
 
-define LINUX_CONFIGURE_CMDS
+define LINUX_BASE_CONFIGURE_CMDS
 	cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
 	$(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) buildroot_defconfig
 	rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
+endef
+
+endif # BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG
+
+define LINUX_CONFIGURE_CMDS
+	$(LINUX_BASE_CONFIGURE_CMDS)
 	$(if $(BR2_ARM_EABI),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config),
 		$(call KCONFIG_DISABLE_OPT,CONFIG_AEABI,$(@D)/.config))
-- 
tg: (666eb02..) t/kernel-defconfig (depends on: master)

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

* [Buildroot] [PATCH] linux: add default defconfig
  2012-09-02 15:05   ` [Buildroot] [PATCH] linux: add default defconfig Arnout Vandecappelle
@ 2012-09-02 15:16     ` Yann E. MORIN
  2013-05-26 15:54     ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2012-09-02 15:16 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On Sunday 02 September 2012 17:05:41 Arnout Vandecappelle (Essensium/Mind) wrote:
> Buildroot currently requires a defconfig to be supplied for the kernel:
> either a custom supplied one, or one from the kernel tree.  However,
> the kernel can (usually) also select a default defconfig, based on
> the architecture.  So make this option available to buildroot.
> 
> We also make this the default, so the user can compile a kernel with
> minimal effort.
> 
> Microblaze currently (linux-3.5) doesn't have a default defconfig.
> Older versions also lack it for some architectures (e.g. mips was
> introduced in 2.6.35) but that's nearly impossible to check for at
> buildroot level.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

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] 6+ messages in thread

* [Buildroot] [Bug 5480] Choose default kernel configuration depending on the current architecture selected.
  2012-08-30 11:28 [Buildroot] [Bug 5480] New: Choose default kernel configuration depending on the current architecture selected bugzilla at busybox.net
  2012-09-02 12:58 ` Arnout Vandecappelle
@ 2013-05-26  9:30 ` bugzilla at busybox.net
  1 sibling, 0 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2013-05-26  9:30 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=5480

Thomas Petazzoni <thomas.petazzoni@free-electrons.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2013-05-26 09:29:44 UTC ---
I believe that the current behavior is the one that we want. The kernel
configuration is something that's highly specific to the target hardware, so we
can't just chose some arbitrary kernel configuration for each particular
architecture. I very much prefer the current behavior in which the user is
warned that he should set a kernel configuration, rather than the behavior
proposed by the patch, where Buildroot would automatically select some random
configuration, the user will not notice, try to boot the kernel on whatever
hardware, and see it not boot at all.

Also, if we would be doing that for the kernel, we would have to do that for
U-Boot and Barebox. And for bootloaders, the fact that we can't decide a good
"default" configuration for each particular architecture is well known.

The only thing we /might/ do is define the default kernel configuration to be
i386 for i386 and x86_64 for x86-64, since those two architectures have only
one single kernel defconfigs. But for the other architectures, I don't think it
makes sense.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

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

* [Buildroot] [PATCH] linux: add default defconfig
  2012-09-02 15:05   ` [Buildroot] [PATCH] linux: add default defconfig Arnout Vandecappelle
  2012-09-02 15:16     ` Yann E. MORIN
@ 2013-05-26 15:54     ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2013-05-26 15:54 UTC (permalink / raw)
  To: buildroot

Dear Arnout Vandecappelle (Essensium/Mind),

On Sun,  2 Sep 2012 17:05:41 +0200, Arnout Vandecappelle
(Essensium/Mind) wrote:
> Buildroot currently requires a defconfig to be supplied for the kernel:
> either a custom supplied one, or one from the kernel tree.  However,
> the kernel can (usually) also select a default defconfig, based on
> the architecture.  So make this option available to buildroot.
> 
> We also make this the default, so the user can compile a kernel with
> minimal effort.
> 
> Microblaze currently (linux-3.5) doesn't have a default defconfig.
> Older versions also lack it for some architectures (e.g. mips was
> introduced in 2.6.35) but that's nearly impossible to check for at
> buildroot level.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

I'm not sure I agree with this one. On many architectures, the default
defconfig doesn't necessarily make sense. For example, on ARM, the
default defconfig is versatile, which is very unlikely to match the
user's hardware.

In the current situation, if the user only enables the "Linux kernel",
he gets an error at build time telling him that building a kernel
without specifying a configuration is not possible. I think this is a
sane behavior that should be preserved.

With this patch, the user will enable "Linux kernel", not notice that
it should be configured, do the build, and then try to boot the kernel
on some hardware platform... and get something that doesn't work at all.

So I believe here that "compiling a kernel with minimal effort" is not
possible. You _have_ to select a configuration.

The only architecture on which I believe this would make sense are i386
and x86_64, because the kernel only provides one defconfig for each of
them. In this case, something like:

config BR2_LINUX_KERNEL_DEFCONFIG
        string "Defconfig name"
        depends on BR2_LINUX_KERNEL_USE_DEFCONFIG
+	default "i386" if BR2_i386
+	default "x86_64" if BR2_x86_64

would be sufficient. Even though some defconfig contain so many options
enabled that they take ages to build, and are a bit irrelevant to build
a kernel for an embedded system, but that's a different story.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2013-05-26 15:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-30 11:28 [Buildroot] [Bug 5480] New: Choose default kernel configuration depending on the current architecture selected bugzilla at busybox.net
2012-09-02 12:58 ` Arnout Vandecappelle
2012-09-02 15:05   ` [Buildroot] [PATCH] linux: add default defconfig Arnout Vandecappelle
2012-09-02 15:16     ` Yann E. MORIN
2013-05-26 15:54     ` Thomas Petazzoni
2013-05-26  9:30 ` [Buildroot] [Bug 5480] Choose default kernel configuration depending on the current architecture selected bugzilla at busybox.net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox