From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7069776205411516416 X-Received: by 2002:a05:622a:1101:b0:2de:3c6a:bae2 with SMTP id e1-20020a05622a110100b002de3c6abae2mr16780775qty.640.1646062532506; Mon, 28 Feb 2022 07:35:32 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a37:6844:0:b0:648:d7e3:5c5c with SMTP id d65-20020a376844000000b00648d7e35c5cls7133827qkc.1.gmail; Mon, 28 Feb 2022 07:35:32 -0800 (PST) X-Received: by 2002:a05:620a:468d:b0:648:bb57:3cac with SMTP id bq13-20020a05620a468d00b00648bb573cacmr11435473qkb.663.1646062532189; Mon, 28 Feb 2022 07:35:32 -0800 (PST) Received: by 2002:a37:a841:0:b0:648:cac9:4bbe with SMTP id af79cd13be357-6495a5c46a8ms85a; Mon, 28 Feb 2022 06:59:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDVCYVgkge3cO2tU25vIqb6gj+ZiTK82BDduNrR/XiAPdxTU1fZS+h4nsfK7El8wLxF3ur X-Received: by 2002:a19:6456:0:b0:437:974a:f5ce with SMTP id b22-20020a196456000000b00437974af5cemr12836118lfj.394.1646060363309; Mon, 28 Feb 2022 06:59:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646060363; cv=none; d=google.com; s=arc-20160816; b=ifAloahajTgtWRDcOUCYFQoHlgGdw4Izeuh2B3zv40wRLx9zkWAso1pqvMEI+hXLxf 5TzSIWA3v3YdRM6919S8GWq3BY8HNjrHRDowhgvxW/ExSU9465ZXXXOPcphNWSHwBpir vM/zvLhVUuP8GufH/gcOTWHNs8/yRW+eZYmhU/YeQNHLWSndhQTKJOi3or4h3KJUhy5E ER/kAGZXgi5+WjiWQu6xnL9CZ91CqsakbfuwAA+P72HEbiTyqJmf+D85ZUrcfMxOdzen TuKP9x3EIeElCWJOWqdgjtOjiE+T6k4V806lOjDkgRv+YcPJARz2mXAgB+T5b0JG1J8n 5efQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=7Ygje4MWROz6QAWhUEaT5DRjl+p2ov/CJkS1zCuZVtU=; b=fQdL0gXgvx/0EqQ+8HgMD1qxwlHlCk/+Y5RY3e2lOKTGYrtp1spy/fB+KjzNWLALbo 2hj9Ihx3qw53f9/Lizeku3CJiaeKJKlop+GQT9JyCEFCiv5DSIN5Hy/vUFlRYD3qtMR/ nfQrn+ZIjaF8OS1/MIR0zBGrStqmzix+6Oplkv7A2lpIl4+nobFMzjejY9sS4+wUGD6b itK0+ibox3rp6qdVC8xctg+7VnHosd3E/5/BRognPMvAwq6Hr1WsaC+PZPngc6O5ZzLV PoKtYE5/xz/riiTEkRe8UQLC6aBqPwdeCgt4HzZoRzI3Z9WBFSNcbgf01wT8TMxDXuvn BPgg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of work@hennsch.de designates 2a01:488:42:1000:50ed:842d:: as permitted sender) smtp.mailfrom=work@hennsch.de Return-Path: Received: from wp038.webpack.hosteurope.de (wp038.webpack.hosteurope.de. [2a01:488:42:1000:50ed:842d::]) by gmr-mx.google.com with ESMTPS id v12-20020a2e9f4c000000b002463b896be4si552762ljk.7.2022.02.28.06.59.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 06:59:22 -0800 (PST) Received-SPF: pass (google.com: domain of work@hennsch.de designates 2a01:488:42:1000:50ed:842d:: as permitted sender) client-ip=2a01:488:42:1000:50ed:842d::; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of work@hennsch.de designates 2a01:488:42:1000:50ed:842d:: as permitted sender) smtp.mailfrom=work@hennsch.de Received: from [195.145.170.157] (helo=md1za8fc.ad001.siemens.net); authenticated by wp038.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1nOhUf-0005Gw-EI; Mon, 28 Feb 2022 15:59:21 +0100 From: Henning Schild To: isar-users@googlegroups.com Cc: Vijai Kumar K , jan.kiszka@siemens.com, Henning Schild Subject: [PATCH] meta: add quality check helper to image class Date: Mon, 28 Feb 2022 15:59:18 +0100 Message-Id: <20220228145918.387-1-work@hennsch.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;work@hennsch.de;1646060362;8ac9705e; X-HE-SMSGID: 1nOhUf-0005Gw-EI X-TUID: KXcpMrcT+YJe From: Henning Schild 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 --- 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 ) + test -f $rootfs_install_stamp + + 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} -- 2.34.1