diff mbox series

nvme-cli: Support read-only systems

Message ID 20240614074822.126556-1-mike.looijmans@topic.nl
State New
Headers show
Series nvme-cli: Support read-only systems | expand

Commit Message

Mike Looijmans June 14, 2024, 7:48 a.m. UTC
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 <mike.looijmans@topic.nl>
---
 meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.8.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.8.bb b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.8.bb
index 81b30c283..2f034a675 100644
--- a/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.8.bb
+++ b/meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.8.bb
@@ -16,15 +16,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"