meta-virtualization.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libvirt: do not install /var/log for target
@ 2021-11-12  3:23 kai
  2021-11-12  4:03 ` [meta-virtualization] " Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: kai @ 2021-11-12  3:23 UTC (permalink / raw)
  To: meta-virtualization

From: Kai Kang <kai.kang@windriver.com>

/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]

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 recipes-extended/libvirt/libvirt_7.2.0.bb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/recipes-extended/libvirt/libvirt_7.2.0.bb b/recipes-extended/libvirt/libvirt_7.2.0.bb
index b7f8383a..b49bd11a 100644
--- a/recipes-extended/libvirt/libvirt_7.2.0.bb
+++ b/recipes-extended/libvirt/libvirt_7.2.0.bb
@@ -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
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [meta-virtualization] [PATCH] libvirt: do not install /var/log for target
  2021-11-12  3:23 [PATCH] libvirt: do not install /var/log for target kai
@ 2021-11-12  4:03 ` Bruce Ashfield
  2021-11-12  4:49   ` kai
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Ashfield @ 2021-11-12  4:03 UTC (permalink / raw)
  To: kai; +Cc: meta-virtualization

On Thu, Nov 11, 2021 at 10:23 PM kai <kai.kang@windriver.com> wrote:
>
> From: Kai Kang <kai.kang@windriver.com>
>
> /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]
>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  recipes-extended/libvirt/libvirt_7.2.0.bb | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/recipes-extended/libvirt/libvirt_7.2.0.bb b/recipes-extended/libvirt/libvirt_7.2.0.bb
> index b7f8383a..b49bd11a 100644
> --- a/recipes-extended/libvirt/libvirt_7.2.0.bb
> +++ b/recipes-extended/libvirt/libvirt_7.2.0.bb
> @@ -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

> +
>         # 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
>
>
> 
>


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-virtualization] [PATCH] libvirt: do not install /var/log for target
  2021-11-12  4:03 ` [meta-virtualization] " Bruce Ashfield
@ 2021-11-12  4:49   ` kai
  2021-11-12 15:36     ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: kai @ 2021-11-12  4:49 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization

On 11/12/21 12:03 PM, Bruce Ashfield wrote:
> On Thu, Nov 11, 2021 at 10:23 PM kai <kai.kang@windriver.com> wrote:
>> From: Kai Kang <kai.kang@windriver.com>
>>
>> /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]
>>
>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>> ---
>>   recipes-extended/libvirt/libvirt_7.2.0.bb | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/recipes-extended/libvirt/libvirt_7.2.0.bb b/recipes-extended/libvirt/libvirt_7.2.0.bb
>> index b7f8383a..b49bd11a 100644
>> --- a/recipes-extended/libvirt/libvirt_7.2.0.bb
>> +++ b/recipes-extended/libvirt/libvirt_7.2.0.bb
>> @@ -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.

OK.I'll figure out.

Regards,
Kai

>
> Bruce
>
>> +
>>          # 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-virtualization] [PATCH] libvirt: do not install /var/log for target
  2021-11-12  4:49   ` kai
@ 2021-11-12 15:36     ` Bruce Ashfield
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce Ashfield @ 2021-11-12 15:36 UTC (permalink / raw)
  To: Kai; +Cc: meta-virtualization

On Thu, Nov 11, 2021 at 11:49 PM Kai <kai.kang@windriver.com> wrote:
>
> On 11/12/21 12:03 PM, Bruce Ashfield wrote:
> > On Thu, Nov 11, 2021 at 10:23 PM kai <kai.kang@windriver.com> wrote:
> >> From: Kai Kang <kai.kang@windriver.com>
> >>
> >> /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]
> >>
> >> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> >> ---
> >>   recipes-extended/libvirt/libvirt_7.2.0.bb | 4 ++++
> >>   1 file changed, 4 insertions(+)
> >>
> >> diff --git a/recipes-extended/libvirt/libvirt_7.2.0.bb b/recipes-extended/libvirt/libvirt_7.2.0.bb
> >> index b7f8383a..b49bd11a 100644
> >> --- a/recipes-extended/libvirt/libvirt_7.2.0.bb
> >> +++ b/recipes-extended/libvirt/libvirt_7.2.0.bb
> >> @@ -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.
>
> 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

>
> Regards,
> Kai
>
> >
> > Bruce
> >
> >> +
> >>          # 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
>


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-12 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12  3:23 [PATCH] libvirt: do not install /var/log for target kai
2021-11-12  4:03 ` [meta-virtualization] " Bruce Ashfield
2021-11-12  4:49   ` kai
2021-11-12 15:36     ` Bruce Ashfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).