From 0f0e4e6c66b53098404ee00b001819b8b86f8e4b Mon Sep 17 00:00:00 2001 From: Philipp Deppenwiese Date: Tue, 19 Jun 2018 20:22:32 +0200 Subject: payloads: Add LinuxBoot payload in u-root mode * Add LinuxBoot support * Add u-root mode * Download kernel and u-root from upstream sources. * Add customization options * Clean kernel only if directory exists Change-Id: I3a25ff6812e046acc688cbbb203cf262ad751659 Signed-off-by: Philipp Deppenwiese Reviewed-on: https://review.coreboot.org/23071 Reviewed-by: Ronald G. Minnich Tested-by: build bot (Jenkins) --- payloads/external/LinuxBoot/Makefile | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 payloads/external/LinuxBoot/Makefile (limited to 'payloads/external/LinuxBoot/Makefile') diff --git a/payloads/external/LinuxBoot/Makefile b/payloads/external/LinuxBoot/Makefile new file mode 100644 index 0000000000..10ad0c3391 --- /dev/null +++ b/payloads/external/LinuxBoot/Makefile @@ -0,0 +1,63 @@ +## This file is part of the coreboot project. +## +## Copyright (C) 2017 Facebook Inc. +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; version 2 of the License. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## + +kernel_tarball=https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-$(CONFIG_LINUXBOOT_KERNEL_VERSION).tar.xz +project_dir=linuxboot +kernel_dir=$(project_dir)/kernel + +unexport $(COREBOOT_EXPORTS) + +all: payload + +$(kernel_dir)/.config: + echo " WWW Download Linux $(CONFIG_LINUXBOOT_KERNEL_VERSION)" + mkdir -p $(kernel_dir) +ifeq ("$(wildcard $(kernel_dir)/README)","") + wget -qO- $(kernel_tarball) | tar xJ -C $(kernel_dir) --strip 1 +endif + +config: $(kernel_dir)/.config + echo " CONFIG Linux $(CONFIG_LINUXBOOT_KERNEL_VERSION)" +ifneq ($(CONFIG_LINUXBOOT_KERNEL_CONFIGFILE),) + cp $(CONFIG_LINUXBOOT_KERNEL_CONFIGFILE) $(kernel_dir)/.config +endif +ifeq ($(CONFIG_LINUXBOOT_ARCH),386) + cp x86/defconfig $(kernel_dir)/.config +else ifeq ($(CONFIG_LINUXBOOT_ARCH),amd64) + cp x86_64/defconfig $(kernel_dir)/.config +endif + +$(project_dir)/kernel-image: config + echo " MAKE Kernel $(CONFIG_LINUXBOOT_KERNEL_VERSION)" + $(MAKE) -C $(kernel_dir) olddefconfig + $(MAKE) -C $(kernel_dir) -j $(CPUS) +ifeq ($(CONFIG_LINUXBOOT_ARCH),386) + cp $(kernel_dir)/arch/x86/boot/bzImage $(project_dir)/kernel-image +else ifeq ($(CONFIG_LINUXBOOT_ARCH),amd64) + cp $(kernel_dir)/arch/x86/boot/bzImage $(project_dir)/kernel-image +endif + +payload: $(project_dir)/kernel-image +ifeq ($(CONFIG_LINUXBOOT_UROOT),y) + $(MAKE) -f targets/u-root.mk +endif + +clean: + if [ -d "$(kernel_dir)" ]; then make -C $(kernel_dir) clean; fi + rm -f $(project_dir)/initramfs.cpio.xz + +distclean: + rm -rf $(project_dir) + +.PHONY: config patch payload clean distclean clone fetch all -- cgit v1.2.3