Skip to contentSkip to conversation

sanity-meta-security.bbclass: allow warning customization

PATCH In review [email protected] 2 participants 4 messages Feb 15, 2024 – Feb 21, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sanity-meta-security.bbclass: allow warning customization

From: Joe Slater <[email protected]>

Introduce META_SECURITY_SANITY_CHECK_WARNING variable which can be overridden, if desired.

---
 classes/sanity-meta-security.bbclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
classes/sanity-meta-security.bbclass +9 -4
index f9e2698..95180aa 100644
@@ -1,10 +1,15 @@
 addhandler security_bbappend_distrocheck
 security_bbappend_distrocheck[eventmask] = "bb.event.SanityCheck"
+
 python security_bbappend_distrocheck() {
     skip_check = e.data.getVar('SKIP_META_SECURITY_SANITY_CHECK') == "1"
     if 'security' not in e.data.getVar('DISTRO_FEATURES').split() and not skip_check:
-        bb.warn("You have included the meta-security layer, but \
-'security' has not been enabled in your DISTRO_FEATURES. Some bbappend files \
-and preferred version setting may not take effect. See the meta-security README \
-for details on enabling security support.")
+        bb.warn(e.data.getVar('META_SECURITY_SANITY_CHECK_WARNING'))
 }
+
+META_SECURITY_SANITY_CHECK_WARNING ??= "\
+You have included the meta-security layer, but 'security' has not been \
+enabled in your DISTRO_FEATURES. Some bbappend files and preferred version \
+settings may not take effect. See the meta-security README for details on \
+enabling security support."
+
Signature · 1 line
2.25.1
#1 lore raw
Quoted 5 lines · Joe Slater via lists.yoctoproject.org

From: Joe Slater <[email protected]>

Introduce META_SECURITY_SANITY_CHECK_WARNING variable which can be overridden, if desired.

The existence of the patch implies that there's a reason why the warning message isn't appropriate for your use case.

That's something that should be explained in the patch.

A knob to disable the warning if you know what you are doing has already been provided. So again, this patch implies that you want the warning, but want to change the message .. it would be good to understand why.

Bruce

Quoted 42 lines
---
 classes/sanity-meta-security.bbclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
classes/sanity-meta-security.bbclass +9 -5
index f9e2698..95180aa 100644
@@ -1,10 +1,15 @@
 addhandler security_bbappend_distrocheck
 security_bbappend_distrocheck[eventmask] = "bb.event.SanityCheck"
+
 python security_bbappend_distrocheck() {
     skip_check = e.data.getVar('SKIP_META_SECURITY_SANITY_CHECK') == "1"
     if 'security' not in e.data.getVar('DISTRO_FEATURES').split() and not skip_check:
-        bb.warn("You have included the meta-security layer, but \
-'security' has not been enabled in your DISTRO_FEATURES. Some bbappend files \
-and preferred version setting may not take effect. See the meta-security README \
-for details on enabling security support.")
+        bb.warn(e.data.getVar('META_SECURITY_SANITY_CHECK_WARNING'))
 }
+
+META_SECURITY_SANITY_CHECK_WARNING ??= "\
+You have included the meta-security layer, but 'security' has not been \
+enabled in your DISTRO_FEATURES. Some bbappend files and preferred version \
+settings may not take effect. See the meta-security README for details on \
+enabling security support."
+
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#62497): https://lists.yoctoproject.org/g/yocto/message/62497
Mute This Topic: https://lists.yoctoproject.org/mt/104377037/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/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
#2 lore raw
Quoted 21 lines

-----Original Message-----
From: Bruce Ashfield <[email protected]>
Sent: Thursday, February 15, 2024 9:57 AM
To: [email protected]; Slater, Joseph <[email protected]>
Cc: MacLeod, Randy <[email protected]>
Subject: Re: [yocto] [meta-security][PATCH 1/1] sanity-meta-security.bbclass:
allow warning customization

Quoted 5 lines · Joe Slater via lists.yoctoproject.org

From: Joe Slater <[email protected]>

Introduce META_SECURITY_SANITY_CHECK_WARNING variable which can be overridden, if desired.

The existence of the patch implies that there's a reason why the warning message isn't appropriate for your use case.

Quoted 7 lines

That's something that should be explained in the patch.

A knob to disable the warning if you know what you are doing has already been provided. So again, this patch implies that you want the warning, but want to change the message .. it would be good to understand why.

Bruce

