Skip to contentSkip to conversation

core-image.bbclass: add default IMAGE_QA_PROHIBIT_PATHS variable

PATCH Martyn Welch 3 participants 6 messages Oct 26, 2021 – Oct 27, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Note to self - remember to reply to list...

-------- Forwarded Message --------
From: Martyn Welch <[email protected]>
To: Konrad Weihmann <[email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default IMAGE_QA_PROHIBIT_PATHS variable
Date: Tue, 26 Oct 2021 12:12:11 +0100

Quoted 10 lines · Konrad Weihmann
Quoted 7 lines · Martyn Welch

From: Martyn Welch <[email protected]>

Add a default IMAGE_QA_PROHIBIT_PATHS variable containing paths known to
be mounted in the default fstab, which are known mount points or directories which should be populated at runtime.

Quoted 4 lines
Quoted 1 line

That can't be true - or the initial idea is very very old :-) pls use Alex's gmail instead

It's a very old patch series, originally posted in 2017 (as mentioned in patch 1/2). Just noticed it never got applied...

Quoted 4 lines
Quoted 4 lines
(quoted diff) +2 -0
+# IMAGE_QA_PROHIBITED_PATHS
+# Ensure images aren't including files in places that will be used

as mount points or that are
+# reserved for runtime data.

Quoted 8 lines
Quoted 3 lines

+IMAGE_QA_PROHIBITED_PATHS ?= "/dev/pts/*:/media/*:/mnt/*:/proc/*:/run/*:/tmp/*:/var/run/*:/var/t mp/*:/var/volatile/*"

I like the idea, but wouldn't make more sense to do that on a package level, as here the user is more or less left alone in guessing where the
file actually does come from

I like that idea, however it would make to assumption that there wasn't any tweaks being made as part of image generation that would end up violating this. A quick check suggests the "build-appliance- image_15.0.0.bb" image does this kind of thing in the core image types.

Martyn

#2 lore raw
Quoted 41 lines · Martyn Welch

Note to self - remember to reply to list...

-------- Forwarded Message --------
From: Martyn Welch <[email protected]>
To: Konrad Weihmann <[email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default IMAGE_QA_PROHIBIT_PATHS variable
Date: Tue, 26 Oct 2021 12:12:11 +0100

Quoted 10 lines · Konrad Weihmann
Quoted 7 lines · Martyn Welch

From: Martyn Welch <[email protected]>

Add a default IMAGE_QA_PROHIBIT_PATHS variable containing paths known to
be mounted in the default fstab, which are known mount points or directories which should be populated at runtime.

Quoted 4 lines
Quoted 1 line

That can't be true - or the initial idea is very very old :-) pls use Alex's gmail instead

It's a very old patch series, originally posted in 2017 (as mentioned in patch 1/2). Just noticed it never got applied...

Quoted 4 lines
Quoted 4 lines
(quoted diff) +2 -0
+# IMAGE_QA_PROHIBITED_PATHS
+# Ensure images aren't including files in places that will be used

as mount points or that are
+# reserved for runtime data.

Quoted 8 lines
Quoted 3 lines

+IMAGE_QA_PROHIBITED_PATHS ?= "/dev/pts/*:/media/*:/mnt/*:/proc/*:/run/*:/tmp/*:/var/run/*:/var/t mp/*:/var/volatile/*"

I like the idea, but wouldn't make more sense to do that on a package level, as here the user is more or less left alone in guessing where the
file actually does come from

Quoted 5 lines

I like that idea, however it would make to assumption that there wasn't any tweaks being made as part of image generation that would end up violating this. A quick check suggests the "build-appliance- image_15.0.0.bb" image does this kind of thing in the core image types.

As Alex just wrote, I might be beneficial to do both

Quoted 12 lines

Martyn

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#157387): https://lists.openembedded.org/g/openembedded-core/message/157387
Mute This Topic: https://lists.openembedded.org/mt/86599458/3647476
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
Quoted 49 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Konrad Weihmann
Sent: den 26 oktober 2021 13:24
To: Martyn Welch <[email protected]>; OE-core <openembedded- [email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default IMAGE_QA_PROHIBIT_PATHS variable

Quoted 37 lines · Martyn Welch

Note to self - remember to reply to list...

-------- Forwarded Message --------
From: Martyn Welch <[email protected]>
To: Konrad Weihmann <[email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default IMAGE_QA_PROHIBIT_PATHS variable
Date: Tue, 26 Oct 2021 12:12:11 +0100

Quoted 10 lines · Konrad Weihmann
Quoted 7 lines · Martyn Welch

From: Martyn Welch <[email protected]>

Add a default IMAGE_QA_PROHIBIT_PATHS variable containing paths known to
be mounted in the default fstab, which are known mount points or directories which should be populated at runtime.

Quoted 4 lines
Quoted 1 line

That can't be true - or the initial idea is very very old :-) pls use Alex's gmail instead

It's a very old patch series, originally posted in 2017 (as mentioned in patch 1/2). Just noticed it never got applied...

Quoted 8 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+# IMAGE_QA_PROHIBITED_PATHS
+# Ensure images aren't including files in places that will be used as mount points or that are
+# reserved for runtime data.
+IMAGE_QA_PROHIBITED_PATHS ?= "/dev/pts/*:/media/*:/mnt/*:/proc/*:/run/*:/tmp/*:/var/run/*:/var/tmp/*:/var/volatile/*"

I like the idea, but wouldn't make more sense to do that on a package level, as here the user is more or less left alone in guessing where the file actually does come from

Quoted 8 lines
Quoted 4 lines

I like that idea, however it would make to assumption that there wasn't any tweaks being made as part of image generation that would end up violating this. A quick check suggests the "build-appliance- image_15.0.0.bb" image does this kind of thing in the core image types.

As Alex just wrote, I might be beneficial to do both

Quoted 1 line

Martyn

We have an alternative solution that hooks into the package QA. It focuses on directories that are supposed to be empty. In addition to failing the build if there are files in such a directory, it also allows to specify for each directory why it should be empty. We have used this, e.g., to mark common directories that have been renamed to give an indication of where the files were supposed to have been installed.

Do you want me to generalize this and send a patch for it?

//Peter

#4 lore raw
Quoted 28 lines · Peter Kjellerstedt
Quoted 28 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Konrad Weihmann
Sent: den 26 oktober 2021 13:24
To: Martyn Welch <[email protected]>; OE-core <openembedded-
[email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default
IMAGE_QA_PROHIBIT_PATHS variable

Quoted 14 lines · Martyn Welch

Note to self - remember to reply to list...

-------- Forwarded Message --------
From: Martyn Welch <[email protected]>
To: Konrad Weihmann <[email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default
IMAGE_QA_PROHIBIT_PATHS variable
Date: Tue, 26 Oct 2021 12:12:11 +0100

Quoted 3 lines · Konrad Weihmann

On 26.10.21 12:50, Martyn Welch wrote:

<snip>

Quoted 34 lines
Quoted 22 lines
Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
(quoted diff) +2 -0
+# IMAGE_QA_PROHIBITED_PATHS
+# Ensure images aren't including files in places that will

be used as mount points or that are

(quoted diff) +2 -0
+# reserved for runtime data.
+IMAGE_QA_PROHIBITED_PATHS ?=
Quoted 8 lines
Quoted 2 lines

"/dev/pts/*:/media/*:/mnt/*:/proc/*:/run/*:/tmp/*:/var/run/*:
/var/tmp/*:/var/volatile/*"

I like the idea, but wouldn't make more sense to do that on a package
level, as here the user is more or less left alone in guessing where
the file actually does come from

Quoted 7 lines

I like that idea, however it would make to assumption that there wasn't
any tweaks being made as part of image generation that would end up
violating this. A quick check suggests the "build-appliance- image_15.0.0.bb" image does this kind of thing in the core image types.

Quoted 3 lines

As Alex just wrote, I might be beneficial to do both

Quoted 1 line

Martyn

We have an alternative solution that hooks into the package QA. It focuses on directories that are supposed to be empty. In addition to failing the build if there are files in such a directory, it also allows to specify for each directory why it should be empty. We have used this, e.g., to mark common directories that have been renamed to give an indication of where the files were supposed to have been installed.

Quoted 2 lines

Do you want me to generalize this and send a patch for it?

Hi Peter,

It would be great if we could merge these approaches, i.e. have one way to specify directories that need to be empty and test both as part of package QA and also image QA.

I was just working on adding some package QA support to what I've had, but can pause that.

Would you be able to provide show how you'd propose managing the prohibited directories? I'll try and tweak the image QA stuff already posted to fit that.

Martyn

Quoted 14 lines

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#157397):
https://lists.openembedded.org/g/openembedded-core/message/157397
Mute This Topic: https://lists.openembedded.org/mt/86599458/6512429
Group Owner: [email protected] Unsubscribe:
https://lists.openembedded.org/g/openembedded-core/unsub [
[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw
Quoted 83 lines

-----Original Message-----
From: Martyn Welch <[email protected]>
Sent: den 26 oktober 2021 17:32
To: Peter Kjellerstedt <[email protected]>; Konrad Weihmann <[email protected]>; OE-core <openembedded- [email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default IMAGE_QA_PROHIBIT_PATHS variable

Quoted 28 lines · Peter Kjellerstedt
Quoted 28 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Konrad Weihmann
Sent: den 26 oktober 2021 13:24
To: Martyn Welch <[email protected]>; OE-core <openembedded-
[email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default
IMAGE_QA_PROHIBIT_PATHS variable

Quoted 14 lines · Martyn Welch

Note to self - remember to reply to list...

-------- Forwarded Message --------
From: Martyn Welch <[email protected]>
To: Konrad Weihmann <[email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default
IMAGE_QA_PROHIBIT_PATHS variable
Date: Tue, 26 Oct 2021 12:12:11 +0100

Quoted 3 lines · Konrad Weihmann

On 26.10.21 12:50, Martyn Welch wrote:

<snip>

Quoted 34 lines
Quoted 22 lines
Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
(quoted diff) +2 -0
+# IMAGE_QA_PROHIBITED_PATHS
+# Ensure images aren't including files in places that will

be used as mount points or that are

(quoted diff) +2 -0
+# reserved for runtime data.
+IMAGE_QA_PROHIBITED_PATHS ?=
Quoted 8 lines
Quoted 2 lines

"/dev/pts/*:/media/*:/mnt/*:/proc/*:/run/*:/tmp/*:/var/run/*:
/var/tmp/*:/var/volatile/*"

I like the idea, but wouldn't make more sense to do that on a package
level, as here the user is more or less left alone in guessing where
the file actually does come from

Quoted 7 lines

I like that idea, however it would make to assumption that there wasn't
any tweaks being made as part of image generation that would end up
violating this. A quick check suggests the "build-appliance- image_15.0.0.bb" image does this kind of thing in the core image types.

Quoted 3 lines

As Alex just wrote, I might be beneficial to do both

Quoted 1 line

Martyn

We have an alternative solution that hooks into the package QA. It focuses on directories that are supposed to be empty. In addition to failing the build if there are files in such a directory, it also allows to specify for each directory why it should be empty. We have used this, e.g., to mark common directories that have been renamed to give an indication of where the files were supposed to have been installed.

Quoted 1 line

Do you want me to generalize this and send a patch for it?

Hi Peter,

It would be great if we could merge these approaches, i.e. have one way to specify directories that need to be empty and test both as part of package QA and also image QA.

Quoted 10 lines

I was just working on adding some package QA support to what I've had, but can pause that.

Would you be able to provide show how you'd propose managing the prohibited directories? I'll try and tweak the image QA stuff already posted to fit that.

Martyn

Quoted 1 line

//Peter

I have sent two patches now. The first makes systemd not install anything in /var/log, as it otherwise conflicts with the suggested defaults. And then one patch that adds the package QA check for empty directories. I used the same defaults as suggested in your patch, except I removed /mnt since it is not obvious it should be empty. At least we use subdirectories in /mnt for our mountpoints.

//Peter

#6 lore raw
Quoted 110 lines · Peter Kjellerstedt
Quoted 110 lines

-----Original Message-----
From: Martyn Welch <[email protected]>
Sent: den 26 oktober 2021 17:32
To: Peter Kjellerstedt <[email protected]>; Konrad Weihmann
<[email protected]>; OE-core <openembedded- [email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default
IMAGE_QA_PROHIBIT_PATHS variable

Quoted 28 lines · Peter Kjellerstedt
Quoted 28 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Konrad Weihmann
Sent: den 26 oktober 2021 13:24
To: Martyn Welch <[email protected]>; OE-core <openembedded-
[email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default
IMAGE_QA_PROHIBIT_PATHS variable

Quoted 14 lines · Martyn Welch

Note to self - remember to reply to list...

-------- Forwarded Message --------
From: Martyn Welch <[email protected]>
To: Konrad Weihmann <[email protected]>
Subject: Re: [OE-core] [PATCH v6 2/2] core-image.bbclass: add default
IMAGE_QA_PROHIBIT_PATHS variable
Date: Tue, 26 Oct 2021 12:12:11 +0100

Quoted 3 lines · Konrad Weihmann

On 26.10.21 12:50, Martyn Welch wrote:

<snip>

Quoted 46 lines
Quoted 29 lines
Quoted 18 lines
Quoted 10 lines
Quoted 9 lines
(quoted diff) +2 -0
+# IMAGE_QA_PROHIBITED_PATHS
+# Ensure images aren't including files in places that

will
be used as mount points or that are

(quoted diff) +2 -0
+# reserved for runtime data.
+IMAGE_QA_PROHIBITED_PATHS ?=

"/dev/pts/*:/media/*:/mnt/*:/proc/*:/run/*:/tmp/*:/var/ru n/*:
/var/tmp/*:/var/volatile/*"

Quoted 7 lines

I like the idea, but wouldn't make more sense to do that on a
package
level, as here the user is more or less left alone in guessing
where
the file actually does come from

Quoted 10 lines

I like that idea, however it would make to assumption that there
wasn't
any tweaks being made as part of image generation that would end
up
violating this. A quick check suggests the "build-appliance- image_15.0.0.bb" image does this kind of thing in the core image
types.

Quoted 3 lines

As Alex just wrote, I might be beneficial to do both

Quoted 1 line

Martyn

We have an alternative solution that hooks into the package QA. It
focuses on directories that are supposed to be empty. In addition to
failing the build if there are files in such a directory, it also allows to specify for each directory why it should be empty. We have
used this, e.g., to mark common directories that have been renamed
to give an indication of where the files were supposed to have been
installed.

Quoted 1 line

Do you want me to generalize this and send a patch for it?

Hi Peter,

It would be great if we could merge these approaches, i.e. have one way
to specify directories that need to be empty and test both as part of
package QA and also image QA.

I was just working on adding some package QA support to what I've had,
but can pause that.

Would you be able to provide show how you'd propose managing the prohibited directories? I'll try and tweak the image QA stuff already
posted to fit that.

Martyn

Quoted 9 lines
Quoted 1 line
Quoted 1 line

//Peter

I have sent two patches now. The first makes systemd not install anything in /var/log, as it otherwise conflicts with the suggested defaults. And then one patch that adds the package QA check for empty directories. I used the same defaults as suggested in your patch, except I removed /mnt since it is not obvious it should be empty. At least we use subdirectories in /mnt for our mountpoints.

Thanks Peter,

Looks good to me. I'll adapt the mine to be an image QA test that complements this.

Martyn

Quoted 2 lines

//Peter