Skip to contentSkip to conversation

systemd-boot: new simple EFI bootloader replacing gummmiboot (branch yem/systemd-boot)

PATCH New Yann E. MORIN 5 participants 43 messages Dec 26, 2018 – Jan 11, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

v5 cover systemd-boot: new simple EFI bootloader replacing gummmiboot (branch yem/systemd-boot)

Hello All!

gummiboot has been deprecated about 5 years ago now [0], when it was integrated as a component of systemd, as systemd-boot.

Even then, it is still an interesting bootloader on its own, as it is simple and small, and can load any arbitrary EFI blob (even windows! ;-))

This series first brings two fixes to the meson infrastructure, that are required to be able to build systemd-boot: first, tell meson that it can never run what it builds (and override its internal mechanism), then fix the list of CPU famillies known to meson.

Then, it brings a new variable for the meson infrastructure, so packages can specify ninja "options" (really, build targets), like we already have for the other inpackage infrastructures. This will be used by the standalone systemd-boot, rather than duplicate the commands from the infra.

Then the existing systemd package gains an option to build the systemd-boot component.

And finally, we introduce systemd-boot as a standalone, separate package, as a new bootloader, which is incompatible with systemd (in the same sense that eudev is incompatible with systemd).

Note that we did not get rid of gummiboot yet, as some concerns were raised that systemd-boot was not a 100% drop-in replacement yet.

This series was initiated by James, who did most of the work, while I just refined it and put it into shape.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

Regards,
Yann E. MORIN.

The following changes since commit 0b7ada555863cc6c9b558fd6f93a182fa32a2101

Revert "package/x11r7/xcb-proto: remove pkgconf fix" (2018-12-22 17:26:41 +0100)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to d38239f86f99924e87dcb6e045b2de3ac0cb435f

boot/systemd-boot: new package (2018-12-26 09:21:03 +0100)

----------------------------------------------------------------
James Hilliard (4):
package/meson: never try to run generated target binaries package/meson: fix CPU familly
package/systemd: enable building of systemd-boot boot/systemd-boot: new package

Yann E. MORIN (1):
core/pkg-infra: allow meson packages to specify custom build rules

 boot/Config.in                                     |   1 +
 boot/systemd-boot/0001-fix-getty-unit.patch        |   1 +
 .../0002-install-don-t-use-ln-relative.patch       |   1 +
 ...etect-whether-struct-statx-is-defined-in-.patch |   1 +
 ...-linux-stat.h-check-with-other-checks-and.patch |   1 +
 ...sure-we-have-enough-space-for-the-DHCP6-o.patch |   1 +
 ...eson.build-fix-detection-of-Werror-shadow.patch |   1 +
 ...lax-depenencies-to-be-able-to-just-build-.patch |  40 ++++++++
 boot/systemd-boot/Config.in                        |  32 +++++++
 boot/systemd-boot/boot-files                       |   1 +
 boot/systemd-boot/systemd-boot.hash                |   1 +
 boot/systemd-boot/systemd-boot.mk                  | 102 +++++++++++++++++++++
 docs/manual/adding-packages-meson.txt              |   3 +
 package/meson/cross-compilation.conf.in            |   1 +
 package/meson/meson.mk                             |  31 ++++++-
 package/pkg-meson.mk                               |   4 +-
 package/systemd/Config.in                          |  28 ++++++
 package/systemd/boot-files/buildroot.conf          |   3 +
 package/systemd/boot-files/loader.conf             |   2 +
 package/systemd/systemd.mk                         |  35 ++++++-
 20 files changed, 285 insertions(+), 5 deletions(-)
 create mode 120000 boot/systemd-boot/0001-fix-getty-unit.patch
 create mode 120000 boot/systemd-boot/0002-install-don-t-use-ln-relative.patch
 create mode 120000 boot/systemd-boot/0003-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
 create mode 120000 boot/systemd-boot/0004-meson-unify-linux-stat.h-check-with-other-checks-and.patch
 create mode 120000 boot/systemd-boot/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
 create mode 120000 boot/systemd-boot/0006-meson.build-fix-detection-of-Werror-shadow.patch
 create mode 100644 boot/systemd-boot/1000-buildsys-relax-depenencies-to-be-able-to-just-build-.patch
 create mode 100644 boot/systemd-boot/Config.in
 create mode 120000 boot/systemd-boot/boot-files
 create mode 120000 boot/systemd-boot/systemd-boot.hash
 create mode 100644 boot/systemd-boot/systemd-boot.mk
 create mode 100644 package/systemd/boot-files/buildroot.conf
 create mode 100644 package/systemd/boot-files/loader.conf
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v5 1/5 package/meson: never try to run generated target binaries

From: James Hilliard <[email protected]>

As explained in [0], meson will try on its own to decide whether it can run what it builds. If it happens that the host and target CPUs are "compatible", that test may fail and meson may believe it can run what it builds.

Override that test by using needs_exe_wrapper=true, and not defining an actual exe_wrapper.

[0] https://mesonbuild.com/Cross-compilation.html

[yann.morin.1998 at free.fr:
- split in its own patch
- improve commit log
]

---
 package/meson/cross-compilation.conf.in | 1 +
 1 file changed, 1 insertion(+)
package/meson/cross-compilation.conf.in +1 -0
index 0eec74087b..fc8e27f7eb 100644
@@ -11,6 +11,7 @@ strip = '@TARGET_CROSS at strip'
 pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'
 
 [properties]
+needs_exe_wrapper = true
 c_args = [@TARGET_CFLAGS@]
 c_link_args = [@TARGET_LDFLAGS@]
 cpp_args = [@TARGET_CXXFLAGS@]
Signature · 1 line
2.14.1
#2 lore raw

PATCH v5 1/5 package/meson: never try to run generated target binaries

Hello,

Quoted 13 lines · Yann E. MORIN

From: James Hilliard <[email protected]>

As explained in [0], meson will try on its own to decide whether it can run what it builds. If it happens that the host and target CPUs are "compatible", that test may fail and meson may believe it can run what it builds.

Override that test by using needs_exe_wrapper=true, and not defining an actual exe_wrapper.

[0] https://mesonbuild.com/Cross-compilation.html

Quoted 8 lines

[yann.morin.1998 at free.fr:
- split in its own patch
- improve commit log
]

---
 package/meson/cross-compilation.conf.in | 1 +
 1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v5 2/5 package/meson: fix CPU familly

In reply to Yann E. MORIN

From: James Hilliard <[email protected]>

As explained in [0], meson recognises a certain set of CPU famillies, whose names slightly differ from those we know them as.

If we don't pass the proper cpu_familly, meson whines:
WARNING: Unknown CPU family 'i686', please report this at [...]

Subsequently, packages that use that to decide on what they should build and how they should build it, fail to build. That is the case for the upcoming systemd-boot, for example.

Fix that by using the list propvided by the meson documentation [0].

[0] https://mesonbuild.com/Reference-tables.html#cpu-families

[yann.morin.1998 at free.fr:
- split in its own patch
- imnprove commit log
]

---
 package/meson/meson.mk | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)
package/meson/meson.mk +30 -1
index e1675c21b8..1113bf0e29 100644
@@ -16,6 +16,35 @@ HOST_MESON_NEEDS_HOST_PYTHON = python3
 HOST_MESON_TARGET_ENDIAN = $(call LOWERCASE,$(BR2_ENDIAN))
 HOST_MESON_TARGET_CPU = $(GCC_TARGET_CPU)
 
+# https://mesonbuild.com/Reference-tables.html#cpu-families
+ifeq ($(BR2_arcle)$(BR2_arceb),y)
+HOST_MESON_TARGET_CPU_FAMILY = arc
+else ifeq ($(BR2_arm)$(BR2_armeb),y)
+HOST_MESON_TARGET_CPU_FAMILY = arm
+else ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y)
+HOST_MESON_TARGET_CPU_FAMILY = aarch64
+else ifeq ($(BR2_i386),y)
+HOST_MESON_TARGET_CPU_FAMILY = x86
+else ifeq ($(BR2_mips)$(BR2_mipsel),y)
+HOST_MESON_TARGET_CPU_FAMILY = mips
+else ifeq ($(BR2_mips64)$(BR2_mips64el),y)
+HOST_MESON_TARGET_CPU_FAMILY = mips64
+else ifeq ($(BR2_powerpc),y)
+HOST_MESON_TARGET_CPU_FAMILY = ppc
+else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
+HOST_MESON_TARGET_CPU_FAMILY = ppc64
+else ifeq ($(BR2_riscv),y)
+HOST_MESON_TARGET_CPU_FAMILY = riscv64
+else ifeq ($(BR2_sparc),y)
+HOST_MESON_TARGET_CPU_FAMILY = sparc
+else ifeq ($(BR2_sparc64),y)
+HOST_MESON_TARGET_CPU_FAMILY = sparc64
+else ifeq ($(BR2_x86_64),y)
+HOST_MESON_TARGET_CPU_FAMILY = x86_64
+else
+HOST_MESON_TARGET_CPU_FAMILY = $(ARCH)
+endif
+
 HOST_MESON_SED_CFLAGS = $(if $(TARGET_CFLAGS),`printf '"%s"$(comma) ' $(TARGET_CFLAGS)`)
 HOST_MESON_SED_LDFLAGS = $(if $(TARGET_LDFLAGS),`printf '"%s"$(comma) ' $(TARGET_LDFLAGS)`)
 HOST_MESON_SED_CXXFLAGS = $(if $(TARGET_CXXFLAGS),`printf '"%s"$(comma) ' $(TARGET_CXXFLAGS)`)
