From patchwork Mon Sep 6 01:45:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: venkata.pyla@toshiba-tsip.com X-Patchwork-Id: 750 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Mon, 06 Sep 2021 11:45:10 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-ot1-f59.google.com (mail-ot1-f59.google.com [209.85.210.59]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 1869j7sn012555 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Sep 2021 11:45:08 +0200 Received: by mail-ot1-f59.google.com with SMTP id w35-20020a056830412300b0051bae474534sf4231693ott.21 for ; Mon, 06 Sep 2021 02:45:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1630921502; cv=pass; d=google.com; s=arc-20160816; b=d3VLcQEyhkkYUQDbUIKjwwn8Q99BEFjFEtc+7hGv5zFo4X+7jrCIBUsF30Iv9Oq4n1 8Jgb+yNwonw27NAEIFLQkyPYwz5dbEWB430fGCNGCJduTq3mS+Orc89Py4/cOylnIJkN aLo645V8CnkLc3rizQwSvb/Ilwl+iDuUTGOJWqt1AAkOeKqA5MqppHeBibSbtmsiToyk +hn0xDM+vandjNWgSiut2b8k2hnN220X2dzDaFAAjOU/1kUgyVUjw8xiAxa6IpYbBa8e cjtIRvYSPR0YHsPzivpnQoBlbxV1YdYGveI7gDTrMAuEg2R02diSU2WmmyfekcqgCANB gWqg== 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:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=Mqp55rQAlLAj8DeGKPuIdqrZKYmOHA3dlXghOkGe29U=; b=t/DHXcnmfbPRwNfzbqtSpY2m9RhUe+dEA0K14XTnR/101aCj4GRE/S1xdM1ovVPGmH qgXjXh0Hm2fE3UCfXDUywS+H1+9EL7aYR/ovemnErGKMpHLxK7WhNax5b1kFwuG59Y00 /KTweEd6mGbUkZkw6tlSLZ+SYAZiAsD00Z8Ue7ufF6V5lvsHkbGOTkQCzEN+iPN31ygC qt0Pg0kGctnk0TS2f5iSIJ/I3DPJl8wapd/rosK8ISnk7MK1EbHM4YVj4ptExFuSnVw7 eA4IYEnoo1I/m280Tdci9ZvUupTP5pJ8wNT+zlTE78AaUEYJ1BqwHp1zgmjjkkWzV6Uv DA0w== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.157 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Mqp55rQAlLAj8DeGKPuIdqrZKYmOHA3dlXghOkGe29U=; b=hzU56Zrn8Fm3Duot2/MRh1XpmqGK6aDoFVAlrAo+2mVvMHMvCFvILGAdInK0cYb6xp KNyjrLoiL5a3OS8SeB5x7cKHLYmJEQEltWpDsU2mSXzhqICYqZFf0I+iJIq5cjitPUps ke4xbleSlk6LtdezM52bGhhqgRViZg/RUYIFjteJyelxEdVcXjS/XKmOGqvv3LzXCB/d DWvdZam4S1ydqzYuO/KnGgoNFQnhiiuXd7VMzD94DBsXiwmbTHQqzJ1qcuN8BIHg6x3E Efx353QdmEa8jlJ2dy7NwykUuZuKnj65XoO4bWfOwMbyaVI7E4ldL4Ls7Znn+Yduz5ty jLCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=Mqp55rQAlLAj8DeGKPuIdqrZKYmOHA3dlXghOkGe29U=; b=BKVyRlywE6FjS2TIqtQ11zCiXDdDFILDRhBYGa51u78D+5b0Tqiz9xxZlaOpZGbcDi x9YXknh6S1dTuuoqXwO2b/gZXzm1h8WfFx2tJbS0qWc8Rmyvi5dIjS/FmbTOWBzcHVcZ L4e6D4SEOb2KCg6waF456aPOP7Is0/meE8iqJQzr72DwUnDb2yQSZe+ksiNX9601OxSt CCG0kmUp39bCYts8rgCibHXPHi7Bj6hPSlRCbs6J14pds2hK8pjymMWBAlBFtcufxKsL 0Bs0RZSoUABJGcH28CyYKmpg/ZirHX+8abMYlZ7Vz8K/Vtsc09c5Ui44Z8cP4qQJSRgT ZnsA== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM53326os7n/daA6XQ4s3BnuDIdylOlE9GiFvvfmYGM3DKEUHokqMB mI9iCPvYw1tZ8pzSOUb56VY= X-Google-Smtp-Source: ABdhPJzSB1OEBK5lvglgec8Uah0KTPNsqlMKAucqo2z0DqjfrGRuZRbwarSIGBFPX1lbkD7SG4cs0A== X-Received: by 2002:aca:bfc6:: with SMTP id p189mr7725840oif.167.1630921501892; Mon, 06 Sep 2021 02:45:01 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a9d:66c4:: with SMTP id t4ls1586255otm.5.gmail; Mon, 06 Sep 2021 02:45:01 -0700 (PDT) X-Received: by 2002:a05:6830:4006:: with SMTP id h6mr9901609ots.93.1630921501440; Mon, 06 Sep 2021 02:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630921501; cv=none; d=google.com; s=arc-20160816; b=NYbVq98oXgtbBA2balkzGnmB+UB15g4JfMpgkC32lqgEoxyvvtWA78RoGxQ3Z/EoVc Ns1dlLyxwtWS8kL0r9pu6MbNzNZGE7GkLutfsHBsvLT+BT27SAjKHjR1ix5XDGZBYjBA /7/s6gM6IBPy/CzmCO2+Pgs8uorHMi2pMJE3SEB4oF+Ao0gzlwsWSttaACgZTz5V9YQX /VGwQ3ANAodJHR+W3e4q7yKEivf5v3HGFfKxJ8e2sOFEd8k97bSSmtaY0AT/MlPJ2O6Q xenJVHGC6/Miis3oYNICVfszhDIWaF0pho2KtlIJ/APHrQgnRrNhRFy7qKK/UvLw309K UZRA== 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=v/BcCwL/L+wDmnVBH4YRItQRAzbAE7dqT6+sVveZ/aI=; b=Goit93gROHZmy2FqUBqX8Udww/GcCysJkHwMSpn8rKAv6wiRGr2p1rQ/kxf6uO+3xP of14Oynx1V1zVoYfsGZlMr3QWozv577w4w8wmyQ+dQQYSA9gFJhrZ6p6QFbkMDlBMdEs iwxS6wl+mU2Gi7QDOGQT2wjQAmdN+bcx/gbrmFpx8cWBXsLBIMhZ4D6P+s45wCrxGUx0 Qst3bwOGQyCAagfNsqDg0Llx7OUH/I45jSxY/z7zY97cnHgmd3bwzW9Ub+rSCX94sZaj AAECfpOTLcwG5lXrXa5w2sn8FpdVFuMn3pYf1Fgl2ia6MsegQfD31Y3V9iLjY9gZIlx7 cmRA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.157 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.com Received: from mo-csw.securemx.jp (mo-csw1115.securemx.jp. [210.130.202.157]) by gmr-mx.google.com with ESMTPS id s20si384136ois.4.2021.09.06.02.45.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Sep 2021 02:45:01 -0700 (PDT) Received-SPF: pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.157 as permitted sender) client-ip=210.130.202.157; Received: by mo-csw.securemx.jp (mx-mo-csw1115) id 1869iwnt009393; Mon, 6 Sep 2021 18:44:58 +0900 X-Iguazu-Qid: 2wHHCQcimykIJLoo1S X-Iguazu-QSIG: v=2; s=0; t=1630921498; q=2wHHCQcimykIJLoo1S; m=Jg3Y2+B1OhHyf1/z3rpi9n5sFRLa/Kr/Sa1cmgqjgEA= Received: from imx2-a.toshiba.co.jp (imx2-a.toshiba.co.jp [106.186.93.35]) by relay.securemx.jp (mx-mr1113) id 1869ivH0037775 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 6 Sep 2021 18:44:58 +0900 Received: from enc01.toshiba.co.jp (enc01.toshiba.co.jp [106.186.93.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by imx2-a.toshiba.co.jp (Postfix) with ESMTPS id CEBE610008E for ; Mon, 6 Sep 2021 18:44:57 +0900 (JST) Received: from hop001.toshiba.co.jp ([133.199.164.63]) by enc01.toshiba.co.jp with ESMTP id 1869ivPO015481 for ; Mon, 6 Sep 2021 18:44:57 +0900 From: venkata.pyla@toshiba-tsip.com To: isar-users@googlegroups.com Cc: venkata pyla , henning.schild@siemens.com, jan.kiszka@siemens.com Subject: [isar] rootfs: Add new ROOTFS_FEATURE 'slimfy' to minimize the footprint Date: Mon, 6 Sep 2021 15:15:10 +0530 X-TSB-HOP: ON Message-Id: <20210906094510.9589-1-venkata.pyla@toshiba-tsip.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-OriginalArrivalTime: 06 Sep 2021 09:44:55.0589 (UTC) FILETIME=[D9416550:01D7A303] X-Original-Sender: venkata.pyla@toshiba-tsip.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of venkata.pyla@toshiba-tsip.com designates 210.130.202.157 as permitted sender) smtp.mailfrom=venkata.pyla@toshiba-tsip.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-getmail-retrieved-from-mailbox: INBOX From: venkata pyla This Adds new ROOTFS_FEATURE 'slimify' that deletes unnecessary files in the rootfs and contributes to minimal footprint in the rootfs and also avoids the reproducible failures due to non-deterministic data in the log files and temporary files. It deletes the following files - /var/log/* - /tmp/* To enable this feature ROOTFS_FEATURE += slimify Signed-off-by: venkata pyla --- meta/classes/rootfs.bbclass | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index f9151c5..d01a9d1 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -12,6 +12,7 @@ ROOTFS_PACKAGES ?= "" # 'clean-package-cache' - delete package cache from rootfs # 'generate-manifest' - generate a package manifest of the rootfs into ${ROOTFS_MANIFEST_DEPLOY_DIR} # 'export-dpkg-status' - exports /var/lib/dpkg/status file to ${ROOTFS_DPKGSTATUS_DEPLOY_DIR} +# 'slimify' - delete unnecessary files in rootfs like /var/log/*, /tmp/* ROOTFS_FEATURES ?= "" ROOTFS_APT_ARGS="install --yes -o Debug::pkgProblemResolver=yes" @@ -229,6 +230,12 @@ rootfs_export_dpkg_status() { '${ROOTFS_DPKGSTATUS_DEPLOY_DIR}'/'${PF}'.dpkg_status } +ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'slimify', 'rootfs_slimify', '', d)}" +rootfs_slimify() { + sudo rm -rf "${ROOTFSDIR}/var/log/"* + sudo rm -rf "${ROOTFSDIR}/tmp/"* +} + do_rootfs_postprocess[vardeps] = "${ROOTFS_POSTPROCESS_COMMAND}" python do_rootfs_postprocess() { # Take care that its correctly mounted: