[OpenWrt-Devel] [PATCH] Make kernel version configurable for developers

Jeroen van Bemmel jbemmel at zonnet.nl
Fri Apr 13 21:01:46 CEST 2012


A grep for LINUX_VERSION in target/linux/*/Makefile shows that OpenWRT 
current uses a large number of different kernel versions for the various 
platforms. While there may be reasons for using a particular version, it 
would be nice if newer kernels were available for those platforms that 
support them. Ideally, most platforms would use the same, latest stable 
Linux kernel version

This patch makes it easier for developers to generate an image using a 
specific Linux kernel version. It adds a configuration option to the 
Developer menu, selecting the latest stable kernel (3.3.2) by default to 
stimulate experimentation with this version. Device profiles may select 
a specific kernel version as default by declaring a pseudo-module 
"kernel-x.y.z" as default (strings to be added to Config.in as needed)

The patch updates the Makefile for brcm63xx to enable a kernel version 
override; other Makefiles will need to be patched in a similar way. 
Nothing is changed unless a developer explicitly selects the new option 
in the menu

Signed-off-by: Jeroen van Bemmel <jbemmel at zonnet.nl>

Index: Config.in
===================================================================
--- Config.in    (revision 31276)
+++ Config.in    (working copy)
@@ -458,6 +458,20 @@
            in the package directory, pointing to the .git tree that you 
want
            to pull the source code from

+    config CHOOSE_KERNEL_VERSION
+        bool "Select a specific Linux kernel version to build" if DEVEL
+        default n
+        help
+          Enable this to build a specific Linux kernel version. Useful 
for testing newer kernels
+
+    config KERNEL_VERSION
+        string "Linux kernel version to build (default = latest 
stable)" if CHOOSE_KERNEL_VERSION && DEVEL
+        default "3.3.1" if DEFAULT_kernel-3.3.1
+        default "3.3.2"
+        depends CHOOSE_KERNEL_VERSION
+        help
+          Linux kernel version to build. Defaults to the latest stable 
kernel, if not set as a pseudo-module in a specific device profile
+
  menuconfig TARGET_OPTIONS
      bool "Target Options"  if DEVEL

Index: target/linux/brcm63xx/Makefile
===================================================================
--- target/linux/brcm63xx/Makefile    (revision 31276)
+++ target/linux/brcm63xx/Makefile    (working copy)
@@ -10,7 +10,14 @@
  BOARD:=brcm63xx
  BOARDNAME:=Broadcom BCM63xx
  FEATURES:=squashfs jffs2 usb atm pci pcmcia
-LINUX_VERSION:=3.0.18
+
+# Allow override of kernel version by menuconfig
+ifdef CONFIG_KERNEL_VERSION
+ LINUX_VERSION:=$(subst ",,$(CONFIG_KERNEL_VERSION))
+else
+ LINUX_VERSION:=3.0.18
+endif
+
  MAINTAINER:=Florian Fainelli <florian at openwrt.org>

  include $(INCLUDE_DIR)/target.mk




More information about the openwrt-devel mailing list