> -----Original Message-----
> From: Konrad Weihmann <[email protected]>
> Sent: Friday, December 24, 2021 18:13
> To: Liu, Yongxin <[email protected]>; meta-
> [email protected]
> Subject: Re: [meta-intel][PATCH] slimboot: add recipe for Slim Bootloader
> 
> On 24.12.21 08:44, Yongxin Liu wrote:
> > 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 <[email protected]>
> > ---
> >   recipes-devtools/slimboot/slimboot_git.bb | 57 +++++++++++++++++++++++
> >   1 file changed, 57 insertions(+)
> >   create mode 100644 recipes-devtools/slimboot/slimboot_git.bb
> >
> > diff --git a/recipes-devtools/slimboot/slimboot_git.bb
> > b/recipes-devtools/slimboot/slimboot_git.bb
> > new file mode 100644
> > index 00000000..a621a383
> > --- /dev/null
> > +++ b/recipes-devtools/slimboot/slimboot_git.bb
> > @@ -0,0 +1,57 @@
> > +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"
> 
> This has to be "BSD-2-Clause-Patent & MIT & Apache-2.0 & Python-2.0"
> judging from the files mentioned in LIC_FILES_CHKSUM

From 
https://slimbootloader.github.io/introduction/index.html#frequently-asked-questions,
Intel only states "BSD-2-Clause-Patent"

    What license does SBL use?
    SBL is released under BSD plus Patents License.

Anyway, I will use your version in V2.

> 
> > +
> > +SRC_URI =
> "git://github.com/slimbootloader/slimbootloader;protocol=https;branch=mast
> er"
> > +SRCREV = "bf4a56033fffe9629ecbfbf778adc9cf1c64a6ac"
> > +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
> > +BBCLASSEXTEND = "native"
> 
> BTW what is the use case for the native recipe?
> Where would one need that?

Your are right. Currently there is no need for native recipe. 
I will remove it.

> 
> > +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() {
> > +    ln -sf ${STAGING_BINDIR_NATIVE}/python3-native/python3
> > +${STAGING_BINDIR_NATIVE}/python
> 
> This doesn't look right to me - nativepython3 is exported as PYTHON if I'm
> not mistaken, so the scripts can reference to that

There are many places in source code of slimbootloader using python directly.
Such as:

    cmd = 'python %s/IntelFsp2Pkg/Tools/GenCfgOpt.py UPDTXT %s/%s.dsc 
Build/%s/%s_%s/FV' % (
           workspace, pkgname, pkgname, pkgname, target, toolchain)
    ret = subprocess.call(cmd.split(' '))

Without soft link of "python", there will be an error "FileNotFoundError: 
[Errno 2] No such file or directory: 'python'".
Slimboot can also be built with its own docker, which doesn't have PYTHON 
exported.

Currently, adding a soft link to python3 seems to be the easiest way to work 
around it.
I will use "ln -sf ${PYTHON} ${STAGING_BINDIR_NATIVE}/python" in V2.

Thanks for your comments.

--Yongxin

> 
> > +
> > +    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}
> > +}
> >
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7391): 
https://lists.yoctoproject.org/g/meta-intel/message/7391
Mute This Topic: https://lists.yoctoproject.org/mt/87933554/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to