From 04fea8407c5bbe379946dc6972f23cedae814fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 22 Nov 2022 15:59:21 +0100 Subject: [PATCH 1/2] kernel-install: make 90-loadentry.install templated It's a bit annoying that this causes so much churn, but I don't see a different way to do this. --- ...loaderentry.install => 90-loaderentry.install.in} | 0 src/kernel-install/meson.build | 12 ++++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) rename src/kernel-install/{90-loaderentry.install => 90-loaderentry.install.in} (100%) diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install.in similarity index 100% rename from src/kernel-install/90-loaderentry.install rename to src/kernel-install/90-loaderentry.install.in diff --git a/src/kernel-install/meson.build b/src/kernel-install/meson.build index 90a0e3ae49..e5cfdb824c 100644 --- a/src/kernel-install/meson.build +++ b/src/kernel-install/meson.build @@ -1,11 +1,19 @@ # SPDX-License-Identifier: LGPL-2.1-or-later kernel_install_in = files('kernel-install.in') -loaderentry_install = files('90-loaderentry.install') +loaderentry_install_in = files('90-loaderentry.install.in') + +loaderentry_install = custom_target( + '90-loaderentry.install', + input : loaderentry_install_in, + output : '90-loaderentry.install', + command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'], + install : want_kernel_install, + install_mode : 'rwxr-xr-x', + install_dir : kernelinstalldir) if want_kernel_install install_data('50-depmod.install', - loaderentry_install, install_mode : 'rwxr-xr-x', install_dir : kernelinstalldir) From 0be160136e649d6a46f8252605cdda8f94e7bdcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 22 Nov 2022 15:59:21 +0100 Subject: [PATCH 2/2] kernel-install: add header to generate entry files I was looking at a bug in bugzilla about some boot loader issue, and it was hard to say if the boot entry files were generated by our plugin or something else. Add a header to make this clear. kernel-install invokes the plugins via absolute path always, so $0 gives as the full path the location where the plugin is installed. This is what we want: title Fedora Linux 37 (Workstation Edition) # Boot Loader Specification type#1 entry # File created by /usr/lib/kernel/install.d/90-loaderentry.install (systemd 252-409-g5028904^) --- src/kernel-install/90-loaderentry.install.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/kernel-install/90-loaderentry.install.in b/src/kernel-install/90-loaderentry.install.in index 41a05534b9..4e936d95f4 100755 --- a/src/kernel-install/90-loaderentry.install.in +++ b/src/kernel-install/90-loaderentry.install.in @@ -138,6 +138,8 @@ mkdir -p "${LOADER_ENTRY%/*}" || { [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Creating $LOADER_ENTRY" { + echo "# Boot Loader Specification type#1 entry" + echo "# File created by $0 (systemd {{GIT_VERSION}})" echo "title $PRETTY_NAME" echo "version $KERNEL_VERSION" if [ "$ENTRY_TOKEN" = "$MACHINE_ID" ]; then