Hi,

On Thu, 2021-07-15 at 21:39 +0200, Vyacheslav Yurkov wrote:
> This class provides commom functions for overlayfs and its QA check,
> which is performed in ROOTFS_POSTPROCESS_COMMAND
> 
> Signed-off-by: Vyacheslav Yurkov <uvv.m...@gmail.com>
> ---
>  meta/classes/overlayfs-qa.bbclass | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>  create mode 100644 meta/classes/overlayfs-qa.bbclass
> 
> diff --git a/meta/classes/overlayfs-qa.bbclass 
> b/meta/classes/overlayfs-qa.bbclass
> new file mode 100644
> index 0000000000..54fa8316a2
> --- /dev/null
> +++ b/meta/classes/overlayfs-qa.bbclass
> @@ -0,0 +1,14 @@
> +# This class contains common functions for overlayfs and its QA check,
> +# which is performed in ROOTFS_POSTPROCESS_COMMAND
> +
> +# this function is based on 
> https://github.com/systemd/systemd/blob/main/src/basic/unit-name.c
> +def escapeSystemdUnitName(path):
> +    escapeMap = {
> +        '/': '-',
> +        '-': "\\x2d",
> +        '\\': "\\x5d"
> +    }
> +    return "".join([escapeMap.get(c, c) for c in path.strip('/')])
> +
> +def mountUnitName(unit):
> +    return escapeSystemdUnitName(unit) + '.mount'


Thanks for working on this, it is passing our automated tests but I had 
some review comments. I think the above would make much more sense as code
in meta/lib/oe/ somewhere as it is basically just function library code.
There is a general intent to move the more generic python functions there
and try to establish some better APIs so if you could move this there as
new code, that would be great!

Cheers,

Richard





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154080): 
https://lists.openembedded.org/g/openembedded-core/message/154080
Mute This Topic: https://lists.openembedded.org/mt/84233759/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to