Some people want to know how to disable the warning without reading the README. I don't think that's a great idea, but allowing customization would let that be done on a distro or similar basis. I didn't want to mention that stuff in a commit message, but maybe it should be there.

Joe

Quoted 54 lines
Quoted 14 lines
---
 classes/sanity-meta-security.bbclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
classes/sanity-meta-security.bbclass +0 -0
index f9e2698..95180aa 100644
@@ -1,10 +1,15 @@
 addhandler security_bbappend_distrocheck
Quoted 5 lines

security_bbappend_distrocheck[eventmask] = "bb.event.SanityCheck" +
python security_bbappend_distrocheck() {
skip_check = e.data.getVar('SKIP_META_SECURITY_SANITY_CHECK') == "1" if 'security' not in e.data.getVar('DISTRO_FEATURES').split() and not

skip_check:

Quoted 18 lines

- bb.warn("You have included the meta-security layer, but \
-'security' has not been enabled in your DISTRO_FEATURES. Some bbappend files \ -and preferred version setting may not take effect. See the meta-security README \ -for details on enabling security support.")

classes/sanity-meta-security.bbclass +8 -1
+        bb.warn(e.data.getVar('META_SECURITY_SANITY_CHECK_WARNING'))
 }
+
+META_SECURITY_SANITY_CHECK_WARNING ??= "\ You have included the
+meta-security layer, but 'security' has not been \ enabled in your
+DISTRO_FEATURES. Some bbappend files and preferred version \ settings
+may not take effect. See the meta-security README for details on \
+enabling security support."
+
--

2.25.1

Quoted 10 lines

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

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

#3 lore raw
Quoted 24 lines · Joseph
Quoted 24 lines

-----Original Message-----
From: Bruce Ashfield <[email protected]>
Sent: Thursday, February 15, 2024 9:57 AM
To: [email protected]; Slater, Joseph <[email protected]>
Cc: MacLeod, Randy <[email protected]>
Subject: Re: [yocto] [meta-security][PATCH 1/1] sanity-meta-security.bbclass:
allow warning customization

Quoted 5 lines · Joe Slater via lists.yoctoproject.org

From: Joe Slater <[email protected]>

Introduce META_SECURITY_SANITY_CHECK_WARNING variable which can be overridden, if desired.

The existence of the patch implies that there's a reason why the warning message isn't appropriate for your use case.

That's something that should be explained in the patch.

Quoted 7 lines
Quoted 5 lines

A knob to disable the warning if you know what you are doing has already been provided. So again, this patch implies that you want the warning, but want to change the message .. it would be good to understand why.

Bruce

Some people want to know how to disable the warning without reading the README. I don't think that's a great idea, but allowing customization would let that be done on a distro or similar basis. I didn't want to mention that stuff in a commit message, but maybe it should be there.

Things like that should always be mentioned in a commit message.

Technical parts of the changes can be understood by looking at the commit, the why is the important part.

I wouldn't allow this to be tweaked in my layers, since it opens the door for incorrect information to be injected into the layer's warning, but that decision is up to the layer maintainer :)

Bruce

Quoted 57 lines

Joe

Quoted 54 lines
Quoted 14 lines
---
 classes/sanity-meta-security.bbclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
classes/sanity-meta-security.bbclass +0 -0
index f9e2698..95180aa 100644
@@ -1,10 +1,15 @@
 addhandler security_bbappend_distrocheck
Quoted 5 lines

security_bbappend_distrocheck[eventmask] = "bb.event.SanityCheck" +
python security_bbappend_distrocheck() {
skip_check = e.data.getVar('SKIP_META_SECURITY_SANITY_CHECK') == "1" if 'security' not in e.data.getVar('DISTRO_FEATURES').split() and not

skip_check:

Quoted 18 lines

- bb.warn("You have included the meta-security layer, but \
-'security' has not been enabled in your DISTRO_FEATURES. Some bbappend files \ -and preferred version setting may not take effect. See the meta-security README \ -for details on enabling security support.")

classes/sanity-meta-security.bbclass +8 -1
+        bb.warn(e.data.getVar('META_SECURITY_SANITY_CHECK_WARNING'))
 }
+
+META_SECURITY_SANITY_CHECK_WARNING ??= "\ You have included the
+meta-security layer, but 'security' has not been \ enabled in your
+DISTRO_FEATURES. Some bbappend files and preferred version \ settings
+may not take effect. See the meta-security README for details on \
+enabling security support."
+
--

2.25.1

Quoted 10 lines

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

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

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