@@ -23,7 +52,7 @@ HOST_MESON_SED_CXXFLAGS = $(if $(TARGET_CXXFLAGS),`printf '"%s"$(comma) ' $(TARG
 define HOST_MESON_INSTALL_CROSS_CONF
 	mkdir -p $(HOST_DIR)/etc/meson
 	sed -e "s%@TARGET_CROSS@%$(TARGET_CROSS)%g" \
-	    -e "s%@TARGET_ARCH@%$(ARCH)%g" \
+	    -e "s%@TARGET_ARCH@%$(HOST_MESON_TARGET_CPU_FAMILY)%g" \
 	    -e "s%@TARGET_CPU@%$(HOST_MESON_TARGET_CPU)%g" \
 	    -e "s%@TARGET_ENDIAN@%$(HOST_MESON_TARGET_ENDIAN)%g" \
 	    -e "s%@TARGET_CFLAGS@%$(HOST_MESON_SED_CFLAGS)%g" \
Signature · 1 line
2.14.1
#4 lore raw

PATCH v5 2/5 package/meson: fix CPU familly

Hello,

Quoted 17 lines · Yann E. MORIN

From: James Hilliard <[email protected]>

As explained in [0], meson recognises a certain set of CPU famillies, whose names slightly differ from those we know them as.

If we don't pass the proper cpu_familly, meson whines:
WARNING: Unknown CPU family 'i686', please report this at [...]

Subsequently, packages that use that to decide on what they should build and how they should build it, fail to build. That is the case for the upcoming systemd-boot, for example.

Fix that by using the list propvided by the meson documentation [0].

[0] https://mesonbuild.com/Reference-tables.html#cpu-families

Quoted 8 lines

[yann.morin.1998 at free.fr:
- split in its own patch
- imnprove commit log
]

---
 package/meson/meson.mk | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v5 3/5 core/pkg-infra: allow meson packages to specify custom build rules

In reply to Yann E. MORIN

Some packages may want to build only specific targets, instead of the default.

So, allow them to provide FOO_NINJA_OPTS (not really options, but we just mimicked the naming we already have for autotools packages).

Update the manual accordingly.

Cc Eric Le Bihan <[email protected]>
Cc James Hilliard <[email protected]>
---
 docs/manual/adding-packages-meson.txt | 3 +++
 package/pkg-meson.mk                  | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
docs/manual/adding-packages-meson.txt +3 -0
index c52fe10506..549319b192 100644
@@ -94,3 +94,6 @@ will therefore only use a few of them.
 * +FOO_NINJA_ENV+, to specify additional environment variables to pass to
   +ninja+, meson companion tool in charge of the build operations. By default,
   empty.
+
+* +FOO_NINJA_OPTS+, to specify a space-separated list of targets to build. By
+  default, empty, to build the default target(s).
package/pkg-meson.mk +2 -2
index 507e686068..0588660dbf 100644
@@ -103,12 +103,12 @@ ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)
 define $(2)_BUILD_CMDS
 	$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+		$$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
 endef
 else
 define $(2)_BUILD_CMDS
 	$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-		$$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+		$$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
 endef
 endif
 endif
Signature · 1 line
2.14.1
#6 lore raw

PATCH v5 3/5 core/pkg-infra: allow meson packages to specify custom build rules

Quoted 34 lines · Yann E. MORIN

Some packages may want to build only specific targets, instead of the default.

So, allow them to provide FOO_NINJA_OPTS (not really options, but we just mimicked the naming we already have for autotools packages).

Update the manual accordingly.

Cc Eric Le Bihan <[email protected]>
Cc James Hilliard <[email protected]>
---
 docs/manual/adding-packages-meson.txt | 3 +++
 package/pkg-meson.mk                  | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
docs/manual/adding-packages-meson.txt +3 -0
index c52fe10506..549319b192 100644
@@ -94,3 +94,6 @@ will therefore only use a few of them.
 * +FOO_NINJA_ENV+, to specify additional environment variables to pass to
   +ninja+, meson companion tool in charge of the build operations. By default,
   empty.
+
+* +FOO_NINJA_OPTS+, to specify a space-separated list of targets to build. By
+  default, empty, to build the default target(s).
package/pkg-meson.mk +0 -0
index 507e686068..0588660dbf 100644
@@ -103,12 +103,12 @@ ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)

package/pkg-meson.mk ifndef $(2)_BUILD_CMDS · line 111

Quoted 10 lines
package/pkg-meson.mk +2 -2
 define $(2)_BUILD_CMDS
        $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-               $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+               $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
 endef
 else
 define $(2)_BUILD_CMDS
        $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-               $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+               $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build

shouldn't $$($$(PKG)_NINJA_OPTS) come after $$($$(PKG)_SRCDIR)/build?

Quoted 6 lines
package/pkg-meson.mk +0 -1
 endef
 endif
 endif
--

2.14.1

#7 lore raw

PATCH v5 3/5 core/pkg-infra: allow meson packages to specify custom build rules

James, ?ric, All,

On 2018-12-26 05:36 -0600, James Hilliard spake thusly:

Quoted 3 lines · Yann E. MORIN
Quoted 2 lines

Some packages may want to build only specific targets, instead of the default.

[--SNIP--]

Quoted 9 lines
Quoted 9 lines
package/pkg-meson.mk +0 -1
index 507e686068..0588660dbf 100644
@@ -103,12 +103,12 @@ ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)
 define $(2)_BUILD_CMDS
        $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-               $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
Quoted 8 lines

package/pkg-meson.mk ifndef $(2)_BUILD_CMDS · line 111

Quoted 7 lines
package/pkg-meson.mk +2 -1
+               $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
 endef
 else
 define $(2)_BUILD_CMDS
        $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-               $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+               $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build

shouldn't $$($$(PKG)_NINJA_OPTS) come after $$($$(PKG)_SRCDIR)/build?

I don't know. It worked that way for me, and I wanted to group together the two _OPTS variables, and also like we do for the autotools infra. But your suggestion also makes sense, and is indeed more in-line with the ninja's short-help:

    $ ./output/host/bin/ninja -h
    usage: ninja [options] [targets...]
    [...]

?ric, your opinion?

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH v5 3/5 core/pkg-infra: allow meson packages to specify custom build rules

Quoted 26 lines · Yann E. MORIN

James, ?ric, All,

On 2018-12-26 05:36 -0600, James Hilliard spake thusly:

Quoted 3 lines · Yann E. MORIN
Quoted 2 lines

Some packages may want to build only specific targets, instead of the default.

[--SNIP--]

Quoted 9 lines
Quoted 9 lines
package/pkg-meson.mk +0 -1
index 507e686068..0588660dbf 100644
@@ -103,12 +103,12 @@ ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)
 define $(2)_BUILD_CMDS
        $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-               $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
Quoted 8 lines

package/pkg-meson.mk ifndef $(2)_BUILD_CMDS · line 111

Quoted 7 lines
package/pkg-meson.mk +2 -1
+               $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
 endef
 else
 define $(2)_BUILD_CMDS
        $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-               $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+               $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build

shouldn't $$($$(PKG)_NINJA_OPTS) come after $$($$(PKG)_SRCDIR)/build?

Quoted 4 lines

I don't know. It worked that way for me, and I wanted to group together the two _OPTS variables, and also like we do for the autotools infra. But your suggestion also makes sense, and is indeed more in-line with the ninja's short-help:

Maybe add a $$($$(PKG)_NINJA_TARGETS) option as well?

Quoted 17 lines
    $ ./output/host/bin/ninja -h
    usage: ninja [options] [targets...]
    [...]

?ric, your opinion?

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#9 lore raw

PATCH v5 3/5 core/pkg-infra: allow meson packages to specify custom build rules

James, All,

On 2018-12-26 22:21 -0600, James Hilliard spake thusly:

Quoted 27 lines · Yann E. MORIN
Quoted 26 lines

James, ?ric, All,

On 2018-12-26 05:36 -0600, James Hilliard spake thusly:

Quoted 3 lines · Yann E. MORIN
Quoted 2 lines

Some packages may want to build only specific targets, instead of the default.

[--SNIP--]

Quoted 17 lines
Quoted 6 lines
package/pkg-meson.mk +0 -0
index 507e686068..0588660dbf 100644
@@ -103,12 +103,12 @@ ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)

package/pkg-meson.mk ifndef $(2)_BUILD_CMDS · line 111

Quoted 10 lines
package/pkg-meson.mk +2 -2
 define $(2)_BUILD_CMDS
        $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-               $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+               $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
 endef
 else
 define $(2)_BUILD_CMDS
        $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
-               $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+               $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build

shouldn't $$($$(PKG)_NINJA_OPTS) come after $$($$(PKG)_SRCDIR)/build?

Quoted 5 lines
Quoted 4 lines

I don't know. It worked that way for me, and I wanted to group together the two _OPTS variables, and also like we do for the autotools infra. But your suggestion also makes sense, and is indeed more in-line with the ninja's short-help:

Maybe add a $$($$(PKG)_NINJA_TARGETS) option as well?

Not really, because we want to do the same in all the packages infras.

For example, autotools-package uses FOO_MAKE_OPTS to apss arbitrary options to make, and that is almost exclusively used to in fact pass the target rule to make.

So, we want to keep this idiosyncracy consistent acros infras, hence FOO_NINJA_OPTS, when I agree that it will almost exclusively (or even exclusively) be used to pass the target rules.

Regards,
Yann E. MORIN.

Quoted 16 lines
Quoted 16 lines
    $ ./output/host/bin/ninja -h
    usage: ninja [options] [targets...]
    [...]

?ric, your opinion?

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#10 lore raw

PATCH v5 3/5 core/pkg-infra: allow meson packages to specify custom build rules

In reply to Yann E. MORIN

Hello,

Quoted 8 lines · Yann E. MORIN

Some packages may want to build only specific targets, instead of the default.

So, allow them to provide FOO_NINJA_OPTS (not really options, but we just mimicked the naming we already have for autotools packages).

Update the manual accordingly.

Quoted 7 lines
Cc Eric Le Bihan <[email protected]>
Cc James Hilliard <[email protected]>
---
 docs/manual/adding-packages-meson.txt | 3 +++
 package/pkg-meson.mk                  | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#11 lore raw

PATCH v5 4/5 package/systemd: enable building of systemd-boot

In reply to Yann E. MORIN

From: James Hilliard <[email protected]>

systemd-boot is the integration of gummiboot into systemd, when gummiboot is no longer maintained [0].

Add an option to build systemd-boot as part of the systemd build.

Install the boot files, that can serve as a template for the user to tweak for their system.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

[yann.morin.1998 at free.fr:
- add missing depends on i386 || x86_64
- add missing dependency to gnu-efi
- add missing boot files (they will be shared with standalone systemd-boot later)
]

---
 package/systemd/Config.in                 | 28 +++++++++++++++++++++++++
 package/systemd/boot-files/buildroot.conf |  3 +++
 package/systemd/boot-files/loader.conf    |  2 ++
 package/systemd/systemd.mk                | 34 +++++++++++++++++++++++++++++--
 4 files changed, 65 insertions(+), 2 deletions(-)
 create mode 100644 package/systemd/boot-files/buildroot.conf
 create mode 100644 package/systemd/boot-files/loader.conf
package/systemd/Config.in +28 -0
index 25f322e8f3..50d09b34a5 100644
@@ -77,6 +77,34 @@ if BR2_PACKAGE_SYSTEMD
 config BR2_PACKAGE_PROVIDES_UDEV
 	default "systemd"
 
+config BR2_PACKAGE_SYSTEMD_BOOT
+	bool "systemd-boot"
+	depends on BR2_i386 || BR2_x86_64
+	select BR2_PACKAGE_GNU_EFI
+	help
+	  systemd-boot is a simple UEFI boot manager which executes
+	  configured EFI images. The default entry is selected by a
+	  configured pattern (glob) or an on-screen menu.
+
+	  systemd-boot operates on the EFI System Partition (ESP)
+	  only. Configuration file fragments, kernels, initrds, other
+	  EFI images need to reside on the ESP. Linux kernels need to
+	  be built with CONFIG_EFI_STUB to be able to be directly
+	  executed as an EFI image.
+
+	  See the Grub2 help text for details on preparing an EFI
+	  capable disk image using systemd-boot: the instructions are
+	  exactly the same, except that the systemd-boot configuration
+	  files will be located in /loader/ inside the EFI partition.
+
+	  https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/
+
+config BR2_PACKAGE_SYSTEMD_BOOT_EFI_ARCH
+	string
+	depends on BR2_PACKAGE_SYSTEMD_BOOT
+	default "ia32"  if BR2_i386
+	default "x64"   if BR2_x86_64
+
 config BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY
 	bool "HTTP server for journal events"
 	select BR2_PACKAGE_LIBMICROHTTPD
package/systemd/boot-files/buildroot.conf new file +3 -0
new file mode 100644
index 0000000000..16d4d85f4a
@@ -0,0 +1,3 @@
+title	Buildroot
+linux	/bzImage
+options	root=/dev/sda2 rootwait console=tty1
package/systemd/boot-files/loader.conf new file +2 -0
new file mode 100644
index 0000000000..93b77b8f93
@@ -0,0 +1,2 @@
+timeout 3
+default buildroot
package/systemd/systemd.mk +32 -2
index e53f0b699a..2822d4423c 100644
@@ -24,8 +24,6 @@ SYSTEMD_CONF_OPTS += \
 	-Dman=false \
 	-Dima=false \
 	-Dlibcryptsetup=false \
-	-Defi=false \
-	-Dgnu-efi=false \
 	-Dldconfig=false \
 	-Ddefault-dnssec=no \
 	-Dtests=false \
@@ -332,6 +330,34 @@ else
 SYSTEMD_CONF_OPTS += -Dhibernate=false
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_BOOT),y)
+SYSTEMD_INSTALL_IMAGES = YES
+SYSTEMD_DEPENDENCIES += gnu-efi
+SYSTEMD_CONF_OPTS += \
+	-Defi=true \
+	-Dgnu-efi=true \
+	-Defi-cc=$(TARGET_CC) \
+	-Defi-ld=$(TARGET_LD) \
+	-Defi-libdir=$(STAGING_DIR)/usr/lib \
+	-Defi-ldsdir=$(STAGING_DIR)/usr/lib \
+	-Defi-includedir=$(STAGING_DIR)/usr/include/efi
+
+SYSTEMD_BOOT_EFI_ARCH = $(call qstrip,$(BR2_PACKAGE_SYSTEMD_BOOT_EFI_ARCH))
+define SYSTEMD_INSTALL_BOOT_FILES
+	$(INSTALL) -D -m 0644 $(@D)/build/src/boot/efi/systemd-boot$(SYSTEMD_BOOT_EFI_ARCH).efi \
+		$(BINARIES_DIR)/efi-part/EFI/BOOT/boot$(SYSTEMD_BOOT_EFI_ARCH).efi
+	echo "boot$(SYSTEMD_BOOT_EFI_ARCH).efi" > \
+		$(BINARIES_DIR)/efi-part/startup.nsh
+	$(INSTALL) -D -m 0644 $(SYSTEMD_PKGDIR)/boot-files/loader.conf \
+		$(BINARIES_DIR)/efi-part/loader/loader.conf
+	$(INSTALL) -D -m 0644 $(SYSTEMD_PKGDIR)/boot-files/buildroot.conf \
+		$(BINARIES_DIR)/efi-part/loader/entries/buildroot.conf
+endef
+
+else
+SYSTEMD_CONF_OPTS += -Defi=false -Dgnu-efi=false
+endif # BR2_PACKAGE_SYSTEMD_BOOT == y
+
 SYSTEMD_FALLBACK_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
 ifneq ($(SYSTEMD_FALLBACK_HOSTNAME),)
 SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME)
@@ -356,6 +382,10 @@ SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
 	SYSTEMD_INSTALL_MACHINEID_HOOK \
 	SYSTEMD_INSTALL_RESOLVCONF_HOOK
 
+define SYSTEMD_INSTALL_IMAGES_CMDS
+	$(SYSTEMD_INSTALL_BOOT_FILES)
+endef
+
 define SYSTEMD_USERS
 	- - input -1 * - - - Input device group
 	- - systemd-journal -1 * - - - Journal
Signature · 1 line
2.14.1
#12 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

In reply to Yann E. MORIN

From: James Hilliard <[email protected]>

systemd-boot is the integration of gummiboot into systemd, and gummiboot is no longer maintained [0]. However, it is still interesting to use it as a simple, stand-alone bootloader.

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

To avoid duplication, we just symlink the systemd patches as-is. We just need to add a specific patch, that just relaxes the dependency checks, since we're only interested in building the boot blobs.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

[yann.morin.1998 at free.fr:
- drop the duality due to to interdependence with systemd
- share boot files with systemd
- use the new _NINJA_OPTS variable
- add patch to allow building only systemd-boot
- specify _SOURCE to be sure to share wth systemd
- rename the .hash file
- add comment about syncing the version with systemd
]

---
Changes v2 -> v3 (Yann):
- changes identified in the commit log

Changes v1 -> v2 (James):
- split off from systemd into its own package (Yann)

---
 boot/Config.in                                     |   1 +
 boot/systemd-boot/0001-fix-getty-unit.patch        |   1 +
 .../0002-install-don-t-use-ln-relative.patch       |   1 +
 ...etect-whether-struct-statx-is-defined-in-.patch |   1 +
 ...-linux-stat.h-check-with-other-checks-and.patch |   1 +
 ...sure-we-have-enough-space-for-the-DHCP6-o.patch |   1 +
 ...eson.build-fix-detection-of-Werror-shadow.patch |   1 +
 ...lax-depenencies-to-be-able-to-just-build-.patch |  40 ++++++++
 boot/systemd-boot/Config.in                        |  32 +++++++
 boot/systemd-boot/boot-files                       |   1 +
 boot/systemd-boot/systemd-boot.hash                |   1 +
 boot/systemd-boot/systemd-boot.mk                  | 102 +++++++++++++++++++++
 package/systemd/Config.in                          |   2 +-
 package/systemd/systemd.mk                         |   1 +
 14 files changed, 185 insertions(+), 1 deletion(-)
 create mode 120000 boot/systemd-boot/0001-fix-getty-unit.patch
 create mode 120000 boot/systemd-boot/0002-install-don-t-use-ln-relative.patch
 create mode 120000 boot/systemd-boot/0003-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
 create mode 120000 boot/systemd-boot/0004-meson-unify-linux-stat.h-check-with-other-checks-and.patch
 create mode 120000 boot/systemd-boot/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
 create mode 120000 boot/systemd-boot/0006-meson.build-fix-detection-of-Werror-shadow.patch
 create mode 100644 boot/systemd-boot/1000-buildsys-relax-depenencies-to-be-able-to-just-build-.patch
 create mode 100644 boot/systemd-boot/Config.in
 create mode 120000 boot/systemd-boot/boot-files
 create mode 120000 boot/systemd-boot/systemd-boot.hash
 create mode 100644 boot/systemd-boot/systemd-boot.mk
boot/Config.in +1 -0
index 8e0c8e5df4..5b7f606343 100644
@@ -16,6 +16,7 @@ source "boot/mxs-bootlets/Config.in"
 source "boot/riscv-pk/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
+source "boot/systemd-boot/Config.in"
 source "boot/ts4800-mbrboot/Config.in"
 source "boot/uboot/Config.in"
 source "boot/vexpress-firmware/Config.in"
boot/systemd-boot/0001-fix-getty-unit.patch new file +1 -0
new file mode 120000
index 0000000000..ffb5f5306d
@@ -0,0 +1 @@
+../../package/systemd/0001-fix-getty-unit.patch
\ No newline at end of file
boot/systemd-boot/0002-install-don-t-use-ln-relative.patch new file +1 -0
new file mode 120000
index 0000000000..cfe0291c86
@@ -0,0 +1 @@
+../../package/systemd/0002-install-don-t-use-ln-relative.patch
\ No newline at end of file
boot/systemd-boot/0003-build-sys-Detect-whether-struct-statx-is-defined-in-.patch new file +1 -0
new file mode 120000
index 0000000000..ded8b4f6aa
@@ -0,0 +1 @@
+../../package/systemd/0003-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
\ No newline at end of file
boot/systemd-boot/0004-meson-unify-linux-stat.h-check-with-other-checks-and.patch new file +1 -0
new file mode 120000
index 0000000000..32bc435aa1
@@ -0,0 +1 @@
+../../package/systemd/0004-meson-unify-linux-stat.h-check-with-other-checks-and.patch
\ No newline at end of file
boot/systemd-boot/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch new file +1 -0
new file mode 120000
index 0000000000..003d6a7821
@@ -0,0 +1 @@
+../../package/systemd/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
\ No newline at end of file
boot/systemd-boot/0006-meson.build-fix-detection-of-Werror-shadow.patch new file +1 -0
new file mode 120000
index 0000000000..0e0a5cfab1
@@ -0,0 +1 @@
+../../package/systemd/0006-meson.build-fix-detection-of-Werror-shadow.patch
\ No newline at end of file
boot/systemd-boot/1000-buildsys-relax-depenencies-to-be-able-to-just-build-.patch new file +40 -0
new file mode 100644
index 0000000000..46cfe31866
@@ -0,0 +1,40 @@
+From 6fd68b581997cd79cee2c957fe3e2d7328727e71 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Tue, 25 Dec 2018 10:36:32 +0100
+Subject: [PATCH] buildsys: relax depenencies to be able to just build
+ systemd-boot
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+ meson.build | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 04331dd41..1d9157d19 100644
+--- a/meson.build
++++ b/meson.build
+@@ -591,7 +591,7 @@ conf.set('GPERF_LEN_TYPE', gperf_len_type,
+ ############################################################
+ 
+ if not cc.has_header('sys/capability.h')
+-        error('POSIX caps headers not found')
++        warning('POSIX caps headers not found')
+ endif
+ foreach header : ['crypt.h',
+                   'linux/btrfs.h',
+@@ -789,10 +789,10 @@ libcrypt = cc.find_library('crypt')
+ libcap = dependency('libcap', required : false)
+ if not libcap.found()
+         # Compat with Ubuntu 14.04 which ships libcap w/o .pc file
+-        libcap = cc.find_library('cap')
++        libcap = cc.find_library('cap', required : false)
+ endif
+ 
+-libmount = dependency('mount',
++libmount = dependency('mount', required : false,
+                       version : fuzzer_build ? '>= 0' : '>= 2.30')
+ 
+ want_seccomp = get_option('seccomp')
+-- 
+2.14.1
+
boot/systemd-boot/Config.in new file +32 -0
new file mode 100644
index 0000000000..51dcebbf42
@@ -0,0 +1,32 @@
+config BR2_TARGET_SYSTEMD_BOOT
+	bool "systemd-boot"
+	depends on BR2_i386 || BR2_x86_64
+	depends on !BR2_PACKAGE_SYSTEMD
+	select BR2_PACKAGE_GNU_EFI
+	help
+	  systemd-boot is a simple UEFI boot manager which executes
+	  configured EFI images. The default entry is selected by a
+	  configured pattern (glob) or an on-screen menu.
+
+	  systemd-boot operates on the EFI System Partition (ESP)
+	  only. Configuration file fragments, kernels, initrds, other
+	  EFI images need to reside on the ESP. Linux kernels need to
+	  be built with CONFIG_EFI_STUB to be able to be directly
+	  executed as an EFI image.
+
+	  See the Grub2 help text for details on preparing an EFI
+	  capable disk image using systemd-boot: the instructions are
+	  exactly the same, except that the systemd-boot configuration
+	  files will be located in /loader/ inside the EFI partition.
+
+	  https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/
+
+config BR2_TARGET_SYSTEMD_BOOT_EFI_ARCH
+	string
+	default "ia32"  if BR2_i386
+	default "x64"   if BR2_x86_64
+	depends on BR2_TARGET_SYSTEMD_BOOT
+
+comment "systemd-boot is provided by systemd"
+	depends on BR2_i386 || BR2_x86_64
+	depends on BR2_PACKAGE_SYSTEMD
boot/systemd-boot/boot-files new file +1 -0
new file mode 120000
index 0000000000..0ff51d4e0a
@@ -0,0 +1 @@
+../../package/systemd/boot-files
\ No newline at end of file
boot/systemd-boot/systemd-boot.hash new file +1 -0
new file mode 120000
index 0000000000..4259f40c21
@@ -0,0 +1 @@
+../../package/systemd/systemd.hash
\ No newline at end of file
boot/systemd-boot/systemd-boot.mk new file +102 -0

102 lines not on this page · raw message

package/systemd/Config.in +1 -1
index 50d09b34a5..a99358fc7b 100644
@@ -101,9 +101,9 @@ config BR2_PACKAGE_SYSTEMD_BOOT
 
 config BR2_PACKAGE_SYSTEMD_BOOT_EFI_ARCH
 	string
-	depends on BR2_PACKAGE_SYSTEMD_BOOT
 	default "ia32"  if BR2_i386
 	default "x64"   if BR2_x86_64
+	depends on BR2_PACKAGE_SYSTEMD_BOOT
 
 config BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY
 	bool "HTTP server for journal events"
package/systemd/systemd.mk +1 -0
index 2822d4423c..3f8f7aaac3 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# When updating this version, please also update it in boot/systemd-boot/
 SYSTEMD_VERSION = 239
 SYSTEMD_SITE = $(call github,systemd,systemd,v$(SYSTEMD_VERSION))
 SYSTEMD_LICENSE = LGPL-2.1+, GPL-2.0+ (udev), Public Domain (few source files, see README)
Signature · 1 line
2.14.1
#13 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

All,

On 2018-12-26 09:52 +0100, Yann E. MORIN spake thusly:
[--SNIP--]

package/systemd/Config.in config BR2_PACKAGE_SYSTEMD_BOOT · line 106

Quoted 12 lines
package/systemd/Config.in +1 -1
index 50d09b34a5..a99358fc7b 100644
@@ -101,9 +101,9 @@ config BR2_PACKAGE_SYSTEMD_BOOT
 
 config BR2_PACKAGE_SYSTEMD_BOOT_EFI_ARCH
 	string
-	depends on BR2_PACKAGE_SYSTEMD_BOOT
 	default "ia32"  if BR2_i386
 	default "x64"   if BR2_x86_64
+	depends on BR2_PACKAGE_SYSTEMD_BOOT

Woops... I git-commit-fixup'ed the wrong commit...

I'll wait for other comments before respinning, unless the proper fixup is done when applying; just say.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#14 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

In reply to Yann E. MORIN

Hello,

Thanks for working on this!

Quoted 14 lines · Yann E. MORIN

From: James Hilliard <[email protected]>

systemd-boot is the integration of gummiboot into systemd, and gummiboot is no longer maintained [0]. However, it is still interesting to use it as a simple, stand-alone bootloader.

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

Quoted 7 lines

To avoid duplication, we just symlink the systemd patches as-is. We just need to add a specific patch, that just relaxes the dependency checks, since we're only interested in building the boot blobs.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

Do we have a serious valid use-case for wanting to use systemd-boot without systemd? This adds a fair bit of complexity, so I'd like to be sure of what we're doing here.

An example of the complexity is with the symlinks to the patches. Every time a patch is added/removed in package/systemd/, one should remember to adjust the symlinks in boot/systemd-boot/. This is something that can very easily be missed.

So it would be good to make sure we have a really solid use-case for adding this complexity.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#15 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 32 lines · Thomas Petazzoni

Hello,

Thanks for working on this!

Quoted 14 lines · Yann E. MORIN

From: James Hilliard <[email protected]>

systemd-boot is the integration of gummiboot into systemd, and gummiboot is no longer maintained [0]. However, it is still interesting to use it as a simple, stand-alone bootloader.

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

Quoted 7 lines

To avoid duplication, we just symlink the systemd patches as-is. We just need to add a specific patch, that just relaxes the dependency checks, since we're only interested in building the boot blobs.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

Do we have a serious valid use-case for wanting to use systemd-boot without systemd? This adds a fair bit of complexity, so I'd like to be sure of what we're doing here.

Quoted 7 lines

An example of the complexity is with the symlinks to the patches. Every time a patch is added/removed in package/systemd/, one should remember to adjust the symlinks in boot/systemd-boot/. This is something that can very easily be missed.

So it would be good to make sure we have a really solid use-case for adding this complexity.

Well systemd-boot is a perfectly good bootloader even without systemd. It uses plain text config files so it's not hard to manage even without the systemd userspace tools.

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#16 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Hello,

Quoted 3 lines · James Hilliard

Well systemd-boot is a perfectly good bootloader even without systemd. It uses plain text config files so it's not hard to manage even without the systemd userspace tools.

OK, but there must be some compelling reason to use systemd-boot instead of another x86-capable bootloader, such as grub or syslinux. I believe even U-Boot works on x86 EFI systems. All of these also use plain text configuration files that don't require userspace tools.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#17 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 5 lines · Thomas Petazzoni

Hello,

On Wed, 26 Dec 2018 15:37:42 -0600, James Hilliard wrote:

Quoted 8 lines
Quoted 3 lines

Well systemd-boot is a perfectly good bootloader even without systemd. It uses plain text config files so it's not hard to manage even without the systemd userspace tools.

OK, but there must be some compelling reason to use systemd-boot instead of another x86-capable bootloader, such as grub or syslinux. I believe even U-Boot works on x86 EFI systems. All of these also use plain text configuration files that don't require userspace tools.

Well it had a bootcount feature with reversion to last good entry added recently which would be useful for embedded systems upgrade automatic rollbacks. It also separates out each boot entry config file which I think is not something most other bootloaders do.

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#18 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

In reply to Thomas Petazzoni

Thomas, All,

Adding Peter in the loop; see at the end.

On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:

Quoted 23 lines · Yann E. MORIN
Quoted 14 lines

From: James Hilliard <[email protected]>

systemd-boot is the integration of gummiboot into systemd, and gummiboot is no longer maintained [0]. However, it is still interesting to use it as a simple, stand-alone bootloader.

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

Quoted 7 lines

To avoid duplication, we just symlink the systemd patches as-is. We just need to add a specific patch, that just relaxes the dependency checks, since we're only interested in building the boot blobs.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

Quoted 8 lines

Do we have a serious valid use-case for wanting to use systemd-boot without systemd? This adds a fair bit of complexity, so I'd like to be sure of what we're doing here.

An example of the complexity is with the symlinks to the patches. Every time a patch is added/removed in package/systemd/, one should remember to adjust the symlinks in boot/systemd-boot/. This is something that can very easily be missed.

And I now even dropped all of them completely, with the v240 bump, so we no longer whare any patch with systemd. There is only one patch that is now needed to build systemd-boot standalone. We still need to investigate why James was not able to build it, though. James, care to give my series a new spin, please? (I've repushed the branch just now)

So, the only complexity that remains is the sharing of the boot files and their install commands.

That, and the little trick to share the source file.

Quoted 2 lines

So it would be good to make sure we have a really solid use-case for adding this complexity.

Peter, care to elaborate your position, since you were advocating also for it, earlier? ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#19 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 38 lines · Yann E. MORIN

Thomas, All,

Adding Peter in the loop; see at the end.

On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:

Quoted 23 lines · Yann E. MORIN
Quoted 14 lines

From: James Hilliard <[email protected]>

systemd-boot is the integration of gummiboot into systemd, and gummiboot is no longer maintained [0]. However, it is still interesting to use it as a simple, stand-alone bootloader.

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

Quoted 7 lines

To avoid duplication, we just symlink the systemd patches as-is. We just need to add a specific patch, that just relaxes the dependency checks, since we're only interested in building the boot blobs.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

Quoted 8 lines

Do we have a serious valid use-case for wanting to use systemd-boot without systemd? This adds a fair bit of complexity, so I'd like to be sure of what we're doing here.

An example of the complexity is with the symlinks to the patches. Every time a patch is added/removed in package/systemd/, one should remember to adjust the symlinks in boot/systemd-boot/. This is something that can very easily be missed.

Quoted 5 lines

And I now even dropped all of them completely, with the v240 bump, so we no longer whare any patch with systemd. There is only one patch that is now needed to build systemd-boot standalone. We still need to investigate why James was not able to build it, though. James, care to give my series a new spin, please? (I've repushed the branch just now)

Did a fresh compilation run, I get a failure here
https://github.com/systemd/systemd/blob/v239/meson.build#L278
meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Quoted 22 lines

So, the only complexity that remains is the sharing of the boot files and their install commands.

That, and the little trick to share the source file.

Quoted 2 lines

So it would be good to make sure we have a really solid use-case for adding this complexity.

Peter, care to elaborate your position, since you were advocating also for it, earlier? ;-)

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#20 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 40 lines · James Hilliard
Quoted 38 lines · Yann E. MORIN

Thomas, All,

Adding Peter in the loop; see at the end.

On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:

Quoted 31 lines · Yann E. MORIN
Quoted 14 lines

From: James Hilliard <[email protected]>

systemd-boot is the integration of gummiboot into systemd, and gummiboot is no longer maintained [0]. However, it is still interesting to use it as a simple, stand-alone bootloader.

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

Quoted 7 lines

To avoid duplication, we just symlink the systemd patches as-is. We just need to add a specific patch, that just relaxes the dependency checks, since we're only interested in building the boot blobs.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

Do we have a serious valid use-case for wanting to use systemd-boot without systemd? This adds a fair bit of complexity, so I'd like to be sure of what we're doing here.

An example of the complexity is with the symlinks to the patches. Every time a patch is added/removed in package/systemd/, one should remember to adjust the symlinks in boot/systemd-boot/. This is something that can very easily be missed.

Quoted 7 lines
Quoted 5 lines

And I now even dropped all of them completely, with the v240 bump, so we no longer whare any patch with systemd. There is only one patch that is now needed to build systemd-boot standalone. We still need to investigate why James was not able to build it, though. James, care to give my series a new spin, please? (I've repushed the branch just now)

Did a fresh compilation run, I get a failure here
https://github.com/systemd/systemd/blob/v239/meson.build#L278

Correction: failure is here
https://github.com/systemd/systemd/blob/v240/meson.build#L293

Quoted 24 lines

meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Quoted 22 lines

So, the only complexity that remains is the sharing of the boot files and their install commands.

That, and the little trick to share the source file.

Quoted 2 lines

So it would be good to make sure we have a really solid use-case for adding this complexity.

Peter, care to elaborate your position, since you were advocating also for it, earlier? ;-)

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#21 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 48 lines · James Hilliard
Quoted 45 lines · James Hilliard
Quoted 43 lines · Yann E. MORIN

Thomas, All,

Adding Peter in the loop; see at the end.

On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:

Quoted 23 lines · Yann E. MORIN
Quoted 14 lines

From: James Hilliard <[email protected]>

systemd-boot is the integration of gummiboot into systemd, and gummiboot is no longer maintained [0]. However, it is still interesting to use it as a simple, stand-alone bootloader.

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

Quoted 7 lines

To avoid duplication, we just symlink the systemd patches as-is. We just need to add a specific patch, that just relaxes the dependency checks, since we're only interested in building the boot blobs.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

Quoted 8 lines

Do we have a serious valid use-case for wanting to use systemd-boot without systemd? This adds a fair bit of complexity, so I'd like to be sure of what we're doing here.

An example of the complexity is with the symlinks to the patches. Every time a patch is added/removed in package/systemd/, one should remember to adjust the symlinks in boot/systemd-boot/. This is something that can very easily be missed.

And I now even dropped all of them completely, with the v240 bump, so we no longer whare any patch with systemd. There is only one patch that is now needed to build systemd-boot standalone. We still need to investigate why James was not able to build it, though. James, care to give my series a new spin, please? (I've repushed the branch just now)

Quoted 4 lines
Quoted 2 lines

Did a fresh compilation run, I get a failure here
https://github.com/systemd/systemd/blob/v239/meson.build#L278

Correction: failure is here
https://github.com/systemd/systemd/blob/v240/meson.build#L293

Upstream bug report https://github.com/systemd/systemd/issues/11278

Quoted 24 lines
Quoted 24 lines

meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Quoted 22 lines

So, the only complexity that remains is the sharing of the boot files and their install commands.

That, and the little trick to share the source file.

Quoted 2 lines

So it would be good to make sure we have a really solid use-case for adding this complexity.

Peter, care to elaborate your position, since you were advocating also for it, earlier? ;-)

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#22 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 51 lines · James Hilliard
Quoted 48 lines · James Hilliard
Quoted 45 lines · James Hilliard
Quoted 43 lines · Yann E. MORIN

Thomas, All,

Adding Peter in the loop; see at the end.

On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:

Quoted 23 lines · Yann E. MORIN
Quoted 14 lines

From: James Hilliard <[email protected]>

systemd-boot is the integration of gummiboot into systemd, and gummiboot is no longer maintained [0]. However, it is still interesting to use it as a simple, stand-alone bootloader.

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

Quoted 7 lines

To avoid duplication, we just symlink the systemd patches as-is. We just need to add a specific patch, that just relaxes the dependency checks, since we're only interested in building the boot blobs.

[0] https://cgit.freedesktop.org/gummiboot/commit/?id=55df1539c9d330732e88bd196afee386db6e4a1d

Quoted 8 lines

Do we have a serious valid use-case for wanting to use systemd-boot without systemd? This adds a fair bit of complexity, so I'd like to be sure of what we're doing here.

An example of the complexity is with the symlinks to the patches. Every time a patch is added/removed in package/systemd/, one should remember to adjust the symlinks in boot/systemd-boot/. This is something that can very easily be missed.

And I now even dropped all of them completely, with the v240 bump, so we no longer whare any patch with systemd. There is only one patch that is now needed to build systemd-boot standalone. We still need to investigate why James was not able to build it, though. James, care to give my series a new spin, please? (I've repushed the branch just now)

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Did a fresh compilation run, I get a failure here
https://github.com/systemd/systemd/blob/v239/meson.build#L278

Correction: failure is here
https://github.com/systemd/systemd/blob/v240/meson.build#L293

Upstream bug report https://github.com/systemd/systemd/issues/11278

Potential fix: https://github.com/systemd/systemd/pull/11279

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines

meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Quoted 22 lines

So, the only complexity that remains is the sharing of the boot files and their install commands.

That, and the little trick to share the source file.

Quoted 2 lines

So it would be good to make sure we have a really solid use-case for adding this complexity.

Peter, care to elaborate your position, since you were advocating also for it, earlier? ;-)

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#23 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

James, All,

On 2018-12-26 19:27 -0600, James Hilliard spake thusly:

Quoted 5 lines

On Wed, Dec 26, 2018 at 4:52 PM James Hilliard

Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Upstream bug report https://github.com/systemd/systemd/issues/11278

Potential fix: https://github.com/systemd/systemd/pull/11279

That unfortunately does not work:

ERROR: No specified compiler can handle file src/libsystemd/sd-bus/test-bus-vtable-cc.cc

But if you also add:

    diff --git a/src/test/meson.build b/src/test/meson.build
    index ea049a6fb..d9d87e02c 100644
    --- a/src/test/meson.build
    +++ b/src/test/meson.build
    @@ -957,7 +957,7 @@ tests += [
     
     ]
     
    -if cxx.found()
    +if cxx_cmd != ''
             tests += [
                     [['src/libsystemd/sd-bus/test-bus-vtable-cc.cc'],
                      [],

Then it works.

Obviously, I'm not sure this is the right fix...

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#24 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 30 lines · Yann E. MORIN

James, All,

On 2018-12-26 19:27 -0600, James Hilliard spake thusly:

Quoted 5 lines

On Wed, Dec 26, 2018 at 4:52 PM James Hilliard

Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Upstream bug report https://github.com/systemd/systemd/issues/11278

Potential fix: https://github.com/systemd/systemd/pull/11279

That unfortunately does not work:

ERROR: No specified compiler can handle file src/libsystemd/sd-bus/test-bus-vtable-cc.cc

But if you also add:

    diff --git a/src/test/meson.build b/src/test/meson.build
    index ea049a6fb..d9d87e02c 100644
    --- a/src/test/meson.build
    +++ b/src/test/meson.build
    @@ -957,7 +957,7 @@ tests += [

     ]

    -if cxx.found()
    +if cxx_cmd != ''
             tests += [
                     [['src/libsystemd/sd-bus/test-bus-vtable-cc.cc'],
                      [],
Quoted 1 line

Then it works.

Pushed that fix and one other I found, didn't realize cxx.found() was being used other places(I only tested that pull request against a c only cross toolchain).

Quoted 13 lines

Obviously, I'm not sure this is the right fix...

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#25 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

James, All,

On 2018-12-27 03:07 -0600, James Hilliard spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 4 lines

On 2018-12-26 19:27 -0600, James Hilliard spake thusly:

Quoted 3 lines

On Wed, Dec 26, 2018 at 4:52 PM James Hilliard

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

Upstream bug report https://github.com/systemd/systemd/issues/11278

Potential fix: https://github.com/systemd/systemd/pull/11279

That unfortunately does not work:
ERROR: No specified compiler can handle file src/libsystemd/sd-bus/test-bus-vtable-cc.cc But if you also add:

    -if cxx.found()
    +if cxx_cmd != ''

Then it works.

Quoted 3 lines

Pushed that fix and one other I found, didn't realize cxx.found() was being used other places(I only tested that pull request against a c only cross toolchain).

It worked for me without the hunk in src/systemd/meson.build. However, for our case in Buildroot (just building systemd-boot standalone), we don't need a 100% perfect patch, as long as it allows building.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#26 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 17 lines · Yann E. MORIN

James, All,

On 2018-12-27 03:07 -0600, James Hilliard spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 12 lines

On 2018-12-26 19:27 -0600, James Hilliard spake thusly:

Quoted 5 lines

On Wed, Dec 26, 2018 at 4:52 PM James Hilliard

Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Upstream bug report https://github.com/systemd/systemd/issues/11278

Potential fix: https://github.com/systemd/systemd/pull/11279

That unfortunately does not work:
ERROR: No specified compiler can handle file src/libsystemd/sd-bus/test-bus-vtable-cc.cc But if you also add:

    -if cxx.found()
    +if cxx_cmd != ''

Then it works.

Quoted 7 lines
Quoted 3 lines

Pushed that fix and one other I found, didn't realize cxx.found() was being used other places(I only tested that pull request against a c only cross toolchain).

It worked for me without the hunk in src/systemd/meson.build. However, for our case in Buildroot (just building systemd-boot standalone), we don't need a 100% perfect patch, as long as it allows building.

That patch I think is needed to build systemd itself when using a cross toolchain without c++, not just systemd-boot.

Quoted 11 lines

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#27 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

James, All,

On 2018-12-27 03:13 -0600, James Hilliard spake thusly:

Quoted 19 lines · Yann E. MORIN
Quoted 18 lines

On 2018-12-27 03:07 -0600, James Hilliard spake thusly:

Quoted 16 lines · Yann E. MORIN
Quoted 4 lines

On 2018-12-26 19:27 -0600, James Hilliard spake thusly:

Quoted 3 lines

On Wed, Dec 26, 2018 at 4:52 PM James Hilliard

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

Upstream bug report https://github.com/systemd/systemd/issues/11278

Potential fix: https://github.com/systemd/systemd/pull/11279

That unfortunately does not work:
ERROR: No specified compiler can handle file src/libsystemd/sd-bus/test-bus-vtable-cc.cc But if you also add:

    -if cxx.found()
    +if cxx_cmd != ''

Then it works.

Pushed that fix and one other I found, didn't realize cxx.found() was being used other places(I only tested that pull request against a c only cross toolchain).

Quoted 5 lines
Quoted 3 lines

It worked for me without the hunk in src/systemd/meson.build. However, for our case in Buildroot (just building systemd-boot standalone), we don't need a 100% perfect patch, as long as it allows building.

That patch I think is needed to build systemd itself when using a cross toolchain without c++, not just systemd-boot.

I can confirm that, without the hunk in src/systemd/meson.build, I was able to build systemd with this defconfig:

BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_INIT_SYSTEMD=y

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#28 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 26 lines · Yann E. MORIN

James, All,

On 2018-12-27 03:13 -0600, James Hilliard spake thusly:

Quoted 22 lines · Yann E. MORIN
Quoted 21 lines

On 2018-12-27 03:07 -0600, James Hilliard spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 4 lines

On 2018-12-26 19:27 -0600, James Hilliard spake thusly:

Quoted 3 lines

On Wed, Dec 26, 2018 at 4:52 PM James Hilliard

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

meson.build:293:8: ERROR: Unknown compiler(s):
[['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

Upstream bug report https://github.com/systemd/systemd/issues/11278

Potential fix: https://github.com/systemd/systemd/pull/11279

That unfortunately does not work:
ERROR: No specified compiler can handle file src/libsystemd/sd-bus/test-bus-vtable-cc.cc But if you also add:

    -if cxx.found()
    +if cxx_cmd != ''

Then it works.

Quoted 3 lines

Pushed that fix and one other I found, didn't realize cxx.found() was being used other places(I only tested that pull request against a c only cross toolchain).

It worked for me without the hunk in src/systemd/meson.build. However, for our case in Buildroot (just building systemd-boot standalone), we don't need a 100% perfect patch, as long as it allows building.

Quoted 8 lines
Quoted 2 lines

That patch I think is needed to build systemd itself when using a cross toolchain without c++, not just systemd-boot.

I can confirm that, without the hunk in src/systemd/meson.build, I was able to build systemd with this defconfig:

BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_INIT_SYSTEMD=y

That's without c++ right?

Quoted 11 lines

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#29 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

James, All,

On 2018-12-27 04:42 -0600, James Hilliard spake thusly:

Quoted 6 lines · Yann E. MORIN
Quoted 4 lines

I can confirm that, without the hunk in src/systemd/meson.build, I was able to build systemd with this defconfig:
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_INIT_SYSTEMD=y

That's without c++ right?

Yes, that's without C++.

You can check a defconfig by doing:

    $ cat >.config <<_EOF_
    BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
    BR2_INIT_SYSTEMD=y
    _EOF_
    $ make olddefconfig
    $ grep CXX .config
    # BR2_TOOLCHAIN_BUILDROOT_CXX is not set

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#30 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 4 lines · Yann E. MORIN

James, All,

On 2018-12-27 04:42 -0600, James Hilliard spake thusly:

Quoted 8 lines
Quoted 6 lines · Yann E. MORIN
Quoted 4 lines

I can confirm that, without the hunk in src/systemd/meson.build, I was able to build systemd with this defconfig:
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_INIT_SYSTEMD=y

That's without c++ right?

Yes, that's without C++.

I guess the extra c++ opts here
https://github.com/systemd/systemd/blob/v240/src/systemd/meson.build#L57-L59
probably just get ignored then.

Quoted 23 lines

You can check a defconfig by doing:

    $ cat >.config <<_EOF_
    BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
    BR2_INIT_SYSTEMD=y
    _EOF_
    $ make olddefconfig
    $ grep CXX .config
    # BR2_TOOLCHAIN_BUILDROOT_CXX is not set

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#31 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

James, All,

On 2018-12-27 05:01 -0600, James Hilliard spake thusly:

Quoted 8 lines · Yann E. MORIN
Quoted 7 lines

On 2018-12-27 04:42 -0600, James Hilliard spake thusly:

Quoted 6 lines · Yann E. MORIN
Quoted 4 lines

I can confirm that, without the hunk in src/systemd/meson.build, I was able to build systemd with this defconfig:
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_INIT_SYSTEMD=y

That's without c++ right?

Your no-C++ patch has been accepted upstream! :-)

Care to backport that fix in Buildroot, please?

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#32 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 11 lines · Yann E. MORIN

James, All,

On 2018-12-27 05:01 -0600, James Hilliard spake thusly:

Quoted 7 lines · Yann E. MORIN
Quoted 6 lines

On 2018-12-27 04:42 -0600, James Hilliard spake thusly:

Quoted 5 lines · Yann E. MORIN
Quoted 4 lines

I can confirm that, without the hunk in src/systemd/meson.build, I was able to build systemd with this defconfig:
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_INIT_SYSTEMD=y

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

That's without c++ right?

Your no-C++ patch has been accepted upstream! :-)

Care to backport that fix in Buildroot, please?

Backported in my tree here
https://github.com/jameshilliard/buildroot/tree/systemd-boot

I did a test build selecting only systemd-boot and now I get this error:
Program gperf found: NO

meson.build:634:0: ERROR: Program(s) ['gperf'] not found or not executable

Quoted 11 lines

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#33 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

James, All,

On 2018-12-29 04:50 -0600, James Hilliard spake thusly:

Quoted 9 lines · Yann E. MORIN
Quoted 8 lines

On 2018-12-27 05:01 -0600, James Hilliard spake thusly:

Quoted 7 lines · Yann E. MORIN
Quoted 6 lines

On 2018-12-27 04:42 -0600, James Hilliard spake thusly:

Quoted 5 lines · Yann E. MORIN
Quoted 4 lines

I can confirm that, without the hunk in src/systemd/meson.build, I was able to build systemd with this defconfig:
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_INIT_SYSTEMD=y

Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

That's without c++ right?

Your no-C++ patch has been accepted upstream! :-)

Care to backport that fix in Buildroot, please?

Backported in my tree here
https://github.com/jameshilliard/buildroot/tree/systemd-boot

Could you please send it soon to the list as a patch to systemd, as it is not correlated to systemd-boot at all (it is also needed by systemd to build on a non-C++ toolchain)?

Quoted 3 lines

I did a test build selecting only systemd-boot and now I get this error:
Program gperf found: NO
meson.build:634:0: ERROR: Program(s) ['gperf'] not found or not executable

Until now, only minor patching was needed (a header and two libs checks) that were trivial to patchout. But this new gperf check is less trivial to patch-out in a way that is maintainable long-term.

My opinion now is now joining that of Thomas, that we should not try to build a standalone systemd-boot until it is properly supported by upstream. Work to that effect should be directed at upstream rather than monkey-patching in Buildroot.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#34 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 17 lines · Yann E. MORIN

James, All,

On 2018-12-29 04:50 -0600, James Hilliard spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 12 lines

On 2018-12-27 05:01 -0600, James Hilliard spake thusly:

Quoted 8 lines · Yann E. MORIN
Quoted 7 lines

On 2018-12-27 04:42 -0600, James Hilliard spake thusly:

Quoted 6 lines · Yann E. MORIN
Quoted 4 lines

I can confirm that, without the hunk in src/systemd/meson.build, I was able to build systemd with this defconfig:
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_INIT_SYSTEMD=y

That's without c++ right?

Your no-C++ patch has been accepted upstream! :-)

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Care to backport that fix in Buildroot, please?

Backported in my tree here
https://github.com/jameshilliard/buildroot/tree/systemd-boot

Could you please send it soon to the list as a patch to systemd, as it is not correlated to systemd-boot at all (it is also needed by systemd to build on a non-C++ toolchain)?

Will do, hadn't noticed the v240 bump was already merged.

Quoted 8 lines
Quoted 4 lines

I did a test build selecting only systemd-boot and now I get this error:
Program gperf found: NO
meson.build:634:0: ERROR: Program(s) ['gperf'] not found or not executable

Until now, only minor patching was needed (a header and two libs checks) that were trivial to patchout. But this new gperf check is less trivial to patch-out in a way that is maintainable long-term.

I'm pretty sure I had this same issue even in systemd v239. That's why I sent that giant patch here
https://patchwork.ozlabs.org/patch/1018502/.

Quoted 16 lines

My opinion now is now joining that of Thomas, that we should not try to build a standalone systemd-boot until it is properly supported by upstream. Work to that effect should be directed at upstream rather than monkey-patching in Buildroot.

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#35 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

In reply to Yann E. MORIN
Quoted 25 lines · Yann E. MORIN

James, All,

On 2018-12-29 04:50 -0600, James Hilliard spake thusly:

Quoted 9 lines · Yann E. MORIN
Quoted 8 lines

On 2018-12-27 05:01 -0600, James Hilliard spake thusly:

Quoted 7 lines · Yann E. MORIN
Quoted 6 lines

On 2018-12-27 04:42 -0600, James Hilliard spake thusly:

Quoted 5 lines · Yann E. MORIN
Quoted 4 lines

I can confirm that, without the hunk in src/systemd/meson.build, I was able to build systemd with this defconfig:
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_INIT_SYSTEMD=y

Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

That's without c++ right?

Your no-C++ patch has been accepted upstream! :-)

Care to backport that fix in Buildroot, please?

Backported in my tree here
https://github.com/jameshilliard/buildroot/tree/systemd-boot

Could you please send it soon to the list as a patch to systemd, as it is not correlated to systemd-boot at all (it is also needed by systemd to build on a non-C++ toolchain)?

Quoted 7 lines
Quoted 3 lines

I did a test build selecting only systemd-boot and now I get this error:
Program gperf found: NO
meson.build:634:0: ERROR: Program(s) ['gperf'] not found or not executable

Until now, only minor patching was needed (a header and two libs checks) that were trivial to patchout. But this new gperf check is less trivial to patch-out in a way that is maintainable long-term.

What do you think of this strategy using meson's disabler feature?
https://github.com/systemd/systemd/pull/11294

Quoted 16 lines

My opinion now is now joining that of Thomas, that we should not try to build a standalone systemd-boot until it is properly supported by upstream. Work to that effect should be directed at upstream rather than monkey-patching in Buildroot.

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#36 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

James, All,

On 2018-12-30 02:44 -0600, James Hilliard spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 5 lines
Quoted 3 lines

Until now, only minor patching was needed (a header and two libs checks) that were trivial to patchout. But this new gperf check is less trivial to patch-out in a way that is maintainable long-term.

What do you think of this strategy using meson's disabler feature?
https://github.com/systemd/systemd/pull/11294

To be honest, I don't really care how it's done, sorry... It just has to be a solution that pleases upstream.

I just got into the original thread to help sort out a solution in Buildroot, should that were possible, but it turns out that it is not really workable easily without upstream support.

Good luck in your endeavour! ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#37 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Quoted 12 lines · Yann E. MORIN

James, All,

On 2018-12-30 02:44 -0600, James Hilliard spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 5 lines
Quoted 3 lines

Until now, only minor patching was needed (a header and two libs checks) that were trivial to patchout. But this new gperf check is less trivial to patch-out in a way that is maintainable long-term.

What do you think of this strategy using meson's disabler feature?
https://github.com/systemd/systemd/pull/11294

Quoted 6 lines

To be honest, I don't really care how it's done, sorry... It just has to be a solution that pleases upstream.

I just got into the original thread to help sort out a solution in Buildroot, should that were possible, but it turns out that it is not really workable easily without upstream support.

It's not super difficult to create a patch for our usage in buildroot in order to allow building systemd-boot by itself at least, the diff will just be a bit on the large side for the moment until upstream is refactored since I need to strip out most of the configure checks, does that sound ok?

Quoted 13 lines

Good luck in your endeavour! ;-)

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

#38 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

James, All,

On 2018-12-31 04:24 -0600, James Hilliard spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 12 lines

On 2018-12-30 02:44 -0600, James Hilliard spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 5 lines
Quoted 3 lines

Until now, only minor patching was needed (a header and two libs checks) that were trivial to patchout. But this new gperf check is less trivial to patch-out in a way that is maintainable long-term.

What do you think of this strategy using meson's disabler feature?
https://github.com/systemd/systemd/pull/11294

To be honest, I don't really care how it's done, sorry... It just has to be a solution that pleases upstream.

Quoted 8 lines
Quoted 3 lines

I just got into the original thread to help sort out a solution in Buildroot, should that were possible, but it turns out that it is not really workable easily without upstream support.

It's not super difficult to create a patch for our usage in buildroot in order to allow building systemd-boot by itself at least, the diff will just be a bit on the large side for the moment until upstream is refactored since I need to strip out most of the configure checks, does that sound ok?

No, that's not nice, as I already said (and as Peter said on IRC just moments ago), because we'll have to maintain that patch over time:
there is no way to know when upstream will be ready, so we can drop that patch. It may happen that upstream turns out to not be interested at all in fact.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#39 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

In reply to Yann E. MORIN
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Hi,

Quoted 5 lines
Quoted 2 lines

So it would be good to make sure we have a really solid use-case for adding this complexity.

Peter, care to elaborate your position, since you were advocating also for it, earlier? ;-)

One interesting feature it has is that it can bundle the bootloader, kernel, initramfs and kernel command line into a single EFI binary, which can be handy for E.G. A/B boot and EFI secure boot.

But with that said, if upstream does not make it easy to build it seperately, then I'm OK with only allowing it if systemd is built.

Signature · 1 line
Bye, Peter Korsgaard
#40 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

In reply to Yann E. MORIN
Quoted 7 lines · Yann E. MORIN

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

I really don't like this approach of copying systemd.

I would instead try harder to keep the standalone version part of the systemd
package itself. Yes, I realize that I'm coming very late with this... The only reason we got here is this statement from Yann:

Quoted 5 lines
Quoted 5 lines

What is wrong is that it makes the systemd package *and* the init selectionmuch more copmplex, and this is not acceptable (IMHO).

I'd rather have a second package that is trivial, with mimimum, if at all, changes in the main systemd package.

The second package turns out not to be trivial at all...

So, looking back to James's original v2 patch, I'd structure the Config.in
something like this:

config BR2_PACKAGE_SYSTEMD
bool
depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS depends on ...
# select any dependency that is relevant for system-boot

config BR2_PACKAGE_SYSTEMD_BOOT
bool

menuconfig BR2_PACKAGE_SYSTEMD_SYSTEMD
depends on BR2_PACKAGE_SYSTEMD
# addition depends/selects that are relevant for full systemd

# rest of the file stays the same

Note that BR2_PACKAGE_SYSTEMD was never user-selectable because it was always
implicit from BR2_INIT_SYSTEMD, so it's OK to turn it into a blind option.

Note that we will need to declare the symbol BR2_PACKAGE_SYSTEMD_BOOT option
twice: in the standalone systemd-boot case, we need the symbol declared somewhere so it can be selected by BR2_TARGET_SYSTEMD_BOOT.

Finally note that I fully agree that we should not even start support for
standalone systemd-boot until upstream progresses into making it buildable standalone. I really don't want that huge patch either. But that's independent of how standalone systemd-boot is implemented.

Regards,
Arnout

#41 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

Arnout, All,

On 2019-01-11 00:47 +0100, Arnout Vandecappelle spake thusly:

Quoted 14 lines · Yann E. MORIN
Quoted 7 lines

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

I really don't like this approach of copying systemd.

I would instead try harder to keep the standalone version part of the systemd
package itself. Yes, I realize that I'm coming very late with this... The only reason we got here is this statement from Yann:

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

What is wrong is that it makes the systemd package *and* the init selectionmuch more copmplex, and this is not acceptable (IMHO).

I'd rather have a second package that is trivial, with mimimum, if at all, changes in the main systemd package.

The second package turns out not to be trivial at all...

Yes, because it *is* non trivial as upstreeam does not make it trivial.

But once it is posible to (basically) do in systemd:

    cd $(@D)/src/boot; meson
    ninja -C $(@D)/src/boot build
    ninja -C $(@D)/src/boot install

Then I still think it is better to just create a new package for systemd-boot standalone, rather than piggy-back on systemd.

Afterall, we already had this discussion back with mesa3d-headers, when I initially tried to piggy-back on mesa3d, but was told to make a separate package. And we have linux-headers that is separate from linux, or uboot-tools that is separate from uboot...

[--SNIP--]

Quoted 4 lines

Finally note that I fully agree that we should not even start support for
standalone systemd-boot until upstream progresses into making it buildable standalone. I really don't want that huge patch either. But that's independent of how standalone systemd-boot is implemented.

It's almost orthogonal, yes. But my point is, it's not because it is the same source tree that it should be the same package in Buildroot.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#42 lore raw

PATCH v5 5/5 boot/systemd-boot: new package

In reply to Arnout Vandecappelle
Quoted 48 lines · Arnout Vandecappelle
Quoted 7 lines · Yann E. MORIN

Since systemd-boot is really part of systemd, when systemd is enabled (as an init system), we rely on it to build the boot blobs, and systemd-boot (this package) is not available.

Now, when systemd is not enabled, systemd-boot (this package) will actually build the boot blobs, and only that. No userspace tool is built.

I really don't like this approach of copying systemd.

I would instead try harder to keep the standalone version part of the systemd
package itself. Yes, I realize that I'm coming very late with this... The only reason we got here is this statement from Yann:

Quoted 5 lines
Quoted 5 lines

What is wrong is that it makes the systemd package *and* the init selectionmuch more copmplex, and this is not acceptable (IMHO).

I'd rather have a second package that is trivial, with mimimum, if at all, changes in the main systemd package.

The second package turns out not to be trivial at all...

So, looking back to James's original v2 patch, I'd structure the Config.in
something like this:

config BR2_PACKAGE_SYSTEMD
bool
depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS depends on ...
# select any dependency that is relevant for system-boot

config BR2_PACKAGE_SYSTEMD_BOOT
bool

menuconfig BR2_PACKAGE_SYSTEMD_SYSTEMD
depends on BR2_PACKAGE_SYSTEMD
# addition depends/selects that are relevant for full systemd

# rest of the file stays the same

Note that BR2_PACKAGE_SYSTEMD was never user-selectable because it was always
implicit from BR2_INIT_SYSTEMD, so it's OK to turn it into a blind option.

Quoted 8 lines

Note that we will need to declare the symbol BR2_PACKAGE_SYSTEMD_BOOT option
twice: in the standalone systemd-boot case, we need the symbol declared somewhere so it can be selected by BR2_TARGET_SYSTEMD_BOOT.

Finally note that I fully agree that we should not even start support for
standalone systemd-boot until upstream progresses into making it buildable standalone. I really don't want that huge patch either. But that's independent of how standalone systemd-boot is implemented.

I came up with a significantly smaller patch I'm working on getting merged into upstream
https://github.com/systemd/systemd/pull/11294/files.

Quoted 3 lines

Regards,
Arnout