Skip to contentSkip to conversation

libvirt: do not install /var/log for target

PATCH In review kai 2 participants 4 messages Nov 12, 2021

lore
Share & tools
lore

kai

author
#0 lore raw

PATCH 1/1 libvirt: do not install /var/log for target

From: Kai Kang <[email protected]>

/var/log is normally a link to /var/volatile/log and /var/volatile is a tmpfs mount. So anything created in /var/log will not be available when the tmpfs is mounted.

Not install /var/log to avoid 'empty-dirs' qa issue:

| ERROR: libvirt-7.2.0-r0 do_package_qa: QA Issue: libvirt installs files in
/var/volatile, but it is expected to be empty [empty-dirs]

---
 recipes-extended/libvirt/libvirt_7.2.0.bb | 4 ++++
 1 file changed, 4 insertions(+)
recipes-extended/libvirt/libvirt_7.2.0.bb +4 -0
index b7f8383a..b49bd11a 100644
@@ -232,6 +232,10 @@ do_install:append() {
 	echo "d root root 0755 /run/libvirt/qemu none" \
 	     >> ${D}${sysconfdir}/default/volatiles/99_libvirt
 
+	# /var/log is normally a link to /var/volatile/log
+	# and /var/volatile is a tmpfs mount which should be clean.
+	rm -rf ${D}${localstatedir}/log
+
 	# Manually set permissions and ownership to match polkit recipe
 	if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
 		install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d
Signature · 1 line
2.33.0
#1 lore raw
Quoted 22 lines · kai

From: Kai Kang <[email protected]>

/var/log is normally a link to /var/volatile/log and /var/volatile is a tmpfs mount. So anything created in /var/log will not be available when the tmpfs is mounted.

Not install /var/log to avoid 'empty-dirs' qa issue:

| ERROR: libvirt-7.2.0-r0 do_package_qa: QA Issue: libvirt installs files in
/var/volatile, but it is expected to be empty [empty-dirs]

---
 recipes-extended/libvirt/libvirt_7.2.0.bb | 4 ++++
 1 file changed, 4 insertions(+)
recipes-extended/libvirt/libvirt_7.2.0.bb +0 -0
index b7f8383a..b49bd11a 100644

recipes-extended/libvirt/libvirt_7.2.0.bb do_install:append() { · line 237

Quoted 6 lines
recipes-extended/libvirt/libvirt_7.2.0.bb +3 -0
@@ -232,6 +232,10 @@ do_install:append() {
        echo "d root root 0755 /run/libvirt/qemu none" \
             >> ${D}${sysconfdir}/default/volatiles/99_libvirt
 
+       # /var/log is normally a link to /var/volatile/log
+       # and /var/volatile is a tmpfs mount which should be clean.
+       rm -rf ${D}${localstatedir}/log

We should be preventing the install from happening at all, not deleting it after the fact.

If libvirt thinks something needs to be in the directory, then we should be looking into why it does exactly that.

Bruce

Quoted 10 lines
recipes-extended/libvirt/libvirt_7.2.0.bb +1 -1
+
        # Manually set permissions and ownership to match polkit recipe
        if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
                install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d
--

2.33.0

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
author
#2 lore raw
Quoted 25 lines · Bruce Ashfield
Quoted 24 lines · kai

From: Kai Kang <[email protected]>

/var/log is normally a link to /var/volatile/log and /var/volatile is a tmpfs mount. So anything created in /var/log will not be available when the tmpfs is mounted.

Not install /var/log to avoid 'empty-dirs' qa issue:

| ERROR: libvirt-7.2.0-r0 do_package_qa: QA Issue: libvirt installs files in
/var/volatile, but it is expected to be empty [empty-dirs]

---
  recipes-extended/libvirt/libvirt_7.2.0.bb | 4 ++++
  1 file changed, 4 insertions(+)
recipes-extended/libvirt/libvirt_7.2.0.bb +0 -0
index b7f8383a..b49bd11a 100644
@@ -232,6 +232,10 @@ do_install:append() {
         echo "d root root 0755 /run/libvirt/qemu none" \
              >> ${D}${sysconfdir}/default/volatiles/99_libvirt
 
Quoted 8 lines

recipes-extended/libvirt/libvirt_7.2.0.bb do_install:append() { · line 237

Quoted 3 lines
recipes-extended/libvirt/libvirt_7.2.0.bb +3 -0
+       # /var/log is normally a link to /var/volatile/log
+       # and /var/volatile is a tmpfs mount which should be clean.
+       rm -rf ${D}${localstatedir}/log

We should be preventing the install from happening at all, not deleting it after the fact.

If libvirt thinks something needs to be in the directory, then we should be looking into why it does exactly that.

OK.I'll figure out.

Regards,
Kai

Quoted 14 lines

Bruce

Quoted 10 lines
recipes-extended/libvirt/libvirt_7.2.0.bb +1 -1
+
         # Manually set permissions and ownership to match polkit recipe
         if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
                 install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d
--

2.33.0

Signature · 2 lines
Kai Kang
Wind River Linux
#3 lore raw
Quoted 33 lines · Kai
Quoted 31 lines · Bruce Ashfield
Quoted 21 lines · kai

From: Kai Kang <[email protected]>

/var/log is normally a link to /var/volatile/log and /var/volatile is a tmpfs mount. So anything created in /var/log will not be available when the tmpfs is mounted.

Not install /var/log to avoid 'empty-dirs' qa issue:

| ERROR: libvirt-7.2.0-r0 do_package_qa: QA Issue: libvirt installs files in
/var/volatile, but it is expected to be empty [empty-dirs]

---
  recipes-extended/libvirt/libvirt_7.2.0.bb | 4 ++++
  1 file changed, 4 insertions(+)
recipes-extended/libvirt/libvirt_7.2.0.bb +0 -0
index b7f8383a..b49bd11a 100644

recipes-extended/libvirt/libvirt_7.2.0.bb do_install:append() { · line 237

Quoted 6 lines
recipes-extended/libvirt/libvirt_7.2.0.bb +3 -0
@@ -232,6 +232,10 @@ do_install:append() {
         echo "d root root 0755 /run/libvirt/qemu none" \
              >> ${D}${sysconfdir}/default/volatiles/99_libvirt
 
+       # /var/log is normally a link to /var/volatile/log
+       # and /var/volatile is a tmpfs mount which should be clean.
+       rm -rf ${D}${localstatedir}/log

We should be preventing the install from happening at all, not deleting it after the fact.

Quoted 4 lines
Quoted 2 lines

If libvirt thinks something needs to be in the directory, then we should be looking into why it does exactly that.

OK.I'll figure out.

I poked around at this myself, and then asked Ross to help me out .. I assumed it was meson doing this, and he pointed out the right meson.build files to me.

I'm trying to figure out how to balance some non volatile use cases, with this new QA check. If we universally delete those files, then those cases are broken.

I'm leaning towards leaving the directories in place, and just inhibiting the QA check.

Bruce

Quoted 23 lines

Regards,
Kai

Quoted 14 lines

Bruce

Quoted 10 lines
recipes-extended/libvirt/libvirt_7.2.0.bb +1 -1
+
         # Manually set permissions and ownership to match polkit recipe
         if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
                 install -d -m 0700 ${D}/${datadir}/polkit-1/rules.d
--

2.33.0

--
Kai Kang
Wind River Linux

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