All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/5 v5] systemd-boot: new simple EFI bootloader replacing gummmiboot (branch yem/systemd-boot)
@ 2018-12-26  8:52 Yann E. MORIN
  2018-12-26  8:52 ` [Buildroot] [PATCH 1/5 v5] package/meson: never try to run generated target binaries Yann E. MORIN
                   ` (4 more replies)
  0 siblings, 5 replies; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-26  8:52 UTC (permalink / raw)
  To: buildroot

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

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 1/5 v5] package/meson: never try to run generated target binaries
  2018-12-26  8:52 [Buildroot] [PATCH 0/5 v5] systemd-boot: new simple EFI bootloader replacing gummmiboot (branch yem/systemd-boot) Yann E. MORIN
@ 2018-12-26  8:52 ` Yann E. MORIN
  2018-12-28 10:54   ` Thomas Petazzoni
  2018-12-26  8:52 ` [Buildroot] [PATCH 2/5 v5] package/meson: fix CPU familly Yann E. MORIN
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-26  8:52 UTC (permalink / raw)
  To: buildroot

From: James Hilliard <james.hilliard1@gmail.com>

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

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[yann.morin.1998 at free.fr:
  - split in its own patch
  - improve commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 package/meson/cross-compilation.conf.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in
index 0eec74087b..fc8e27f7eb 100644
--- a/package/meson/cross-compilation.conf.in
+++ b/package/meson/cross-compilation.conf.in
@@ -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@]
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 2/5 v5] package/meson: fix CPU familly
  2018-12-26  8:52 [Buildroot] [PATCH 0/5 v5] systemd-boot: new simple EFI bootloader replacing gummmiboot (branch yem/systemd-boot) Yann E. MORIN
  2018-12-26  8:52 ` [Buildroot] [PATCH 1/5 v5] package/meson: never try to run generated target binaries Yann E. MORIN
