mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-30 06:36:34 +00:00
package/systemd: enable building of systemd-boot
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@free.fr: - add missing depends on i386 || x86_64 - add missing dependency to gnu-efi - add missing boot files ] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
4a04886a64
commit
6f28ce5322
@ -78,6 +78,34 @@ if BR2_PACKAGE_SYSTEMD
|
|||||||
config BR2_PACKAGE_PROVIDES_UDEV
|
config BR2_PACKAGE_PROVIDES_UDEV
|
||||||
default "systemd"
|
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
|
||||||
|
default "ia32" if BR2_i386
|
||||||
|
default "x64" if BR2_x86_64
|
||||||
|
depends on BR2_PACKAGE_SYSTEMD_BOOT
|
||||||
|
|
||||||
config BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY
|
config BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY
|
||||||
bool "HTTP server for journal events"
|
bool "HTTP server for journal events"
|
||||||
select BR2_PACKAGE_LIBMICROHTTPD
|
select BR2_PACKAGE_LIBMICROHTTPD
|
||||||
|
3
package/systemd/boot-files/buildroot.conf
Normal file
3
package/systemd/boot-files/buildroot.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
title Buildroot
|
||||||
|
linux /bzImage
|
||||||
|
options root=/dev/sda2 rootwait console=tty1
|
2
package/systemd/boot-files/loader.conf
Normal file
2
package/systemd/boot-files/loader.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
timeout 3
|
||||||
|
default buildroot
|
@ -26,6 +26,7 @@ SYSTEMD_CONF_OPTS += \
|
|||||||
-Dima=false \
|
-Dima=false \
|
||||||
-Defi=false \
|
-Defi=false \
|
||||||
-Dgnu-efi=false \
|
-Dgnu-efi=false \
|
||||||
|
-Dlibcryptsetup=false \
|
||||||
-Dldconfig=false \
|
-Dldconfig=false \
|
||||||
-Ddefault-dnssec=no \
|
-Ddefault-dnssec=no \
|
||||||
-Dtests=false \
|
-Dtests=false \
|
||||||
@ -352,6 +353,34 @@ else
|
|||||||
SYSTEMD_CONF_OPTS += -Dhibernate=false
|
SYSTEMD_CONF_OPTS += -Dhibernate=false
|
||||||
endif
|
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))
|
SYSTEMD_FALLBACK_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
|
||||||
ifneq ($(SYSTEMD_FALLBACK_HOSTNAME),)
|
ifneq ($(SYSTEMD_FALLBACK_HOSTNAME),)
|
||||||
SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME)
|
SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME)
|
||||||
@ -376,6 +405,10 @@ SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
|
|||||||
SYSTEMD_INSTALL_MACHINEID_HOOK \
|
SYSTEMD_INSTALL_MACHINEID_HOOK \
|
||||||
SYSTEMD_INSTALL_RESOLVCONF_HOOK
|
SYSTEMD_INSTALL_RESOLVCONF_HOOK
|
||||||
|
|
||||||
|
define SYSTEMD_INSTALL_IMAGES_CMDS
|
||||||
|
$(SYSTEMD_INSTALL_BOOT_FILES)
|
||||||
|
endef
|
||||||
|
|
||||||
define SYSTEMD_USERS
|
define SYSTEMD_USERS
|
||||||
- - input -1 * - - - Input device group
|
- - input -1 * - - - Input device group
|
||||||
- - systemd-journal -1 * - - - Journal
|
- - systemd-journal -1 * - - - Journal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user