From 00dcc9408c0b0bb33c333cead5e607e6ea56940f Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Tue, 22 Sep 2020 22:29:18 +0100 Subject: eclass/linux-build: support EFI_STUB --- eclass/linux-build.eclass | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'eclass') diff --git a/eclass/linux-build.eclass b/eclass/linux-build.eclass index 6127631b..c03f8d10 100644 --- a/eclass/linux-build.eclass +++ b/eclass/linux-build.eclass @@ -171,6 +171,10 @@ _linux-build_src_prepare_build() { emake defconfig "${myopt[@]}" fi + if _linux-build_configval EFI_STUB && ! _linux-build_configval CMDLINE ; then + die "CONFIG_EFI_STUB=y requires CONFIG_CMDLINE" + fi + if _linux-build_configval CMDLINE_BOOL && _linux-build_configval CMDLINE ; then einfo "Creating kernel.arg" einfo " CONFIG_CMDLINE='${CONFIG_CMDLINE}'" @@ -429,14 +433,23 @@ _linux-build_src_install_build() { fi insinto "/boot/${KV_FULL}" - newins "${BUILDDIR}/.config" kernel.cfg - newins "${BUILDDIR}/System.map" System.map + newins "${BUILDDIR}/.config" kernel.cfg + newins "${BUILDDIR}/System.map" System.map case "$(tc-arch-kernel)" in x86) newins "${BUILDDIR}/arch/$(tc-arch-kernel)/boot/bzImage" kernel.img ;; arm|arm64) newins "${BUILDDIR}/arch/$(tc-arch-kernel)/boot/Image" kernel.img ;; esac + if _linux-build_configval EFI_STUB ; then + insinto "/boot/EFI/linux" + + case "$(tc-arch-kernel)" in + x86) newins "${BUILDDIR}/arch/$(tc-arch-kernel)/boot/bzImage" "${KV_FULL}.efi" ;; + arm|arm64) newins "${BUILDDIR}/arch/$(tc-arch-kernel)/boot/Image" "${KV_FULL}.efi" ;; + esac + fi + if _linux-build_configval CMDLINE_BOOL && _linux-build_configval CMDLINE ; then insinto "/boot/${KV_FULL}" doins "${WORKDIR}/boot/kernel.arg" -- cgit v1.2.3