Files
coreboot/payloads/external/LinuxBoot/Makefile
Maximilian Brune 84347d0b45 payloads/Linuxboot: Fix u-root build
Currently u-root doesn't build for various reasons.

1. The boot cmds have changed. Some have been removed and the default
   has changed to the 'boot' cmd for loading an OS.
2. The elvish shell has been removed as default shell. The gosh is now
   the default.
3. For some reason the -uroot-source parameter doesn't exist anymore? So
   instead we just cd into the u-root directory and build the initramfs
   there.

Build tested:
| CONFIG_LINUXBOOT_COMPILE_KERNEL | CONFIG_LINUXBOOT_BUILD_INITRAMFS |
----------------------------------------------------------------------
|                 n               |                 n                |
|                 n               |                 y                |
|                 y               |                 n                |
|                 y               |                 y                |
----------------------------------------------------------------------

Change-Id: If66238cec248deb3594de82f3adbc608516a2fc5
Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84119
Reviewed-by: Alicja Michalska <ahplka19@gmail.com>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-19 07:14:01 +00:00

61 lines
1.4 KiB
Makefile

## SPDX-License-Identifier: GPL-2.0-only
unexport $(COREBOOT_EXPORTS)
DTC ?= dtc
LINUX_ARCH-$(CONFIG_LINUXBOOT_X86_64) = x86_64
LINUX_ARCH-$(CONFIG_LINUXBOOT_X86) = i386
LINUX_ARCH-$(CONFIG_LINUXBOOT_ARM64) = arm64
LINUX_ARCH-$(CONFIG_LINUXBOOT_RISCV_RV32) = riscv
LINUX_ARCH-$(CONFIG_LINUXBOOT_RISCV_RV64) = riscv
ifeq ($(CONFIG_LINUXBOOT_COMPILE_KERNEL),y)
include targets/linux.mk
endif
ifeq ($(CONFIG_LINUXBOOT_UROOT),y)
include targets/u-root.mk
endif
ifeq ($(CONFIG_LINUXBOOT_KERNEL_BZIMAGE),y)
build/Image: $(kernel_dir)/arch/x86/boot/bzImage | build
cp $< $@
else ifeq ($(CONFIG_LINUXBOOT_KERNEL_UIMAGE),y)
build/target.dtb: $(CONFIG_LINUXBOOT_DTS_FILE) | build
$(DTC) -o $@ $<
build/Image: build/vmlinux.bin.lzma build/initramfs build/target.dtb $(LINUX_ARCH-y)/kernel_fdt_lzma.its | build
mkimage -f $(LINUX_ARCH-y)/kernel_fdt_lzma.its $@
else ifneq ($(CONFIG_LINUXBOOT_COMPILE_KERNEL),y)
build/Image: $(CONFIG_LINUXBOOT_KERNEL_PATH) | build
cp $< $@
endif
build/initramfs: build/initramfs_u-root.cpio | build
ifeq ($(CONFIG_LINUXBOOT_INITRAMFS_COMPRESSION_XZ),y)
xz --stdout --keep --force --check=crc32 --lzma2=dict=1MiB $< > $@
else
cp $< $@
endif
build:
mkdir build
clean:
rm -rf build/kernel*
rm -f build/u-root
rm -f build/initramfs*
rm -f build/bzImage
rm -f build/uImage
distclean:
rm -rf build
.PHONY: linuxboot clean distclean