@@ -5,6 +5,7 @@
#
SYSTEMD_BOOT_CFG ?= "${S}/loader.conf"
+SYSTEMD_BOOT_ENTRIES_DIR ?= "${S}/entries"
SYSTEMD_BOOT_ENTRIES ?= ""
SYSTEMD_BOOT_TIMEOUT ?= "10"
@@ -15,7 +16,6 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit fs-uuid
python build_efi_cfg() {
- s = d.getVar("S")
labels = d.getVar('LABELS')
if not labels:
bb.debug(1, "LABELS not defined, nothing to do")
@@ -43,12 +43,14 @@ python build_efi_cfg() {
cfgfile.write('timeout 10\n')
cfgfile.close()
+ entries_dir = d.getVar('SYSTEMD_BOOT_ENTRIES_DIR')
+ if not os.path.exists(entries_dir):
+ os.makedirs(entries_dir)
+
for label in labels.split():
localdata = d.createCopy()
- entryfile = "%s/%s.conf" % (s, label)
- if not os.path.exists(s):
- os.makedirs(s)
+ entryfile = "%s/%s.conf" % (entries_dir, label)
d.appendVar("SYSTEMD_BOOT_ENTRIES", " " + entryfile)
try:
entrycfg = open(entryfile, "w")
@@ -24,9 +24,8 @@ do_install() {
install -d ${D}/boot
install -d ${D}/boot/loader
install -d ${D}/boot/loader/entries
- install loader.conf ${D}/boot/loader/
- rm loader.conf
- install *.conf ${D}/boot/loader/entries/
+ install ${SYSTEMD_BOOT_CFG} ${D}/boot/loader/
+ install ${SYSTEMD_BOOT_ENTRIES_DIR}/*.conf ${D}/boot/loader/entries/
}
FILES:${PN} = "/boot/loader/* /boot/loader/entries/*"
do_install should only modify ${D}, otherwise rerunning the task will have inconsistent results. In the case of systemd-bootconf, a second run of do_install without rerunning do_configure (for example after modifying it in a bbappend) fails altogether, as loader.conf would be missing. Rather than fixing this up by deleting loader.conf from ${D} instead of ${S} after copying *.conf, clean up systemd-boot-cfg.bbclass not to store loader.conf at the same location as the individual entries in the first place, so they can be copied separately. While we're at it, also change the recipe to make use of the variables defined by the class. Signed-off-by: Nora Schiffer <nora.schiffer@ew.tq-group.com> --- meta/classes-recipe/systemd-boot-cfg.bbclass | 10 ++++++---- meta/recipes-core/systemd/systemd-bootconf_1.00.bb | 5 ++--- 2 files changed, 8 insertions(+), 7 deletions(-)