From 79caf62321cabf6c6f563082399ae1b9096e5521 Mon Sep 17 00:00:00 2001 From: Mike Looijmans Date: Fri, 14 Jun 2024 09:48:22 +0200 Subject: [PATCH] nvme-cli: Support read-only systems Attempting to install nvme-cli on a read-only system fails because of the post-install script that creates /etc/nvme/hostnqn and hostid. These files aren't actually needed for 99% of nvme-cli functionality. Split the postinstall into a separate package, nvme-cli-user and also move the unwanted util-linux-uuidgen dependency to that package. This allows to install and use nvme-cli on a read-only rootfs. If someone wants to run nvme-stas it will need a dependency on nvme-cli-user to create the files. Signed-off-by: Mike Looijmans Signed-off-by: Khem Raj --- meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.9.1.bb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.9.1.bb b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.9.1.bb index 842403c311..9b4288ff89 100644 --- a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.9.1.bb +++ b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.9.1.bb @@ -19,15 +19,16 @@ inherit bash-completion meson pkgconfig systemd EXTRA_OEMESON += "-Dsystemddir=${systemd_unitdir}/system" -pkg_postinst_ontarget:${PN}() { +pkg_postinst_ontarget:${PN}-user () { ${sbindir}/nvme gen-hostnqn > ${sysconfdir}/nvme/hostnqn ${bindir}/uuidgen > ${sysconfdir}/nvme/hostid } -PACKAGES =+ "${PN}-dracut ${PN}-zsh-completion" +PACKAGES =+ "${PN}-dracut ${PN}-zsh-completion ${PN}-user" FILES:${PN} += "${systemd_system_unitdir}" FILES:${PN}-dracut = "${nonarch_libdir}/dracut/dracut.conf.d" FILES:${PN}-zsh-completion = "${datadir}/zsh/site-functions" +ALLOW_EMPTY:${PN}-user = "1" -RDEPENDS:${PN} = "util-linux-uuidgen" +RDEPENDS:${PN}-user = "util-linux-uuidgen"