diff mbox series

systemd-boot: Add recipe to compile native

Message ID 20231201065336.1362984-1-quic_vkraleti@quicinc.com
State New
Headers show
Series systemd-boot: Add recipe to compile native | expand

Commit Message

Viswanath Kraleti Dec. 1, 2023, 6:53 a.m. UTC
systemd has ukify, a native tool, which will combine the kernel/initrd/stub
components to build the UKI (unified kernel images). systemd-boot recipe
isn't providing this tool.

To use ukify, one need systemd-boot native recipe so that a dependency can
be added on populate_sysroot task to get the tool under sysroot-native.

Signed-off-by: Viswanath Kraleti <quic_vkraleti@quicinc.com>
---
 .../systemd/systemd-boot-native_254.4.bb          | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd-boot-native_254.4.bb

Comments

Mikko Rapeli Dec. 1, 2023, 7:24 a.m. UTC | #1
Hi,

On Fri, Dec 01, 2023 at 12:23:36PM +0530, Viswanath Kraleti wrote:
> systemd has ukify, a native tool, which will combine the kernel/initrd/stub
> components to build the UKI (unified kernel images). systemd-boot recipe
> isn't providing this tool.
> 
> To use ukify, one need systemd-boot native recipe so that a dependency can
> be added on populate_sysroot task to get the tool under sysroot-native.

Why not call the recipe systemd-ukify then? systemd-boot doesn't provide more than that.

Then, when using ukify, one needs to have the .efi binaries from target systemd recipe which
for aarch64 are:

/usr/lib/systemd/boot/efi/addonaa64.efi.stub
/usr/lib/systemd/boot/efi/linuxaa64.efi.stub
/usr/lib/systemd/boot/efi/systemd-bootaa64.efi

and these could IMO be in a systemd-boot binary package because these files are not needed
in the main systemd binary package and rootfs.

The recipe itself looks neat and small, thanks!

For secure boot sbsign-native would be needed, but maybe a separate issue.

Cheers,

-Mikko

> Signed-off-by: Viswanath Kraleti <quic_vkraleti@quicinc.com>
> ---
>  .../systemd/systemd-boot-native_254.4.bb          | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>  create mode 100644 meta/recipes-core/systemd/systemd-boot-native_254.4.bb
> 
> diff --git a/meta/recipes-core/systemd/systemd-boot-native_254.4.bb b/meta/recipes-core/systemd/systemd-boot-native_254.4.bb
> new file mode 100644
> index 0000000000..6d89e493b6
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd-boot-native_254.4.bb
> @@ -0,0 +1,15 @@
> +require systemd.inc
> +
> +inherit native
> +
> +RRECOMMENDS:${PN} += "python3-pefile-native"
> +
> +COMPATIBLE_HOST = "(aarch64.*|arm.*|x86_64.*|i.86.*)-linux"
> +
> +do_configure[noexec] = "1"
> +do_compile[noexec] = "1"
> +
> +do_install () {
> +	install -d ${D}${bindir}
> +	install -m 0755 ${S}/src/ukify/ukify.py ${D}${bindir}/ukify
> +}
> -- 
> 2.25.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#191557): https://lists.openembedded.org/g/openembedded-core/message/191557
> Mute This Topic: https://lists.openembedded.org/mt/102910738/7159507
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [mikko.rapeli@linaro.org]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Dmitry Baryshkov Dec. 3, 2023, 9:54 a.m. UTC | #2
On Fri, 1 Dec 2023 at 09:24, Mikko Rapeli <mikko.rapeli@linaro.org> wrote:
>
> Hi,
>
> On Fri, Dec 01, 2023 at 12:23:36PM +0530, Viswanath Kraleti wrote:
> > systemd has ukify, a native tool, which will combine the kernel/initrd/stub
> > components to build the UKI (unified kernel images). systemd-boot recipe
> > isn't providing this tool.
> >
> > To use ukify, one need systemd-boot native recipe so that a dependency can
> > be added on populate_sysroot task to get the tool under sysroot-native.

The description is superfluous. It is enough to say that we have to
provide ukify tool to build images for systemd-boot

>
> Why not call the recipe systemd-ukify then? systemd-boot doesn't provide more than that.

I support the name systemd-boot-native, it links this tool to the
systemd-boot target package, the main user of the generated images.

>
> Then, when using ukify, one needs to have the .efi binaries from target systemd recipe which
> for aarch64 are:
>
> /usr/lib/systemd/boot/efi/addonaa64.efi.stub
> /usr/lib/systemd/boot/efi/linuxaa64.efi.stub
> /usr/lib/systemd/boot/efi/systemd-bootaa64.efi
>
> and these could IMO be in a systemd-boot binary package because these files are not needed
> in the main systemd binary package and rootfs.

systemd-boot recipe installs those files already. ssytemd-bootaa64.efi
goes to ${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE} in the package
(/boot/EFI/BOOT/), while addonaa64.efi.stub and linuxaa64.efi.stub are
installed to the DEPLOY_DIR. Indeed, they are not necessary on the
target system as one rarely builds a kernel on the OE rootfs. If the
need arises, we can probably add systemd-boot-stubs package, having
these two files.

>
> The recipe itself looks neat and small, thanks!
>
> For secure boot sbsign-native would be needed, but maybe a separate issue.
>
> Cheers,
>
> -Mikko
>
> > Signed-off-by: Viswanath Kraleti <quic_vkraleti@quicinc.com>
> > ---
> >  .../systemd/systemd-boot-native_254.4.bb          | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >  create mode 100644 meta/recipes-core/systemd/systemd-boot-native_254.4.bb
> >
> > diff --git a/meta/recipes-core/systemd/systemd-boot-native_254.4.bb b/meta/recipes-core/systemd/systemd-boot-native_254.4.bb
> > new file mode 100644
> > index 0000000000..6d89e493b6
> > --- /dev/null
> > +++ b/meta/recipes-core/systemd/systemd-boot-native_254.4.bb
> > @@ -0,0 +1,15 @@
> > +require systemd.inc
> > +
> > +inherit native
> > +
> > +RRECOMMENDS:${PN} += "python3-pefile-native"
> > +
> > +COMPATIBLE_HOST = "(aarch64.*|arm.*|x86_64.*|i.86.*)-linux"
> > +
> > +do_configure[noexec] = "1"
> > +do_compile[noexec] = "1"
> > +
> > +do_install () {
> > +     install -d ${D}${bindir}
> > +     install -m 0755 ${S}/src/ukify/ukify.py ${D}${bindir}/ukify
> > +}
> > --
> > 2.25.1
> >
>
> >
> >
> >
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#191559): https://lists.openembedded.org/g/openembedded-core/message/191559
> Mute This Topic: https://lists.openembedded.org/mt/102910738/3618183
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [dbaryshkov@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd-boot-native_254.4.bb b/meta/recipes-core/systemd/systemd-boot-native_254.4.bb
new file mode 100644
index 0000000000..6d89e493b6
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-boot-native_254.4.bb
@@ -0,0 +1,15 @@ 
+require systemd.inc
+
+inherit native
+
+RRECOMMENDS:${PN} += "python3-pefile-native"
+
+COMPATIBLE_HOST = "(aarch64.*|arm.*|x86_64.*|i.86.*)-linux"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install () {
+	install -d ${D}${bindir}
+	install -m 0755 ${S}/src/ukify/ukify.py ${D}${bindir}/ukify
+}