Skip to contentSkip to conversation

libvirt: ensure sysusers.d path for libvirt-qemu

PATCH In review [email protected] 4 participants 5 messages Sep 29, 2024 – Oct 2, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libvirt: ensure sysusers.d path for libvirt-qemu

From: Tim Orling <[email protected]>

In 8138d9cc7e0c31171230110db0cfa881c46a821b the path to /lib/sysusers.d might not exist, use install -d to ensure it does.

Fixes:
install: cannot create regular file '.../libvirt/v10.5.0+git/image/lib/sysusers.d/libvirt-qemu.conf':
No such file or directory

---
 recipes-extended/libvirt/libvirt_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/libvirt/libvirt_git.bb +1 -1
index 1175e737..bef98b69 100644
@@ -208,7 +208,7 @@ do_install:append() {
 
 	install -m 0755 ${UNPACKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd
 	install -m 0644 ${UNPACKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf
-	install -m 0644 ${UNPACKDIR}/libvirt-qemu.conf ${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf
+	install -d -m 0644 ${UNPACKDIR}/libvirt-qemu.conf ${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf
 
 	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
 	    # This will wind up in the libvirtd package, but will NOT be invoked by default.
Signature · 1 line
2.46.2
#1 lore raw

merged.

Bruce

In message: [meta-virtualization][PATCH] libvirt: ensure sysusers.d path for libvirt-qemu

Quoted 42 lines · on 28/09/2024 Tim Orling via lists.yoctoproject.org wrote:

From: Tim Orling <[email protected]>

In 8138d9cc7e0c31171230110db0cfa881c46a821b the path to /lib/sysusers.d might not exist, use install -d to ensure it does.

Fixes:
install: cannot create regular file '.../libvirt/v10.5.0+git/image/lib/sysusers.d/libvirt-qemu.conf':
No such file or directory

---
 recipes-extended/libvirt/libvirt_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/libvirt/libvirt_git.bb +1 -1
index 1175e737..bef98b69 100644
@@ -208,7 +208,7 @@ do_install:append() {
 
 	install -m 0755 ${UNPACKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd
 	install -m 0644 ${UNPACKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf
-	install -m 0644 ${UNPACKDIR}/libvirt-qemu.conf ${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf
+	install -d -m 0644 ${UNPACKDIR}/libvirt-qemu.conf ${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf
 
 	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
 	    # This will wind up in the libvirtd package, but will NOT be invoked by default.
Signature · 11 lines
2.46.2



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8902): https://lists.yoctoproject.org/g/meta-virtualization/message/8902
Mute This Topic: https://lists.yoctoproject.org/mt/108714337/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
#2 lore raw

Hi,

does that really solve your issue? With this patch applied, I run into the following build error because with the -d option, all arguments are treated as directories. So we should either use -D or create the directory accoring to the other created dirs in do_install

Quoted 8 lines

install: cannot create directory ‘/workdir/build/tmp/work/core2-64-wlanvm-linux/libvirt/v10.5.0+git/sources-unpack/libvirt-qemu.conf’:
File exists
install: cannot create directory ‘/workdir/build/tmp/work/core2-64-wlanvm-linux/libvirt/v10.5.0+git/image/usr/lib/sysusers.d/libvirt-qemu.conf’:
File exists

So I propose the following patch. Please let me know what you think.
Side note: This is my first contribution, I hope the format is correct, otherwise please let me know. I cannot use git send-email, so this is written from the webinterface. Best regards,
Matthis

Patch:

3902ac8844a9868ab14fa38b663d3832daa4b9de leads to the following build errors:
install: cannot create directory ‘{UNPACKDIR}/libvirt-qemu.conf’: File exists
install: cannot create directory ‘{D}/usr/lib/sysusers.d/libvirt-qemu.conf’: File exists because -d treats all arguments as directories. Create the required directory the same way as the other directories.

---
recipes-extended/libvirt/libvirt_git.bb | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
recipes-extended/libvirt/libvirt_git.bb +0 -0
index bef98b69..5c5a9b3f 100644
@@ -205,10 +205,11 @@ do_install:append() {

install -d ${D}/etc/init.d
install -d ${D}/etc/libvirt
install -d ${D}/etc/dnsmasq.d
+    install -d ${D}${nonarch_base_libdir}/sysusers.d

install -m 0755 ${UNPACKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd
install -m 0644 ${UNPACKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf
-    install -d -m 0644 ${UNPACKDIR}/libvirt-qemu.conf ${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf
+    install -m 0644 ${UNPACKDIR}/libvirt-qemu.conf ${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf

if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then # This will wind up in the libvirtd package, but will NOT be invoked by default. --
2.43.0

#3 lore raw
Quoted 6 lines · Matthis Hauschild via lists.yoctoproject.org

Hi,

does that really solve your issue? With this patch applied, I run into the following build error because with the -d option, all arguments are treated as directories. So we should either use -D or create the directory accoring to the other created dirs in do_install

Quoted 7 lines

install: cannot create directory ‘/workdir/build/tmp/work/core2-64-wlanvm-linux/libvirt/v10.5.0+git/sources-unpack/libvirt-qemu.conf’: File exists
install: cannot create directory ‘/workdir/build/tmp/work/core2-64-wlanvm-linux/libvirt/v10.5.0+git/image/usr/lib/sysusers.d/libvirt-qemu.conf’: File exists

So I propose the following patch. Please let me know what you think.
Side note: This is my first contribution, I hope the format is correct, otherwise please let me know. I cannot use git send-email, so this is written from the webinterface. Best regards,
Matthis

This was my mistake, I had meant t push this to master-next, not master so my test loop didn't trigger!

This should indeed match the format of the other directory installs, since the combined command line is not universally supported.

The patch won't apply as it is in this email, but I'll make the change by hand and add your information to the commit log.

Bruce

Quoted 42 lines

Patch:

3902ac8844a9868ab14fa38b663d3832daa4b9de leads to the following build errors:
install: cannot create directory ‘{UNPACKDIR}/libvirt-qemu.conf’: File exists
install: cannot create directory ‘{D}/usr/lib/sysusers.d/libvirt-qemu.conf’: File exists because -d treats all arguments as directories. Create the required directory the same way as the other directories.

---
 recipes-extended/libvirt/libvirt_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
recipes-extended/libvirt/libvirt_git.bb +2 -2
index bef98b69..5c5a9b3f 100644
@@ -205,10 +205,11 @@ do_install:append() {
     install -d ${D}/etc/init.d
     install -d ${D}/etc/libvirt
     install -d ${D}/etc/dnsmasq.d
+    install -d ${D}${nonarch_base_libdir}/sysusers.d
 
     install -m 0755 ${UNPACKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd
     install -m 0644 ${UNPACKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf
-    install -d -m 0644 ${UNPACKDIR}/libvirt-qemu.conf ${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf
+    install -m 0644 ${UNPACKDIR}/libvirt-qemu.conf ${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf
 
     if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
         # This will wind up in the libvirtd package, but will NOT be invoked by default.
--

2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8908): https://lists.yoctoproject.org/g/meta-virtualization/message/8908
Mute This Topic: https://lists.yoctoproject.org/mt/108714337/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#4 lore raw
Quoted 29 lines · Bruce Ashfield via lists.yoctoproject.org
Quoted 4 lines · Matthis Hauschild via lists.yoctoproject.org

Hi,

does that really solve your issue? With this patch applied, I run into

the following build error because with the -d option, all arguments are treated as directories. So we should either use -D or create the directory accoring to the other created dirs in do_install

Quoted 3 lines

install: cannot create directory

‘/workdir/build/tmp/work/core2-64-wlanvm-linux/libvirt/v10.5.0+git/sources-unpack/libvirt-qemu.conf’:
File exists

Quoted 1 line

install: cannot create directory

‘/workdir/build/tmp/work/core2-64-wlanvm-linux/libvirt/v10.5.0+git/image/usr/lib/sysusers.d/libvirt-qemu.conf’:
File exists

Quoted 3 lines

So I propose the following patch. Please let me know what you think. Side note: This is my first contribution, I hope the format is correct,

otherwise please let me know. I cannot use git send-email, so this is written from the webinterface.

Quoted 2 lines

Best regards,
Matthis

This was my mistake, I had meant t push this to master-next, not master so my test loop didn't trigger!

Quoted 7 lines

This should indeed match the format of the other directory installs, since the
combined command line is not universally supported.

The patch won't apply as it is in this email, but I'll make the change by hand
and add your information to the commit log.

My bad as well. I didn’t test it well enough. Don’t send patches late at night?

Thank you for the fix Matthias! LGTM

Quoted 66 lines

Bruce

Quoted 6 lines

Patch:

3902ac8844a9868ab14fa38b663d3832daa4b9de leads to the following build errors:
install: cannot create directory ‘{UNPACKDIR}/libvirt-qemu.conf’: File

exists

Quoted 1 line

install: cannot create directory

‘{D}/usr/lib/sysusers.d/libvirt-qemu.conf’: File exists

Review

Quoted 7 lines

because -d treats all arguments as directories. Create the required directory the same way as the other directories.

---
 recipes-extended/libvirt/libvirt_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/recipes-extended/libvirt/libvirt_git.bb

recipes-extended/libvirt/libvirt_git.bb do_install:append() { · line 211

Quoted 11 lines

index bef98b69..5c5a9b3f 100644

recipes-extended/libvirt/libvirt_git.bb +1 -0
@@ -205,10 +205,11 @@ do_install:append() {
     install -d ${D}/etc/init.d
     install -d ${D}/etc/libvirt
     install -d ${D}/etc/dnsmasq.d
+    install -d ${D}${nonarch_base_libdir}/sysusers.d
 
     install -m 0755 ${UNPACKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd
     install -m 0644 ${UNPACKDIR}/libvirtd.conf

${D}/etc/libvirt/libvirtd.conf

recipes-extended/libvirt/libvirt_git.bb do_install:append() { · line 211

Quoted 1 line
recipes-extended/libvirt/libvirt_git.bb +0 -1
-    install -d -m 0644 ${UNPACKDIR}/libvirt-qemu.conf

${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf

recipes-extended/libvirt/libvirt_git.bb do_install:append() { · line 212

Quoted 1 line
recipes-extended/libvirt/libvirt_git.bb +1 -0
+    install -m 0644 ${UNPACKDIR}/libvirt-qemu.conf

${D}${nonarch_base_libdir}/sysusers.d/libvirt-qemu.conf

recipes-extended/libvirt/libvirt_git.bb do_install:append() { · line 213

Quoted 2 lines
recipes-extended/libvirt/libvirt_git.bb +0 -0
     if

${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then

recipes-extended/libvirt/libvirt_git.bb do_install:append() { · line 214

Quoted 1 line
recipes-extended/libvirt/libvirt_git.bb +0 -0
         # This will wind up in the libvirtd package, but will NOT be

invoked by default.

Quoted 6 lines
recipes-extended/libvirt/libvirt_git.bb +0 -1
--

2.43.0

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#8909):
https://lists.yoctoproject.org/g/meta-virtualization/message/8909
Mute This Topic: https://lists.yoctoproject.org/mt/108714337/924729
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-