public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH] meta: add quality check helper to image class
Date: Thu, 3 Mar 2022 11:09:08 +0100	[thread overview]
Message-ID: <20220303110855.0777a483@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20220228145725.32716-1-work@hennsch.de>

Am Mon, 28 Feb 2022 15:57:25 +0100
schrieb Henning Schild <work@hennsch.de>:

> From: Henning Schild <henning.schild@siemens.com>
> 
> Content of rootfs should ideally all be coming from packages and their
> hooks. POSTPROCESSing and custom tasks should be handled with a lot of
> care and avoided where possible.
> 
> This commit introduces a quality check task to help devs not
> accidentially abuse POSTPROCESS, while allowing them to add files to
> an ignore list.
> 
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  meta/classes/image.bbclass | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index d44298bcdd7c..a0d44489d5bb 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -231,5 +231,33 @@ EOSUDO
>  }
>  addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess
>  
> +ROOTFS_QA_FIND_ARGS ?= ""
> +
> +do_rootfs_quality_check() {
> +    rootfs_install_stamp=$( ls -1 "${STAMP}".do_rootfs_install.* |
> head -1 )

Will need to take setscene/sstate into account.

do_rootfs_install.* -> do_rootfs_install*

> +    test -f $rootfs_install_stamp

needs quoting because "test -f" exits 0 while 'test -f ""' does not

Henning

> +
> +    args="$ROOTFS_QA_FIND_ARGS"
> +    # rootfs_finalize chroot-setup.sh
> +    args="${args} ! -path ${ROOTFSDIR}/var/lib/dpkg/diversions"
> +    for cmd in ${ROOTFS_POSTPROCESS_COMMAND}; do
> +        case "${cmd}" in
> +	    image_postprocess_mark)
> +	        args="${args} ! -path ${ROOTFSDIR}/etc/os-release";;
> +	    image_postprocess_machine_id)
> +	        args="${args} ! -path ${ROOTFSDIR}/etc/machine-id";;
> +	esac
> +    done
> +    found=$( sudo find ${ROOTFSDIR} -type f -newer
> $rootfs_install_stamp $args )
> +    if [ -n "$found" ]; then
> +        bbwarn "Files changed after package install. The following
> files seem"
> +	bbwarn "to have changed where they probably should not have."
> +	bbwarn "You might have a custom task or writing POSTPROCESS
> function."
> +	bbwarn "$found"
> +    fi
> +}
> +
> +addtask rootfs_quality_check after do_rootfs_finalize before
> do_rootfs +
>  # Last so that the image type can overwrite tasks if needed
>  inherit ${IMAGE_FSTYPES}


       reply	other threads:[~2022-03-03 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220228145725.32716-1-work@hennsch.de>
2022-03-03 10:09 ` Henning Schild [this message]
2022-02-28 14:59 Henning Schild
2022-02-28 15:02 ` Henning Schild
2022-03-01 10:28   ` vijai kumar
2022-03-02 13:36     ` Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220303110855.0777a483@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox