From 7d3305235702a7c730ea9af9db6b00156e664194 Mon Sep 17 00:00:00 2001 From: Jianxun Zhang Date: Wed, 3 Aug 2016 11:04:14 -0700 Subject: systemd-boot: Load board-specific entry and kernel cmdline Invoke RMC APIs in this bootloader to query board-specific data from RMC database(DB) file on ESP. Data can be boot entries or a global kernel boot command line fragment specific to a type of board supported in RMC DB. Bootloader queries a file blob named BOOTENTRY.CONFIG from RMC DB first. In success, bootloader parses BOOTENTRY.CONFIG to get name of each boot entry file associated to the type of running board, and then tries to load the entry into internal config data structure. Once any entry is loaded from RMC DB, bootloader skips loading conf files on ESP. BOOTENTRY.CONFIG has a very simple format - every line is a boot entry file's name. For example, to specify two boot entries in it: boot.conf install.conf Bootloader also seeks another file named KBOOTPARAM in RMC dB. when it can obtain this file associated to the type of running board, it appends what in file to the end of kernel command line before it boots up kernel. The appending is effective on every boot entry, so it is called "global" cmdline fragment. When Bootloader doesn't get config, an entry or cmdline fragment for the type of board, it simply moves to the next step. Signed-off-by: Jianxun Zhang Reviewed-by: Saul Wold Signed-off-by: Tom Zanussi --- .../recipes-bsp/systemd-boot/systemd-boot.bbappend | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 common/recipes-bsp/systemd-boot/systemd-boot.bbappend (limited to 'common/recipes-bsp/systemd-boot/systemd-boot.bbappend') diff --git a/common/recipes-bsp/systemd-boot/systemd-boot.bbappend b/common/recipes-bsp/systemd-boot/systemd-boot.bbappend new file mode 100644 index 00000000..f42434c1 --- /dev/null +++ b/common/recipes-bsp/systemd-boot/systemd-boot.bbappend @@ -0,0 +1,20 @@ +DEPENDS += "rmc" + +FILESEXTRAPATHS_prepend := "${THISDIR}/systemd-boot:" + +EXTRA_OEMAKE += 'EFI_LDFLAGS="-L${STAGING_DIR_HOST}/usr/lib" EFI_CFLAGS="-I${STAGING_INCDIR}/rmc/efi -DRMC_EFI"' + +# Pin systemd revision down for systemd-boot recipe. +# Patches could not be applied cleanly when systemd in OE is updated, +# though we don't expect a lot of changes could happen in bootloader. +# RMC is designed to support a large number of types of boards, so we +# should do explicit update with validation to prevent regression even +# resolving conflicts for a new tip could be done in a short time. + +# Revision: systemd 230 in OE +SRCREV = "3a74d4fc90cb322a4784a3515bef7118c8f8c5ba" + +SRC_URI += "file://0001-sd-boot-Link-RMC-libraries-into-bootloader.patch \ + file://0002-sd-boot-Load-board-specific-boot-entries-from-RMC-da.patch \ + file://0003-sd-boot-Support-global-kernel-command-line-fragment.patch \ + " -- cgit v1.2.3-54-g00ecf