Marcello Sylvester Bauer has uploaded this change for review. ( https://review.coreboot.org/29443
Change subject: Linuxboot: add kernel release and custom version ......................................................................
Linuxboot: add kernel release and custom version
Add current kernel releases instead of hardcode the version number. Also add the option to select a custom version of the kernel.
Change-Id: Ieb071696cfbb466521faaef045fc488a06f6db0c Signed-off-by: Marcello Sylvester Bauer info@marcellobauer.com --- M payloads/external/LinuxBoot/Kconfig M payloads/external/LinuxBoot/Makefile M payloads/external/Makefile.inc 3 files changed, 45 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/29443/1
diff --git a/payloads/external/LinuxBoot/Kconfig b/payloads/external/LinuxBoot/Kconfig index 8acb542..82b2748 100644 --- a/payloads/external/LinuxBoot/Kconfig +++ b/payloads/external/LinuxBoot/Kconfig @@ -46,25 +46,49 @@ default "arm64" if LINUXBOOT_ARM64
choice - prompt "Kernel version" + prompt "Kernel release" default LINUXBOOT_KERNEL_STABLE + help + choose the kernel release. + + select 'custom' if your want to define the kernel version. + for more information about the current 'mainline', 'stable' or 'longterm' + version, visit: https://www.kernel.org/ + +config LINUXBOOT_KERNEL_MAINLINE + bool "mainline" + help + mainline kernel version
config LINUXBOOT_KERNEL_STABLE - bool "4.14.67" + bool "stable" help - Stable kernel version + stable kernel version
-config LINUXBOOT_KERNEL_LATEST - bool "4.18.5" +config LINUXBOOT_KERNEL_LONGTERM + bool "longterm" help - Latest kernel version + longterm kernel version + +config LINUXBOOT_KERNEL_CUSTOM + bool "custom" + help + Custom kernel version
endchoice
+config LINUXBOOT_KERNEL_CUSTOM_VERSION + string "kernel version" + default "" + help + kernel version (4.x.x) + config LINUXBOOT_KERNEL_VERSION string - default "4.18.5" if LINUXBOOT_KERNEL_LATEST - default "4.14.67" if LINUXBOOT_KERNEL_STABLE + default "mainline" if LINUXBOOT_KERNEL_MAINLINE + default "stable" if LINUXBOOT_KERNEL_STABLE + default "longterm" if LINUXBOOT_KERNEL_LONGTERM + default "custom" if LINUXBOOT_KERNEL_CUSTOM
config LINUXBOOT_KERNEL_CONFIGFILE string "Kernel config file" diff --git a/payloads/external/LinuxBoot/Makefile b/payloads/external/LinuxBoot/Makefile index 8376805..2390ba8 100644 --- a/payloads/external/LinuxBoot/Makefile +++ b/payloads/external/LinuxBoot/Makefile @@ -12,7 +12,16 @@ ## GNU General Public License for more details. ##
-kernel_tarball=https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-$(CONFIG_LINUXBOOT_KERNEL... +ifeq ($(CONFIG_LINUXBOOT_KERNEL_CUSTOM),y) + kernel_version:=$(CONFIG_LINUXBOOT_KERNEL_CUSTOM_VERSION) +else + kernel_version:=$(shell curl -s -k https://www.kernel.org/feeds/kdist.xml | \ + sed -n -e 's@.*<guid isPermaLink="false">(.*)</guid>.*@\1@p' | \ + head -n 3 | \ + awk -F ',' '/$(CONFIG_LINUXBOOT_KERNEL_VERSION)/{ print $$3 }') +endif + +kernel_tarball=https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-$(kernel_version).tar.xz project_dir=linuxboot kernel_dir=$(project_dir)/kernel
@@ -42,7 +51,7 @@ fi
$(kernel_dir)/.config: - echo " WWW Download Linux $(CONFIG_LINUXBOOT_KERNEL_VERSION)" + echo " WWW Download Linux $(kernel_version) [$(CONFIG_LINUXBOOT_KERNEL_VERSION)]" mkdir -p $(kernel_dir) ifeq ("$(wildcard $(kernel_dir)/README)","") curl -s $(kernel_tarball) | tar xJ -C $(kernel_dir) --strip 1 diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc index c730bba..cb806b7 100644 --- a/payloads/external/Makefile.inc +++ b/payloads/external/Makefile.inc @@ -268,6 +268,8 @@ $(MAKE) -C payloads/external/LinuxBoot \ CPUS=$(CPUS) \ CONFIG_LINUXBOOT_KERNEL_VERSION=$(CONFIG_LINUXBOOT_KERNEL_VERSION) \ + CONFIG_LINUXBOOT_KERNEL_CUSTOM=$(CONFIG_LINUXBOOT_KERNEL_CUSTOM) \ + CONFIG_LINUXBOOT_KERNEL_CUSTOM_VERSION=$(CONFIG_LINUXBOOT_KERNEL_CUSTOM_VERSION) \ CONFIG_LINUXBOOT_KERNEL_CONFIGFILE=$(CONFIG_LINUXBOOT_KERNEL_CONFIGFILE) \ CONFIG_LINUXBOOT_KERNEL_COMMANDLINE=$(CONFIG_LINUXBOOT_KERNEL_COMMANDLINE) \ CONFIG_LINUXBOOT_UROOT_VERSION=$(CONFIG_LINUXBOOT_UROOT_VERSION) \