Sometimes we wish to ensure that files or directories are not installed
somewhere that may prove detrimental to the operation of the system. For
example, this may be the case if files are placed in a directory that is
utilised as a mount point at run time, thus making them inaccessible once
when the mount point is being utilised.
Implement the prohibited paths QA test, which enables such locations to be
specified in a "PROHIBITED_PATHS" variable. This implementation allows for
a colon separated list of paths to be provided. Shell style wildcards can
be used.
Signed-off-by: Fabien Lahoudere <redacted>
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
---
Changes since v1:
- Correcting author and SOB.
Changes since v2:
- Reimplemented as image rather than package level QA test.
- Changed variable from PROHIBITED_PATH to PROHIBITED_PATHS to better
reflect its use.
meta/classes/image.bbclass | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
Add documentation for the PROHIBITED_PATHS variable and associated
prohibited-path QA test
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
---
Changes since v1:
- Correcting author and SOB.
Changes since v2:
- Reimplemented as image rather than package level QA test, altering
documentation to suit.
- Changed variable from PROHIBITED_PATH to PROHIBITED_PATHS to better
reflect its use.
documentation/ref-manual/ref-variables.xml | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
== Series Details ==
Series: "[v3] image.bbclass: add prohib..." and 1 more
Revision: 1
URL : https://patchwork.openembedded.org/series/9805/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:
* Issue Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists [test_target_mailing_list]
Suggested fix Send the series again to the correct mailing list (ML)
Suggested ML yocto@yoctoproject.org [http://git.yoctoproject.org/cgit/cgit.cgi/yocto-docs/]
Patch's path: documentation/ref-manual/ref-variables.xml
* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at a17f3ec910)
If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).
---
Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
From: Otavio Salvador <hidden> Date: 2017-11-15 20:46:14
On Wed, Nov 15, 2017 at 1:10 PM, Martyn Welch
[off-list ref] wrote:
quoted hunk
Sometimes we wish to ensure that files or directories are not installed
somewhere that may prove detrimental to the operation of the system. For
example, this may be the case if files are placed in a directory that is
utilised as a mount point at run time, thus making them inaccessible once
when the mount point is being utilised.
Implement the prohibited paths QA test, which enables such locations to be
specified in a "PROHIBITED_PATHS" variable. This implementation allows for
a colon separated list of paths to be provided. Shell style wildcards can
be used.
Signed-off-by: Fabien Lahoudere <redacted>
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
---
Changes since v1:
- Correcting author and SOB.
Changes since v2:
- Reimplemented as image rather than package level QA test.
- Changed variable from PROHIBITED_PATH to PROHIBITED_PATHS to better
reflect its use.
meta/classes/image.bbclass | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
path = (d.getVar('PROHIBITED_PATHS') or "")
I'd use IMAGE_QA_PROHIBITED_PATHS as variable name. It makes easier to
know what it relates to.
+ if path != None and path != "":
If can die.
+ for p in path.split(':'):
+ if p[0] != '/':
if not p.startswith('/'):
+ raise ImageQAFailed("PROHIBITED_PATHS \"%s\" must be an absolute path" % p, image_check_prohibited_paths)
+
+ match = glob.glob("%s%s" % (rootfs, p))
+ if match:
I'd use:
if glob.glob(...):
It is a single use so not sure it is worth the extra variable.
+ loc = ", ".join(item.replace(rootfs, '') for item in match)
+ raise ImageQAFailed("Match(es) for PROHIBITED_PATHS \"%s\": %s" % (p, loc), image_check_prohibited_paths)
+}
On Wed, 2017-11-15 at 18:46 -0200, Otavio Salvador wrote:
On Wed, Nov 15, 2017 at 1:10 PM, Martyn Welch
[off-list ref] wrote:
quoted
Sometimes we wish to ensure that files or directories are not installed
somewhere that may prove detrimental to the operation of the system. For
example, this may be the case if files are placed in a directory that is
utilised as a mount point at run time, thus making them inaccessible once
when the mount point is being utilised.
Implement the prohibited paths QA test, which enables such locations to be
specified in a "PROHIBITED_PATHS" variable. This implementation allows for
a colon separated list of paths to be provided. Shell style wildcards can
be used.
Signed-off-by: Fabien Lahoudere <redacted>
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
---
Changes since v1:
- Correcting author and SOB.
Changes since v2:
- Reimplemented as image rather than package level QA test.
- Changed variable from PROHIBITED_PATH to PROHIBITED_PATHS to better
reflect its use.
meta/classes/image.bbclass | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
path = (d.getVar('PROHIBITED_PATHS') or "")
I'd use IMAGE_QA_PROHIBITED_PATHS as variable name. It makes easier to
know what it relates to.
quoted
+ if path != None and path != "":
If can die.
quoted
+ for p in path.split(':'):
+ if p[0] != '/':
if not p.startswith('/'):
quoted
+ raise ImageQAFailed("PROHIBITED_PATHS \"%s\" must be an absolute path" % p, image_check_prohibited_paths)
+
+ match = glob.glob("%s%s" % (rootfs, p))
+ if match:
I'd use:
if glob.glob(...):
It is a single use so not sure it is worth the extra variable.
quoted
+ loc = ", ".join(item.replace(rootfs, '') for item in match)
On Wed, 2017-11-15 at 18:46 -0200, Otavio Salvador wrote:
On Wed, Nov 15, 2017 at 1:10 PM, Martyn Welch
[off-list ref] wrote:
quoted
Sometimes we wish to ensure that files or directories are not installed
somewhere that may prove detrimental to the operation of the system. For
example, this may be the case if files are placed in a directory that is
utilised as a mount point at run time, thus making them inaccessible once
when the mount point is being utilised.
Implement the prohibited paths QA test, which enables such locations to be
specified in a "PROHIBITED_PATHS" variable. This implementation allows for
a colon separated list of paths to be provided. Shell style wildcards can
be used.
Signed-off-by: Fabien Lahoudere <redacted>
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
---
Changes since v1:
- Correcting author and SOB.
Changes since v2:
- Reimplemented as image rather than package level QA test.
- Changed variable from PROHIBITED_PATH to PROHIBITED_PATHS to better
reflect its use.
meta/classes/image.bbclass | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
path = (d.getVar('PROHIBITED_PATHS') or "")
I'd use IMAGE_QA_PROHIBITED_PATHS as variable name. It makes easier to
know what it relates to.
quoted
+ if path != None and path != "":
If can die.
OK, if is still needed, else the zero length path triggers the "not
p.startswith('/')" error condition.
quoted
+ for p in path.split(':'):
+ if p[0] != '/':
if not p.startswith('/'):
quoted
+ raise ImageQAFailed("PROHIBITED_PATHS \"%s\" must be an absolute path" % p, image_check_prohibited_paths)
+
+ match = glob.glob("%s%s" % (rootfs, p))
+ if match:
I'd use:
if glob.glob(...):
It is a single use so not sure it is worth the extra variable.
quoted
+ loc = ", ".join(item.replace(rootfs, '') for item in match)
+ raise ImageQAFailed("Match(es) for PROHIBITED_PATHS \"%s\": %s" % (p, loc), image_check_prohibited_paths)
+}
From: Alexander Kanavin <hidden> Date: 2017-11-16 10:31:58
On 11/15/2017 05:10 PM, Martyn Welch wrote:
Sometimes we wish to ensure that files or directories are not installed
somewhere that may prove detrimental to the operation of the system. For
example, this may be the case if files are placed in a directory that is
utilised as a mount point at run time, thus making them inaccessible once
when the mount point is being utilised.
Implement the prohibited paths QA test, which enables such locations to be
specified in a "PROHIBITED_PATHS" variable. This implementation allows for
a colon separated list of paths to be provided. Shell style wildcards can
be used.
The test does nothing if PROHIBITED_PATHS is not set. Can you set it in
core-image.bbclass to some reasonable default common to reference
images? Something like /mnt /media /tmp /run /var/run /var/tmp (not sure
at the moment what the mount points in those images are).
Alex