aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools/slimboot/slimboot_git.bb
diff options
context:
space:
mode:
authorYongxin Liu <yongxin.liu@windriver.com>2021-12-28 10:13:55 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2022-01-26 22:22:59 +0800
commit1d1d0f182815eeca36e4e80349fb0e16036171ff (patch)
tree875084d7cc0f469186d18ca1292df2766207a68e /recipes-devtools/slimboot/slimboot_git.bb
parent4ff5b19ba63ea69c47198e641acbc12e33634cac (diff)
downloadmeta-intel-1d1d0f182815eeca36e4e80349fb0e16036171ff.tar.gz
meta-intel-1d1d0f182815eeca36e4e80349fb0e16036171ff.tar.bz2
meta-intel-1d1d0f182815eeca36e4e80349fb0e16036171ff.zip
slimboot: add recipe for Slim Bootloader
Slim Bootloader is an open-source boot firmware running on Intel x86 architecture. Currently it supports qemu, apl(Apollo Lake), cfl(Coffee Lake), cml(Comet Lake), tgl(Tiger Lake), and ehl(Elkhart Lake). You can set "SLIMBOOT_TARGET" in .bb file or .bbappend file to specify or add the target firmware you want, for example: SLIMBOOT_TARGET = "qemu apl". The default target is qemu. Generated firmware and security keys are installed in build directory: image `-- usr `-- libexec `-- slimboot |-- Outputs | |-- qemu | |-- apl | `-- cfl `-- keys Boot firmware for qemu can be used by command: "qemu-system-x86_64 -machine q35 -nographic -serial mon:stdio -pflash SlimBootloader.bin" Other boot firmware for real hardware cannot be programmed directly to flash, please refer to https://slimbootloader.github.io/index.html for more instructions. Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'recipes-devtools/slimboot/slimboot_git.bb')
-rw-r--r--recipes-devtools/slimboot/slimboot_git.bb58
1 files changed, 58 insertions, 0 deletions
diff --git a/recipes-devtools/slimboot/slimboot_git.bb b/recipes-devtools/slimboot/slimboot_git.bb
new file mode 100644
index 00000000..15137cdc
--- /dev/null
+++ b/recipes-devtools/slimboot/slimboot_git.bb
@@ -0,0 +1,58 @@
+SUMMARY = "Slim Bootloader"
+DESCRIPTION = "Slim Bootloader is an open-source boot firmware, built from the \
+ground up to be small, secure and optimized running on Intel x86 architecture."
+HOMEPAGE = "https://slimbootloader.github.io"
+
+LICENSE = "BSD-2-Clause-Patent & MIT & Apache-2.0 & Python-2.0"
+
+SRC_URI = "git://github.com/slimbootloader/slimbootloader;protocol=https;branch=master"
+SRCREV = "07b7a1f0e017de6f4041a04e12c44e9574126dfe"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ef7fba7be2819ac13aaf5d0f842ce5d9 \
+ file://Licenses/EDK2_License.txt;md5=6123e5bf044a66db96c4ce88a36b2d08 \
+ file://Licenses/IPP_License.txt;md5=e3fc50a88d0a364313df4b21ef20c29e \
+ file://Licenses/Lz4_License.txt;md5=093ffc6380c6b1dadf52045a6e44a874 \
+ file://Licenses/MIT_License.txt;md5=f0f3a517d46b5f0ca048b58f503b6dc1 \
+ file://Licenses/NetBSD_License.txt;md5=1811b558fd7e03c491ca7f665eaf5529 \
+ file://Licenses/Python_License.txt;md5=dd98d01d471fac8d8dbdd975229dba03 \
+ "
+PV = "0.0.0+git${SRCPV}"
+
+inherit python3native
+
+DEPENDS = "openssl-native nasm-native acpica-native util-linux-native"
+S = "${WORKDIR}/git"
+
+do_configure[noexec] = "1"
+
+SLIMBOOT_TARGET ?= "qemu"
+SLIMBOOT_KEY_DIR ?= "keys"
+
+do_compile() {
+ # WA: To overcome direct call to "python" in scripts of slimbootloader
+ ln -sf ${PYTHON} ${STAGING_BINDIR_NATIVE}/python
+
+ cd ${S}
+ rm -rf ${SLIMBOOT_KEY_DIR}; mkdir -p ${SLIMBOOT_KEY_DIR}
+ export SBL_KEY_DIR=${S}/${SLIMBOOT_KEY_DIR}
+ ${PYTHON} BootloaderCorePkg/Tools/GenerateKeys.py -k ${SBL_KEY_DIR}
+
+ # Currently use EXTRA_OPTFLAGS to pass the include directory of sysroot-native to
+ # bitbake build system.
+ export EXTRA_OPTFLAGS="-I${STAGING_INCDIR_NATIVE}"
+
+ export EXTRA_LDFLAGS="-L${STAGING_LIBDIR_NATIVE}"
+
+ for target in ${SLIMBOOT_TARGET}; do
+ ${PYTHON} BuildLoader.py build ${target}
+ done
+}
+
+do_install() {
+ for target in ${SLIMBOOT_TARGET}; do
+ install -m 0755 -d ${D}${libexecdir}/slimboot/Outputs/${target}
+ install -m 0755 ${S}/Outputs/${target}/* ${D}${libexecdir}/slimboot/Outputs/${target}
+ done
+
+ install -m 0644 -d ${D}${libexecdir}/slimboot/${SLIMBOOT_KEY_DIR}
+ install -m 0644 ${S}/${SLIMBOOT_KEY_DIR}/* ${D}${libexecdir}/slimboot/${SLIMBOOT_KEY_DIR}
+}