From patchwork Sat Feb 18 10:30:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "MOESSBAUER, Felix" X-Patchwork-Id: 2662 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 18 Feb 2023 11:31:19 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f189.google.com (mail-lj1-f189.google.com [209.85.208.189]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 31IAVFkn026748 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Feb 2023 11:31:16 +0100 Received: by mail-lj1-f189.google.com with SMTP id b25-20020a2e5159000000b002934b9b0d4fsf138650lje.16; Sat, 18 Feb 2023 02:31:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676716270; cv=pass; d=google.com; s=arc-20160816; b=tePa9WyDCq3+irWiwZ4Q3rMlJDIlc+bFpL0fljTEzzRiD1duodaeEDOdGzL8HYxKJD 6SPAsRYjN8AEC2WhvX5d3AYOAwcIUKUlpDGXMKa7BD45P+YDheWtr9ozObyPu8vEtwCo DCBEtGX6wHPo/3sNoSgkLZrkfCq8ZGnc1w7ywKe2kQtRSnJxm175xSX5o3Zfbb54EMF9 nUTJSLeoJKrQdV9G2MPfD2eliny/WBWAsf4SYW7eFmCqkF88Ou7UNIGJQ5/cMT+GmxrH trCfRxHSohSj4ibc9ID8LTZIyaEibAaZs0o4lL5gFomVomf4FDIAiscrbJyJLxR/vVaf jDjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:feedback-id:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=WuJXz0CWSW7CQDhKUe/qqF3Ezcyp6juypVx3cJfTtCM=; b=QSPrnZ6SG2du/o1T9pr1pvJtknTsoQkt/ETY8eok41wS3EpGpiUK53M6OUIotVFy37 pHsTtUgo/WkrR8qMGThwke7Q7Q+qNcxet6OnCy1jQLFr6KSa7zujo7Xf24vHe4y586fZ sGYFlw+Rq7Q0guq80U6nriX33QQUUrAF5cQpXRu3dE1Tj0GwQKIsz4XACFHtg8Iyy3kI C1sA2sIBPTfJs/zbIO1KFtXzumYCd1MLzUG7xTFYe3c420H1pswngizzXWw/vGskjtUz s3Uoh9s7IthN++e+VUMDIcLKTLTw7U5t3/Is1/ho8xJJI9dy2JkS85v5EWQReBpE9x8A oNYQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=RgbO7SRh; spf=pass (google.com: domain of fm-72506-20230218103107d1b7e32fae3b41597a-gqpvis@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-72506-20230218103107d1b7e32fae3b41597a-GqPVIs@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:feedback-id:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=WuJXz0CWSW7CQDhKUe/qqF3Ezcyp6juypVx3cJfTtCM=; b=PqfbcMGLPKPfknjf8/8kiy9McIfE1eZD2G0daSEJSjjKE/bUBNtE5MbHc9Uxsn5nhB ACSisQVg28yAUOK2uPzFkrpWbWZ8+ytOOMrrW8dMSuMUPW93RZ/a6x6+WUmMl89KxrcD 7gIfkPCT/lJv2IoYVljv7/5BRT0UZbRrxRhYnbW46TF1SWja1vRC/697sDssPgtkdAEG QlpEEE2CyJIlwq1UykU78/MJ75FxG00tLskYg9ztiaJvMM/XNv7o8C+Nk/h1+WOu9dBd fiUISqya8VGg6VGbJimSRzbExNE6S4OfjEUzXZFFqlIwa5voltJ/dQfVAiDqYqxkrMfC JBaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=WuJXz0CWSW7CQDhKUe/qqF3Ezcyp6juypVx3cJfTtCM=; b=y9yUtWY6If4j7ZXNC02wa78taL15366g4Z0dgaNwI7HiMAqvabuGL0S4vIGxbC1UQ2 9uWrlmA8hucDPApEaExleIhVYNawvEKiAad6nVY20bjjGCqQE1aiAuekK8yw59iJR7IS 7speTPMrigYuZBmapZTzw3cL3H3yDSoPELX6jr3CZN9yqlGrR20nKGkrMGqcaZeHqbuj a/bASk+Ao3lmwX1/gBs9+WzjZcg8C5rEMUr95DegJduPM5Z34qQP0BZR5/mmpxYsdOoT V1kYCmduwjCXfgvPth7K26PGCW7kJjPqUrmrHATRcWDJ+rn7rQ8FBUmvAxOcieba612k P9Zg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AO0yUKWGupYCgkDZuFe7AyzN7Xrew2wEIDSMVzkdfnx9j3j8A9anFTbv Ef1alojEB1qQsuyE6LRabo0= X-Google-Smtp-Source: AK7set/7kYgdnUCplKFaZwHOqYRYlb0dtCf//+Egbpslz3A76u+36E+B89KxdeCaukreAujJXjrKPA== X-Received: by 2002:ac2:5388:0:b0:4db:5133:59a6 with SMTP id g8-20020ac25388000000b004db513359a6mr1303037lfh.13.1676716269788; Sat, 18 Feb 2023 02:31:09 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3b91:b0:4db:51a5:d2e8 with SMTP id g17-20020a0565123b9100b004db51a5d2e8ls146807lfv.2.-pod-prod-gmail; Sat, 18 Feb 2023 02:31:07 -0800 (PST) X-Received: by 2002:ac2:5550:0:b0:4d5:acb3:fd24 with SMTP id l16-20020ac25550000000b004d5acb3fd24mr1123748lfk.54.1676716267918; Sat, 18 Feb 2023 02:31:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676716267; cv=none; d=google.com; s=arc-20160816; b=jk9Fh29iIuNqD/SHgqNseclzGadEWKjZNaA+VJHiE3OCUSP/l2jFh9QlM0eO8yDYg0 +GJCFidIP/oKRoC/QHsPahHstIs2mISuzSnVV3WmC1IjbkrUbkZFk+gOlzEplh35SU/L eRA3CMHKofXnQrQ5CflBmbbPhQPG/JqaQYaPH2x9XSPbCoiY+g/easqKvnVwgMgsor6G mRh2UPGItVkWdLgtJVUYyka5qaiaczEiGAXk3HjzCFg7Dc2unKqCvI79RcDa/f+/RP/L AvSKluUPpBxpDLXaVcZqUB1ZH2TK93pPTU95RbMD9S+6Tvb2NKveMzbdo+r7d8ab7iKw FyVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=pA50mZPd52qVdESQNE7ICzh4QaqNLiZcZ7aCSV6rIvQ=; b=x5K4KVWgDRt07z6BoTUEN5qFVDwNa7jPOHtBy5MZvIClqAWkkFRONdC7/Skkr3g84e SJaVwiKKPA1yuSxfV59sNjvCbLZ6Hm1kPf17cYbjbvawpXTAEv8I2RadCLpr6FpUha3D 40OF3Bdqz+7L2X10js9czcG9yAaZ0CU3gv1nEAAWYU7PTM+gpFMvwqaEA7Gc9cTdJI5p /N/x/dXJW0Ztm5BFxwfyW+YpYBt+lFxstwPPWgb5C/rAK4OOCZbKyxw5B4akJP3utlQW H6LxracHE/hNfE2ZJz+LmCKNsfI7TcxXpQ5MQeAP1HszIxwXQ7lEuhojGlHMc06jZ5M3 rN5w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=RgbO7SRh; spf=pass (google.com: domain of fm-72506-20230218103107d1b7e32fae3b41597a-gqpvis@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-72506-20230218103107d1b7e32fae3b41597a-GqPVIs@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id t22-20020a199116000000b004d5786b729esi249835lfd.9.2023.02.18.02.31.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Feb 2023 02:31:07 -0800 (PST) Received-SPF: pass (google.com: domain of fm-72506-20230218103107d1b7e32fae3b41597a-gqpvis@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20230218103107d1b7e32fae3b41597a for ; Sat, 18 Feb 2023 11:31:07 +0100 From: Felix Moessbauer To: isar-users@googlegroups.com Cc: adriaan.schmidt@siemens.com, jan.kiszka@siemens.com, Felix Moessbauer Subject: [PATCH v2 1/3] add initramfs to sstate-cache Date: Sat, 18 Feb 2023 10:30:36 +0000 Message-Id: <20230218103038.3005105-2-felix.moessbauer@siemens.com> In-Reply-To: <20230218103038.3005105-1-felix.moessbauer@siemens.com> References: <20230218103038.3005105-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-72506:519-21489:flowmailer X-Original-Sender: felix.moessbauer@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=RgbO7SRh; spf=pass (google.com: domain of fm-72506-20230218103107d1b7e32fae3b41597a-gqpvis@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-72506-20230218103107d1b7e32fae3b41597a-GqPVIs@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS,T_SPF_HELO_TEMPERROR autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= This patch changes how we deploy the initramfs. Instead of manually deploying, we use the sstate infrastructure for that. By that, accidental overrides of the artifact can be automatically detected. On clean, the artifact is also cleaned. Signed-off-by: Felix Moessbauer --- meta/classes/initramfs.bbclass | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/meta/classes/initramfs.bbclass b/meta/classes/initramfs.bbclass index a5141a53..183d1933 100644 --- a/meta/classes/initramfs.bbclass +++ b/meta/classes/initramfs.bbclass @@ -2,16 +2,19 @@ # Make workdir and stamps machine-specific without changing common PN target WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/${PV}-${PR}" +DEPLOYDIR = "${WORKDIR}/deploy" STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/${PV}-${PR}" STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/*-*" # Sstate also needs to be machine-specific SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${MACHINE}-${DISTRO}-${DISTRO_ARCH}" +SSTATETASKS += "do_generate_initramfs" INITRAMFS_INSTALL ?= "" INITRAMFS_PREINSTALL ?= "" INITRAMFS_ROOTFS ?= "${WORKDIR}/rootfs" -INITRAMFS_IMAGE_FILE = "${DEPLOY_DIR_IMAGE}/${INITRAMFS_FULLNAME}.initrd.img" +INITRAMFS_IMAGE_NAME = "${INITRAMFS_FULLNAME}.initrd.img" +INITRAMFS_IMAGE_FILE = "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}" # Install proper kernel INITRAMFS_INSTALL += "${@ ("linux-image-" + d.getVar("KERNEL_NAME", True)) if d.getVar("KERNEL_NAME", True) else ""}" @@ -27,8 +30,10 @@ ROOTFS_PACKAGES = "initramfs-tools ${INITRAMFS_PREINSTALL} ${INITRAMFS_INSTALL}" inherit rootfs -do_generate_initramfs[dirs] = "${DEPLOY_DIR_IMAGE}" do_generate_initramfs[network] = "${TASK_USE_SUDO}" +do_generate_initramfs[cleandirs] += "${DEPLOYDIR}" +do_generate_initramfs[sstate-inputdirs] = "${DEPLOYDIR}" +do_generate_initramfs[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" do_generate_initramfs() { rootfs_do_mounts rootfs_do_qemu @@ -44,8 +49,11 @@ do_generate_initramfs() { if [ ! -e "${INITRAMFS_ROOTFS}/initrd.img" ]; then die "No initramfs was found after generation!" fi - - rm -rf "${INITRAMFS_IMAGE_FILE}" - cp "${INITRAMFS_ROOTFS}/initrd.img" "${INITRAMFS_IMAGE_FILE}" + cp ${INITRAMFS_ROOTFS}/initrd.img ${DEPLOYDIR}/${INITRAMFS_IMAGE_NAME} } addtask generate_initramfs after do_rootfs before do_build + +python do_generate_initramfs_setscene () { + sstate_setscene(d) +} +addtask do_generate_initramfs_setscene