@ 2018-12-26  8:52 ` Yann E. MORIN
  2018-12-28 10:54   ` Thomas Petazzoni
  2018-12-26  8:52 ` [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules Yann E. MORIN
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-26  8:52 UTC (permalink / raw)
  To: buildroot

From: James Hilliard <james.hilliard1@gmail.com>

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

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[yann.morin.1998 at free.fr:
  - split in its own patch
  - imnprove commit log
]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/meson/meson.mk | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/package/meson/meson.mk b/package/meson/meson.mk
index e1675c21b8..1113bf0e29 100644
--- a/package/meson/meson.mk
+++ b/package/meson/meson.mk
@@ -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" \
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules
  2018-12-26  8:52 [Buildroot] [PATCH 0/5 v5] systemd-boot: new simple EFI bootloader replacing gummmiboot (branch yem/systemd-boot) Yann E. MORIN
  2018-12-26  8:52 ` [Buildroot] [PATCH 1/5 v5] package/meson: never try to run generated target binaries Yann E. MORIN
  2018-12-26  8:52 ` [Buildroot] [PATCH 2/5 v5] package/meson: fix CPU familly Yann E. MORIN
@ 2018-12-26  8:52 ` Yann E. MORIN
  2018-12-26 11:36   ` James Hilliard
  2018-12-28 10:54   ` Thomas Petazzoni
  2018-12-26  8:52 ` [Buildroot] [PATCH 4/5 v5] package/systemd: enable building of systemd-boot Yann E. MORIN
  2018-12-26  8:52 ` [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package Yann E. MORIN
  4 siblings, 2 replies; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-26  8:52 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Cc: James Hilliard <james.hilliard1@gmail.com>
---
 docs/manual/adding-packages-meson.txt | 3 +++
 package/pkg-meson.mk                  | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
index c52fe10506..549319b192 100644
--- a/docs/manual/adding-packages-meson.txt
+++ b/docs/manual/adding-packages-meson.txt
@@ -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).
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 507e686068..0588660dbf 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -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
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 4/5 v5] package/systemd: enable building of systemd-boot
  2018-12-26  8:52 [Buildroot] [PATCH 0/5 v5] systemd-boot: new simple EFI bootloader replacing gummmiboot (branch yem/systemd-boot) Yann E. MORIN
                   ` (2 preceding siblings ...)
  2018-12-26  8:52 ` [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules Yann E. MORIN
@ 2018-12-26  8:52 ` Yann E. MORIN
  2018-12-26  8:52 ` [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package Yann E. MORIN
  4 siblings, 0 replies; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-26  8:52 UTC (permalink / raw)
  To: buildroot

From: James Hilliard <james.hilliard1@gmail.com>

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

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[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)
]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 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

diff --git a/package/systemd/Config.in b/package/systemd/Config.in
index 25f322e8f3..50d09b34a5 100644
--- a/package/systemd/Config.in
+++ b/package/systemd/Config.in
@@ -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
diff --git a/package/systemd/boot-files/buildroot.conf b/package/systemd/boot-files/buildroot.conf
new file mode 100644
index 0000000000..16d4d85f4a
--- /dev/null
+++ b/package/systemd/boot-files/buildroot.conf
@@ -0,0 +1,3 @@
+title	Buildroot
+linux	/bzImage
+options	root=/dev/sda2 rootwait console=tty1
diff --git a/package/systemd/boot-files/loader.conf b/package/systemd/boot-files/loader.conf
new file mode 100644
index 0000000000..93b77b8f93
--- /dev/null
+++ b/package/systemd/boot-files/loader.conf
@@ -0,0 +1,2 @@
+timeout 3
+default buildroot
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index e53f0b699a..2822d4423c 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -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
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26  8:52 [Buildroot] [PATCH 0/5 v5] systemd-boot: new simple EFI bootloader replacing gummmiboot (branch yem/systemd-boot) Yann E. MORIN
                   ` (3 preceding siblings ...)
  2018-12-26  8:52 ` [Buildroot] [PATCH 4/5 v5] package/systemd: enable building of systemd-boot Yann E. MORIN
@ 2018-12-26  8:52 ` Yann E. MORIN
  2018-12-26  9:33   ` Yann E. MORIN
                     ` (2 more replies)
  4 siblings, 3 replies; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-26  8:52 UTC (permalink / raw)
  To: buildroot

From: James Hilliard <james.hilliard1@gmail.com>

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

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[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
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

---
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

diff --git a/boot/Config.in b/boot/Config.in
index 8e0c8e5df4..5b7f606343 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -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"
diff --git a/boot/systemd-boot/0001-fix-getty-unit.patch b/boot/systemd-boot/0001-fix-getty-unit.patch
new file mode 120000
index 0000000000..ffb5f5306d
--- /dev/null
+++ b/boot/systemd-boot/0001-fix-getty-unit.patch
@@ -0,0 +1 @@
+../../package/systemd/0001-fix-getty-unit.patch
\ No newline at end of file
diff --git a/boot/systemd-boot/0002-install-don-t-use-ln-relative.patch b/boot/systemd-boot/0002-install-don-t-use-ln-relative.patch
new file mode 120000
index 0000000000..cfe0291c86
--- /dev/null
+++ b/boot/systemd-boot/0002-install-don-t-use-ln-relative.patch
@@ -0,0 +1 @@
+../../package/systemd/0002-install-don-t-use-ln-relative.patch
\ No newline at end of file
diff --git a/boot/systemd-boot/0003-build-sys-Detect-whether-struct-statx-is-defined-in-.patch b/boot/systemd-boot/0003-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
new file mode 120000
index 0000000000..ded8b4f6aa
--- /dev/null
+++ b/boot/systemd-boot/0003-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
@@ -0,0 +1 @@
+../../package/systemd/0003-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
\ No newline at end of file
diff --git a/boot/systemd-boot/0004-meson-unify-linux-stat.h-check-with-other-checks-and.patch b/boot/systemd-boot/0004-meson-unify-linux-stat.h-check-with-other-checks-and.patch
new file mode 120000
index 0000000000..32bc435aa1
--- /dev/null
+++ b/boot/systemd-boot/0004-meson-unify-linux-stat.h-check-with-other-checks-and.patch
@@ -0,0 +1 @@
+../../package/systemd/0004-meson-unify-linux-stat.h-check-with-other-checks-and.patch
\ No newline at end of file
diff --git a/boot/systemd-boot/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch b/boot/systemd-boot/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
new file mode 120000
index 0000000000..003d6a7821
--- /dev/null
+++ b/boot/systemd-boot/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
@@ -0,0 +1 @@
+../../package/systemd/0005-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
\ No newline at end of file
diff --git a/boot/systemd-boot/0006-meson.build-fix-detection-of-Werror-shadow.patch b/boot/systemd-boot/0006-meson.build-fix-detection-of-Werror-shadow.patch
new file mode 120000
index 0000000000..0e0a5cfab1
--- /dev/null
+++ b/boot/systemd-boot/0006-meson.build-fix-detection-of-Werror-shadow.patch
@@ -0,0 +1 @@
+../../package/systemd/0006-meson.build-fix-detection-of-Werror-shadow.patch
\ No newline at end of file
diff --git a/boot/systemd-boot/1000-buildsys-relax-depenencies-to-be-able-to-just-build-.patch b/boot/systemd-boot/1000-buildsys-relax-depenencies-to-be-able-to-just-build-.patch
new file mode 100644
index 0000000000..46cfe31866
--- /dev/null
+++ b/boot/systemd-boot/1000-buildsys-relax-depenencies-to-be-able-to-just-build-.patch
@@ -0,0 +1,40 @@
+From 6fd68b581997cd79cee2c957fe3e2d7328727e71 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+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" <yann.morin.1998@free.fr>
+---
+ 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
+
diff --git a/boot/systemd-boot/Config.in b/boot/systemd-boot/Config.in
new file mode 100644
index 0000000000..51dcebbf42
--- /dev/null
+++ b/boot/systemd-boot/Config.in
@@ -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
diff --git a/boot/systemd-boot/boot-files b/boot/systemd-boot/boot-files
new file mode 120000
index 0000000000..0ff51d4e0a
--- /dev/null
+++ b/boot/systemd-boot/boot-files
@@ -0,0 +1 @@
+../../package/systemd/boot-files
\ No newline at end of file
diff --git a/boot/systemd-boot/systemd-boot.hash b/boot/systemd-boot/systemd-boot.hash
new file mode 120000
index 0000000000..4259f40c21
--- /dev/null
+++ b/boot/systemd-boot/systemd-boot.hash
@@ -0,0 +1 @@
+../../package/systemd/systemd.hash
\ No newline at end of file
diff --git a/boot/systemd-boot/systemd-boot.mk b/boot/systemd-boot/systemd-boot.mk
new file mode 100644
index 0000000000..0b0a356041
--- /dev/null
+++ b/boot/systemd-boot/systemd-boot.mk
@@ -0,0 +1,102 @@
+################################################################################
+#
+# systemd-boot
+#
+################################################################################
+
+# When updating this version, please also update it in package/systemd/
+SYSTEMD_BOOT_VERSION = 239
+SYSTEMD_BOOT_SITE = $(call github,systemd,systemd,v$(SYSTEMD_BOOT_VERSION))
+SYSTEMD_BOOT_SOURCE = systemd-239.tar.gz
+SYSTEMD_BOOT_DL_SUBDIR = systemd
+
+SYSTEMD_BOOT_LICENSE = LGPL-2.1+, GPL-2.0+ (udev), Public Domain (few source files, see README)
+SYSTEMD_BOOT_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1 README
+
+SYSTEMD_BOOT_DEPENDENCIES = gnu-efi
+
+SYSTEMD_BOOT_INSTALL_TARGET = NO
+SYSTEMD_BOOT_INSTALL_IMAGES = YES
+
+SYSTEMD_BOOT_CONF_OPTS += \
+	-Drootlibdir='/usr/lib' \
+	-Dblkid=false \
+	-Dman=false \
+	-Dima=false \
+	-Dlibcryptsetup=false \
+	-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 \
+	-Dldconfig=false \
+	-Ddefault-dnssec=no \
+	-Dtests=false \
+	-Dnobody-group=nogroup \
+	-Didn=false \
+	-Dnss-systemd=false \
+	-Dacl=false \
+	-Daudit=false \
+	-Delfutils=false \
+	-Dlibidn=false \
+	-Dlibidn2=false \
+	-Dseccomp=false \
+	-Dxkbcommon=false \
+	-Dbzip2=false \
+	-Dlz4=false \
+	-Dpam=false \
+	-Dxz=false \
+	-Dzlib=false \
+	-Dlibcurl=false \
+	-Dgcrypt=false \
+	-Dpcre2=false \
+	-Dmicrohttpd=false \
+	-Dqrencode=false \
+	-Dselinux=false \
+	-Dhwdb=false \
+	-Dbinfmt=false \
+	-Dvconsole=false \
+	-Dquotacheck=false \
+	-Dtmpfiles=false \
+	-Dsysusers=false \
+	-Dfirstboot=false \
+	-Drandomseed=false \
+	-Dbacklight=false \
+	-Drfkill=false \
+	-Dlogind=false \
+	-Dmachined=false \
+	-Dimportd=false \
+	-Dhostnamed=false \
+	-Dmyhostname=false \
+	-Dtimedated=false \
+	-Dlocaled=false \
+	-Dcoredump=false \
+	-Dpolkit=false \
+	-Dnetworkd=false \
+	-Dresolve=false \
+	-Dtimesyncd=false \
+	-Dsmack=false \
+	-Dhibernate=false
+
+SYSTEMD_BOOT_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
+SYSTEMD_BOOT_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
+
+SYSTEMD_BOOT_TARGET_EFI_ARCH = $(call qstrip,$(BR2_TARGET_SYSTEMD_BOOT_EFI_ARCH))
+SYSTEMD_BOOT_NINJA_OPTS = \
+	src/boot/efi/systemd-boot$(SYSTEMD_BOOT_TARGET_EFI_ARCH).efi \
+	src/boot/efi/linux$(SYSTEMD_BOOT_TARGET_EFI_ARCH).efi.stub
+
+define SYSTEMD_BOOT_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/build/src/boot/efi/systemd-boot$(SYSTEMD_BOOT_TARGET_EFI_ARCH).efi \
+		$(BINARIES_DIR)/efi-part/EFI/BOOT/boot$(SYSTEMD_BOOT_TARGET_EFI_ARCH).efi
+	echo "boot$(SYSTEMD_BOOT_TARGET_EFI_ARCH).efi" > \
+		$(BINARIES_DIR)/efi-part/startup.nsh
+	$(INSTALL) -D -m 0644 $(SYSTEMD_BOOT_PKGDIR)/boot-files/loader.conf \
+		$(BINARIES_DIR)/efi-part/loader/loader.conf
+	$(INSTALL) -D -m 0644 $(SYSTEMD_BOOT_PKGDIR)/boot-files/buildroot.conf \
+		$(BINARIES_DIR)/efi-part/loader/entries/buildroot.conf
+endef
+
+$(eval $(meson-package))
diff --git a/package/systemd/Config.in b/package/systemd/Config.in
index 50d09b34a5..a99358fc7b 100644
--- a/package/systemd/Config.in
+++ b/package/systemd/Config.in
@@ -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"
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 2822d4423c..3f8f7aaac3 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -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)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26  8:52 ` [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package Yann E. MORIN
@ 2018-12-26  9:33   ` Yann E. MORIN
  2018-12-26 21:23   ` Thomas Petazzoni
  2019-01-10 23:47   ` Arnout Vandecappelle
  2 siblings, 0 replies; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-26  9:33 UTC (permalink / raw)
  To: buildroot

All,

On 2018-12-26 09:52 +0100, Yann E. MORIN spake thusly:
[--SNIP--]
> diff --git a/package/systemd/Config.in b/package/systemd/Config.in
> index 50d09b34a5..a99358fc7b 100644
> --- a/package/systemd/Config.in
> +++ b/package/systemd/Config.in
> @@ -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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules
  2018-12-26  8:52 ` [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules Yann E. MORIN
@ 2018-12-26 11:36   ` James Hilliard
  2018-12-26 12:06     ` Yann E. MORIN
  2018-12-28 10:54   ` Thomas Petazzoni
  1 sibling, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-26 11:36 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 26, 2018 at 2:52 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> 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.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> Cc: James Hilliard <james.hilliard1@gmail.com>
> ---
>  docs/manual/adding-packages-meson.txt | 3 +++
>  package/pkg-meson.mk                  | 4 ++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
> index c52fe10506..549319b192 100644
> --- a/docs/manual/adding-packages-meson.txt
> +++ b/docs/manual/adding-packages-meson.txt
> @@ -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).
> diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> index 507e686068..0588660dbf 100644
> --- a/package/pkg-meson.mk
> +++ b/package/pkg-meson.mk
> @@ -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
shouldn't $$($$(PKG)_NINJA_OPTS) come after $$($$(PKG)_SRCDIR)/build?
>  endef
>  endif
>  endif
> --
> 2.14.1
>

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules
  2018-12-26 11:36   ` James Hilliard
@ 2018-12-26 12:06     ` Yann E. MORIN
  2018-12-27  4:21       ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-26 12:06 UTC (permalink / raw)
  To: buildroot

James, ?ric, All,

On 2018-12-26 05:36 -0600, James Hilliard spake thusly:
> On Wed, Dec 26, 2018 at 2:52 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > Some packages may want to build only specific targets, instead of the
> > default.
[--SNIP--]
> > diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> > index 507e686068..0588660dbf 100644
> > --- a/package/pkg-meson.mk
> > +++ b/package/pkg-meson.mk
> > @@ -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
> 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26  8:52 ` [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package Yann E. MORIN
  2018-12-26  9:33   ` Yann E. MORIN
@ 2018-12-26 21:23   ` Thomas Petazzoni
  2018-12-26 21:37     ` James Hilliard
  2018-12-26 21:41     ` Yann E. MORIN
  2019-01-10 23:47   ` Arnout Vandecappelle
  2 siblings, 2 replies; 43+ messages in thread
From: Thomas Petazzoni @ 2018-12-26 21:23 UTC (permalink / raw)
  To: buildroot

Hello,

Thanks for working on this!

On Wed, 26 Dec 2018 09:52:30 +0100, Yann E. MORIN wrote:
> From: James Hilliard <james.hilliard1@gmail.com>
> 
> 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
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26 21:23   ` Thomas Petazzoni
@ 2018-12-26 21:37     ` James Hilliard
  2018-12-26 21:43       ` Thomas Petazzoni
  2018-12-26 21:41     ` Yann E. MORIN
  1 sibling, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-26 21:37 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 26, 2018 at 3:23 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello,
>
> Thanks for working on this!
>
> On Wed, 26 Dec 2018 09:52:30 +0100, Yann E. MORIN wrote:
> > From: James Hilliard <james.hilliard1@gmail.com>
> >
> > 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
> >
> > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
>
> 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.
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.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26 21:23   ` Thomas Petazzoni
  2018-12-26 21:37     ` James Hilliard
@ 2018-12-26 21:41     ` Yann E. MORIN
  2018-12-26 22:07       ` James Hilliard
  2018-12-31 12:43       ` Peter Korsgaard
  1 sibling, 2 replies; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-26 21:41 UTC (permalink / raw)
  To: buildroot

Thomas, All,

Adding Peter in the loop; see at the end.

On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:
> On Wed, 26 Dec 2018 09:52:30 +0100, Yann E. MORIN wrote:
> > From: James Hilliard <james.hilliard1@gmail.com>
> > 
> > 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
> > 
> > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> 
> 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.

> 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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26 21:37     ` James Hilliard
@ 2018-12-26 21:43       ` Thomas Petazzoni
  2018-12-26 21:52         ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: Thomas Petazzoni @ 2018-12-26 21:43 UTC (permalink / raw)
  To: buildroot

Hello,

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

> 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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26 21:43       ` Thomas Petazzoni
@ 2018-12-26 21:52         ` James Hilliard
  0 siblings, 0 replies; 43+ messages in thread
From: James Hilliard @ 2018-12-26 21:52 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 26, 2018 at 3:43 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello,
>
> On Wed, 26 Dec 2018 15:37:42 -0600, James Hilliard wrote:
>
> > 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.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26 21:41     ` Yann E. MORIN
@ 2018-12-26 22:07       ` James Hilliard
  2018-12-26 22:12         ` James Hilliard
  2018-12-31 12:43       ` Peter Korsgaard
  1 sibling, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-26 22:07 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 26, 2018 at 3:41 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Thomas, All,
>
> Adding Peter in the loop; see at the end.
>
> On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:
> > On Wed, 26 Dec 2018 09:52:30 +0100, Yann E. MORIN wrote:
> > > From: James Hilliard <james.hilliard1@gmail.com>
> > >
> > > 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
> > >
> > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> >
> > 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)
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++']]
>
> 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.
>
> > 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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26 22:07       ` James Hilliard
@ 2018-12-26 22:12         ` James Hilliard
  2018-12-26 22:52           ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-26 22:12 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 26, 2018 at 4:07 PM James Hilliard
<james.hilliard1@gmail.com> wrote:
>
> On Wed, Dec 26, 2018 at 3:41 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >
> > Thomas, All,
> >
> > Adding Peter in the loop; see at the end.
> >
> > On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:
> > > On Wed, 26 Dec 2018 09:52:30 +0100, Yann E. MORIN wrote:
> > > > From: James Hilliard <james.hilliard1@gmail.com>
> > > >
> > > > 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
> > > >
> > > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> > >
> > > 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)
> 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
> meson.build:293:8: ERROR:  Unknown compiler(s):
> [['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]
> >
> > 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.
> >
> > > 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.  |
> > '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26 22:12         ` James Hilliard
@ 2018-12-26 22:52           ` James Hilliard
  2018-12-27  1:27             ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-26 22:52 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 26, 2018 at 4:12 PM James Hilliard
<james.hilliard1@gmail.com> wrote:
>
> On Wed, Dec 26, 2018 at 4:07 PM James Hilliard
> <james.hilliard1@gmail.com> wrote:
> >
> > On Wed, Dec 26, 2018 at 3:41 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > >
> > > Thomas, All,
> > >
> > > Adding Peter in the loop; see at the end.
> > >
> > > On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:
> > > > On Wed, 26 Dec 2018 09:52:30 +0100, Yann E. MORIN wrote:
> > > > > From: James Hilliard <james.hilliard1@gmail.com>
> > > > >
> > > > > 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
> > > > >
> > > > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> > > >
> > > > 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)
> > 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
> > meson.build:293:8: ERROR:  Unknown compiler(s):
> > [['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]
> > >
> > > 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.
> > >
> > > > 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.  |
> > > '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26 22:52           ` James Hilliard
@ 2018-12-27  1:27             ` James Hilliard
  2018-12-27  8:49               ` Yann E. MORIN
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-27  1:27 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 26, 2018 at 4:52 PM James Hilliard
<james.hilliard1@gmail.com> wrote:
>
> On Wed, Dec 26, 2018 at 4:12 PM James Hilliard
> <james.hilliard1@gmail.com> wrote:
> >
> > On Wed, Dec 26, 2018 at 4:07 PM James Hilliard
> > <james.hilliard1@gmail.com> wrote:
> > >
> > > On Wed, Dec 26, 2018 at 3:41 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > >
> > > > Thomas, All,
> > > >
> > > > Adding Peter in the loop; see at the end.
> > > >
> > > > On 2018-12-26 22:23 +0100, Thomas Petazzoni spake thusly:
> > > > > On Wed, 26 Dec 2018 09:52:30 +0100, Yann E. MORIN wrote:
> > > > > > From: James Hilliard <james.hilliard1@gmail.com>
> > > > > >
> > > > > > 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
> > > > > >
> > > > > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> > > > >
> > > > > 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)
> > > 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
> > > meson.build:293:8: ERROR:  Unknown compiler(s):
> > > [['/home/buildroot/buildroot/output/host/bin/i586-buildroot-linux-uclibc-g++']]
> > > >
> > > > 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.
> > > >
> > > > > 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.  |
> > > > '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules
  2018-12-26 12:06     ` Yann E. MORIN
@ 2018-12-27  4:21       ` James Hilliard
  2018-12-27  8:23         ` Yann E. MORIN
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-27  4:21 UTC (permalink / raw)
  To: buildroot

On Wed, Dec 26, 2018 at 6:06 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, ?ric, All,
>
> On 2018-12-26 05:36 -0600, James Hilliard spake thusly:
> > On Wed, Dec 26, 2018 at 2:52 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > Some packages may want to build only specific targets, instead of the
> > > default.
> [--SNIP--]
> > > diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> > > index 507e686068..0588660dbf 100644
> > > --- a/package/pkg-meson.mk
> > > +++ b/package/pkg-meson.mk
> > > @@ -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
> > 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:
Maybe add a $$($$(PKG)_NINJA_TARGETS) option as well?
>
>     $ ./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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules
  2018-12-27  4:21       ` James Hilliard
@ 2018-12-27  8:23         ` Yann E. MORIN
  0 siblings, 0 replies; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-27  8:23 UTC (permalink / raw)
  To: buildroot

James, All,

On 2018-12-26 22:21 -0600, James Hilliard spake thusly:
> On Wed, Dec 26, 2018 at 6:06 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >
> > James, ?ric, All,
> >
> > On 2018-12-26 05:36 -0600, James Hilliard spake thusly:
> > > On Wed, Dec 26, 2018 at 2:52 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > Some packages may want to build only specific targets, instead of the
> > > > default.
> > [--SNIP--]
> > > > diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> > > > index 507e686068..0588660dbf 100644
> > > > --- a/package/pkg-meson.mk
> > > > +++ b/package/pkg-meson.mk
> > > > @@ -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
> > > 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:
> 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.

> >     $ ./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.  |
> > '------------------------------^-------^------------------^--------------------'

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-27  1:27             ` James Hilliard
@ 2018-12-27  8:49               ` Yann E. MORIN
  2018-12-27  9:07                 ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-27  8:49 UTC (permalink / raw)
  To: buildroot

James, All,

On 2018-12-26 19:27 -0600, James Hilliard spake thusly:
> On Wed, Dec 26, 2018 at 4:52 PM James Hilliard
> > > > 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-27  8:49               ` Yann E. MORIN
@ 2018-12-27  9:07                 ` James Hilliard
  2018-12-27  9:11                   ` Yann E. MORIN
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-27  9:07 UTC (permalink / raw)
  To: buildroot

On Thu, Dec 27, 2018 at 2:49 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2018-12-26 19:27 -0600, James Hilliard spake thusly:
> > On Wed, Dec 26, 2018 at 4:52 PM James Hilliard
> > > > > 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.
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).
>
> 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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-27  9:07                 ` James Hilliard
@ 2018-12-27  9:11                   ` Yann E. MORIN
  2018-12-27  9:13                     ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-27  9:11 UTC (permalink / raw)
  To: buildroot

James, All,

On 2018-12-27 03:07 -0600, James Hilliard spake thusly:
> On Thu, Dec 27, 2018 at 2:49 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > On 2018-12-26 19:27 -0600, James Hilliard spake thusly:
> > > On Wed, Dec 26, 2018 at 4:52 PM James Hilliard
> > > > > > 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.
> 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-27  9:11                   ` Yann E. MORIN
@ 2018-12-27  9:13                     ` James Hilliard
  2018-12-27 10:40                       ` Yann E. MORIN
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-27  9:13 UTC (permalink / raw)
  To: buildroot

On Thu, Dec 27, 2018 at 3:11 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2018-12-27 03:07 -0600, James Hilliard spake thusly:
> > On Thu, Dec 27, 2018 at 2:49 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > On 2018-12-26 19:27 -0600, James Hilliard spake thusly:
> > > > On Wed, Dec 26, 2018 at 4:52 PM James Hilliard
> > > > > > > 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.
> > 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.
>
> 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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-27  9:13                     ` James Hilliard
@ 2018-12-27 10:40                       ` Yann E. MORIN
  2018-12-27 10:42                         ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-27 10:40 UTC (permalink / raw)
  To: buildroot

James, All,

On 2018-12-27 03:13 -0600, James Hilliard spake thusly:
> On Thu, Dec 27, 2018 at 3:11 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > On 2018-12-27 03:07 -0600, James Hilliard spake thusly:
> > > On Thu, Dec 27, 2018 at 2:49 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > On 2018-12-26 19:27 -0600, James Hilliard spake thusly:
> > > > > On Wed, Dec 26, 2018 at 4:52 PM James Hilliard
> > > > > > > > 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.
> > > 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.

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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-27 10:40                       ` Yann E. MORIN
@ 2018-12-27 10:42                         ` James Hilliard
  2018-12-27 10:57                           ` Yann E. MORIN
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-27 10:42 UTC (permalink / raw)
  To: buildroot

On Thu, Dec 27, 2018 at 4:40 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2018-12-27 03:13 -0600, James Hilliard spake thusly:
> > On Thu, Dec 27, 2018 at 3:11 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > On 2018-12-27 03:07 -0600, James Hilliard spake thusly:
> > > > On Thu, Dec 27, 2018 at 2:49 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > > On 2018-12-26 19:27 -0600, James Hilliard spake thusly:
> > > > > > On Wed, Dec 26, 2018 at 4:52 PM James Hilliard
> > > > > > > > > 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.
> > > > 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.
>
> 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?
>
> 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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-27 10:42                         ` James Hilliard
@ 2018-12-27 10:57                           ` Yann E. MORIN
  2018-12-27 11:01                             ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-27 10:57 UTC (permalink / raw)
  To: buildroot

James, All,

On 2018-12-27 04:42 -0600, James Hilliard spake thusly:
> On Thu, Dec 27, 2018 at 4:40 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-27 10:57                           ` Yann E. MORIN
@ 2018-12-27 11:01                             ` James Hilliard
  2018-12-29  9:35                               ` Yann E. MORIN
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-27 11:01 UTC (permalink / raw)
  To: buildroot

On Thu, Dec 27, 2018 at 4:57 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2018-12-27 04:42 -0600, James Hilliard spake thusly:
> > On Thu, Dec 27, 2018 at 4:40 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > 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.
>
> 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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 1/5 v5] package/meson: never try to run generated target binaries
  2018-12-26  8:52 ` [Buildroot] [PATCH 1/5 v5] package/meson: never try to run generated target binaries Yann E. MORIN
@ 2018-12-28 10:54   ` Thomas Petazzoni
  0 siblings, 0 replies; 43+ messages in thread
From: Thomas Petazzoni @ 2018-12-28 10:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 26 Dec 2018 09:52:26 +0100, Yann E. MORIN wrote:
> From: James Hilliard <james.hilliard1@gmail.com>
> 
> 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
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> [yann.morin.1998 at free.fr:
>   - split in its own patch
>   - improve commit log
> ]
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> ---
>  package/meson/cross-compilation.conf.in | 1 +
>  1 file changed, 1 insertion(+)

Applied to master, thanks.

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

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 2/5 v5] package/meson: fix CPU familly
  2018-12-26  8:52 ` [Buildroot] [PATCH 2/5 v5] package/meson: fix CPU familly Yann E. MORIN
@ 2018-12-28 10:54   ` Thomas Petazzoni
  0 siblings, 0 replies; 43+ messages in thread
From: Thomas Petazzoni @ 2018-12-28 10:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 26 Dec 2018 09:52:27 +0100, Yann E. MORIN wrote:
> From: James Hilliard <james.hilliard1@gmail.com>
> 
> 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
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> [yann.morin.1998 at free.fr:
>   - split in its own patch
>   - imnprove commit log
> ]
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
>  package/meson/meson.mk | 31 ++++++++++++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)

Applied to master, thanks.

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

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules
  2018-12-26  8:52 ` [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules Yann E. MORIN
  2018-12-26 11:36   ` James Hilliard
@ 2018-12-28 10:54   ` Thomas Petazzoni
  1 sibling, 0 replies; 43+ messages in thread
From: Thomas Petazzoni @ 2018-12-28 10:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 26 Dec 2018 09:52:28 +0100, Yann E. MORIN wrote:
> 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.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> Cc: James Hilliard <james.hilliard1@gmail.com>
> ---
>  docs/manual/adding-packages-meson.txt | 3 +++
>  package/pkg-meson.mk                  | 4 ++--
>  2 files changed, 5 insertions(+), 2 deletions(-)

Applied to master, thanks.

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

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-27 11:01                             ` James Hilliard
@ 2018-12-29  9:35                               ` Yann E. MORIN
  2018-12-29 10:50                                 ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-29  9:35 UTC (permalink / raw)
  To: buildroot

James, All,

On 2018-12-27 05:01 -0600, James Hilliard spake thusly:
> On Thu, Dec 27, 2018 at 4:57 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > On 2018-12-27 04:42 -0600, James Hilliard spake thusly:
> > > On Thu, Dec 27, 2018 at 4:40 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-29  9:35                               ` Yann E. MORIN
@ 2018-12-29 10:50                                 ` James Hilliard
  2018-12-29 11:38                                   ` Yann E. MORIN
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-29 10:50 UTC (permalink / raw)
  To: buildroot

On Sat, Dec 29, 2018 at 3:35 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2018-12-27 05:01 -0600, James Hilliard spake thusly:
> > On Thu, Dec 27, 2018 at 4:57 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > On 2018-12-27 04:42 -0600, James Hilliard spake thusly:
> > > > On Thu, Dec 27, 2018 at 4:40 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > > 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?
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
>
> 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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-29 10:50                                 ` James Hilliard
@ 2018-12-29 11:38                                   ` Yann E. MORIN
  2018-12-29 11:43                                     ` James Hilliard
  2018-12-30  8:44                                     ` James Hilliard
  0 siblings, 2 replies; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-29 11:38 UTC (permalink / raw)
  To: buildroot

James, All,

On 2018-12-29 04:50 -0600, James Hilliard spake thusly:
> On Sat, Dec 29, 2018 at 3:35 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > On 2018-12-27 05:01 -0600, James Hilliard spake thusly:
> > > On Thu, Dec 27, 2018 at 4:57 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > On 2018-12-27 04:42 -0600, James Hilliard spake thusly:
> > > > > On Thu, Dec 27, 2018 at 4:40 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > > > 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?
> 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)?

> 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-29 11:38                                   ` Yann E. MORIN
@ 2018-12-29 11:43                                     ` James Hilliard
  2018-12-30  8:44                                     ` James Hilliard
  1 sibling, 0 replies; 43+ messages in thread
From: James Hilliard @ 2018-12-29 11:43 UTC (permalink / raw)
  To: buildroot

On Sat, Dec 29, 2018 at 5:38 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2018-12-29 04:50 -0600, James Hilliard spake thusly:
> > On Sat, Dec 29, 2018 at 3:35 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > On 2018-12-27 05:01 -0600, James Hilliard spake thusly:
> > > > On Thu, Dec 27, 2018 at 4:57 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > > On 2018-12-27 04:42 -0600, James Hilliard spake thusly:
> > > > > > On Thu, Dec 27, 2018 at 4:40 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > > > > 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?
> > 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.
>
> > 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/.
>
> 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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-29 11:38                                   ` Yann E. MORIN
  2018-12-29 11:43                                     ` James Hilliard
@ 2018-12-30  8:44                                     ` James Hilliard
  2018-12-31 10:16                                       ` Yann E. MORIN
  1 sibling, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-30  8:44 UTC (permalink / raw)
  To: buildroot

On Sat, Dec 29, 2018 at 5:38 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2018-12-29 04:50 -0600, James Hilliard spake thusly:
> > On Sat, Dec 29, 2018 at 3:35 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > On 2018-12-27 05:01 -0600, James Hilliard spake thusly:
> > > > On Thu, Dec 27, 2018 at 4:57 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > > On 2018-12-27 04:42 -0600, James Hilliard spake thusly:
> > > > > > On Thu, Dec 27, 2018 at 4:40 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > > > > 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?
> > 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)?
>
> > 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
>
> 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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-30  8:44                                     ` James Hilliard
@ 2018-12-31 10:16                                       ` Yann E. MORIN
  2018-12-31 10:24                                         ` James Hilliard
  0 siblings, 1 reply; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-31 10:16 UTC (permalink / raw)
  To: buildroot

James, All,

On 2018-12-30 02:44 -0600, James Hilliard spake thusly:
> On Sat, Dec 29, 2018 at 5:38 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
[--SNIP--]
> > 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-31 10:16                                       ` Yann E. MORIN
@ 2018-12-31 10:24                                         ` James Hilliard
  2018-12-31 10:36                                           ` Yann E. MORIN
  0 siblings, 1 reply; 43+ messages in thread
From: James Hilliard @ 2018-12-31 10:24 UTC (permalink / raw)
  To: buildroot

On Mon, Dec 31, 2018 at 4:16 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2018-12-30 02:44 -0600, James Hilliard spake thusly:
> > On Sat, Dec 29, 2018 at 5:38 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> [--SNIP--]
> > > 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.
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?
>
> 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.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-31 10:24                                         ` James Hilliard
@ 2018-12-31 10:36                                           ` Yann E. MORIN
  0 siblings, 0 replies; 43+ messages in thread
From: Yann E. MORIN @ 2018-12-31 10:36 UTC (permalink / raw)
  To: buildroot

James, All,

On 2018-12-31 04:24 -0600, James Hilliard spake thusly:
> On Mon, Dec 31, 2018 at 4:16 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > On 2018-12-30 02:44 -0600, James Hilliard spake thusly:
> > > On Sat, Dec 29, 2018 at 5:38 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > [--SNIP--]
> > > > 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.
> 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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26 21:41     ` Yann E. MORIN
  2018-12-26 22:07       ` James Hilliard
@ 2018-12-31 12:43       ` Peter Korsgaard
  1 sibling, 0 replies; 43+ messages in thread
From: Peter Korsgaard @ 2018-12-31 12:43 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

Hi,
 >> 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.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2018-12-26  8:52 ` [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package Yann E. MORIN
  2018-12-26  9:33   ` Yann E. MORIN
  2018-12-26 21:23   ` Thomas Petazzoni
@ 2019-01-10 23:47   ` Arnout Vandecappelle
  2019-01-11  5:59     ` Yann E. MORIN
  2019-01-11  6:47     ` James Hilliard
  2 siblings, 2 replies; 43+ messages in thread
From: Arnout Vandecappelle @ 2019-01-10 23:47 UTC (permalink / raw)
  To: buildroot



On 26/12/2018 09:52, Yann E. MORIN wrote:
> 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:

>> 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

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2019-01-10 23:47   ` Arnout Vandecappelle
@ 2019-01-11  5:59     ` Yann E. MORIN
  2019-01-11  6:47     ` James Hilliard
  1 sibling, 0 replies; 43+ messages in thread
From: Yann E. MORIN @ 2019-01-11  5:59 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2019-01-11 00:47 +0100, Arnout Vandecappelle spake thusly:
> On 26/12/2018 09:52, Yann E. MORIN wrote:
> > 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:
> 
> >> 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--]
>  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.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package
  2019-01-10 23:47   ` Arnout Vandecappelle
  2019-01-11  5:59     ` Yann E. MORIN
@ 2019-01-11  6:47     ` James Hilliard
  1 sibling, 0 replies; 43+ messages in thread
From: James Hilliard @ 2019-01-11  6:47 UTC (permalink / raw)
  To: buildroot

On Thu, Jan 10, 2019 at 4:47 PM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 26/12/2018 09:52, Yann E. MORIN wrote:
> > 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:
>
> >> 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.
I came up with a significantly smaller patch I'm working on getting
merged into upstream
https://github.com/systemd/systemd/pull/11294/files.
>
>  Regards,
>  Arnout

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2019-01-11  6:47 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-26  8:52 [Buildroot] [PATCH 0/5 v5] systemd-boot: new simple EFI bootloader replacing gummmiboot (branch yem/systemd-boot) Yann E. MORIN
2018-12-26  8:52 ` [Buildroot] [PATCH 1/5 v5] package/meson: never try to run generated target binaries Yann E. MORIN
2018-12-28 10:54   ` Thomas Petazzoni
2018-12-26  8:52 ` [Buildroot] [PATCH 2/5 v5] package/meson: fix CPU familly Yann E. MORIN
2018-12-28 10:54   ` Thomas Petazzoni
2018-12-26  8:52 ` [Buildroot] [PATCH 3/5 v5] core/pkg-infra: allow meson packages to specify custom build rules Yann E. MORIN
2018-12-26 11:36   ` James Hilliard
2018-12-26 12:06     ` Yann E. MORIN
2018-12-27  4:21       ` James Hilliard
2018-12-27  8:23         ` Yann E. MORIN
2018-12-28 10:54   ` Thomas Petazzoni
2018-12-26  8:52 ` [Buildroot] [PATCH 4/5 v5] package/systemd: enable building of systemd-boot Yann E. MORIN
2018-12-26  8:52 ` [Buildroot] [PATCH 5/5 v5] boot/systemd-boot: new package Yann E. MORIN
2018-12-26  9:33   ` Yann E. MORIN
2018-12-26 21:23   ` Thomas Petazzoni
2018-12-26 21:37     ` James Hilliard
2018-12-26 21:43       ` Thomas Petazzoni
2018-12-26 21:52         ` James Hilliard
2018-12-26 21:41     ` Yann E. MORIN
2018-12-26 22:07       ` James Hilliard
2018-12-26 22:12         ` James Hilliard
2018-12-26 22:52           ` James Hilliard
2018-12-27  1:27             ` James Hilliard
2018-12-27  8:49               ` Yann E. MORIN
2018-12-27  9:07                 ` James Hilliard
2018-12-27  9:11                   ` Yann E. MORIN
2018-12-27  9:13                     ` James Hilliard
2018-12-27 10:40                       ` Yann E. MORIN
2018-12-27 10:42                         ` James Hilliard
2018-12-27 10:57                           ` Yann E. MORIN
2018-12-27 11:01                             ` James Hilliard
2018-12-29  9:35                               ` Yann E. MORIN
2018-12-29 10:50                                 ` James Hilliard
2018-12-29 11:38                                   ` Yann E. MORIN
2018-12-29 11:43                                     ` James Hilliard
2018-12-30  8:44                                     ` James Hilliard
2018-12-31 10:16                                       ` Yann E. MORIN
2018-12-31 10:24                                         ` James Hilliard
2018-12-31 10:36                                           ` Yann E. MORIN
2018-12-31 12:43       ` Peter Korsgaard
2019-01-10 23:47   ` Arnout Vandecappelle
2019-01-11  5:59     ` Yann E. MORIN
2019-01-11  6:47     ` James Hilliard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.