From patchwork Fri Nov 29 06:28:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adithya Balakumar X-Patchwork-Id: 3967 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 29 Nov 2024 07:22:41 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pf1-f189.google.com (mail-pf1-f189.google.com [209.85.210.189]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AT6MdNu023344 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 29 Nov 2024 07:22:40 +0100 Received: by mail-pf1-f189.google.com with SMTP id d2e1a72fcca58-724f6189a4asf1921727b3a.3 for ; Thu, 28 Nov 2024 22:22:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732861353; cv=pass; d=google.com; s=arc-20240605; b=D6IXaUj1RzgC2Y4Ig7/LMlPwIuW3goNOxrpZke61N+vVG4z/pc3YFJONp6MGUWzjJm Z3Apekp//eqcoY6jznbTjreTXINNxSxpbWsriV5i/hPCVv1gYaNa7AxfU+Pt+jo/R+xk zI5rUxFfxPzlaA9jgUAaQoaG07bIk1jQCPNG6lV9yy8FWMTddeo4vdMTR62fXbsTKwqd B+BfyO2WtGySPNMfGynRRvt/wI0plk6p0f+RIh2Wvjy1vHgMv0Gekn2AIGJhNeRfCEnS 7sFnyyxqbtEEsFjmj2/AcCklAzAeeylHs1/5iJWZK1NRCRcgXT3lMZpCQSJrhqFrk4Gy 8w6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=mCVQrs6CxcZsTHYJqMpoZDWKX294nRf7F2/ohYvkT+I=; fh=B1CYtF+LrVUaj9dfxXYhHnp7uRlXEZXnJ/Q7eyUGw1Q=; b=j4QKwEfe2y7jwwJJ1o1y7pO611LGkv9/XnR5Z5kGSLORNTmLdxNl7HFm9VxCDldXl4 gvXRgVz4L3XLASRyMHRi49uXkQtjA7ZhHa6B4i7FPFVRG49rb1OXS/y7m4PvJhDMPGeV 7UDsIbtpDBbp9g6SDLBe2AHW3L0H/+yGFY93b1g7BaMzJfEZmQCSFNgsH1Qg+jd16qMg rP2lzMNtRYYGCnMM732kNk+tYNzGwj5nQ9vGwhMnuAf4VswAVCkr8tuquPIfvYBEA+DH YXCqMnaZ0qMAomVvS07l0RgIks+hWsA9QoYW4E/awr396pVVhHJUjFJkFFDPfOFjlbZb 8P5g==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of adithya.balakumar@toshiba-tsip.com designates 210.130.202.152 as permitted sender) smtp.mailfrom=Adithya.Balakumar@toshiba-tsip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1732861353; x=1733466153; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=mCVQrs6CxcZsTHYJqMpoZDWKX294nRf7F2/ohYvkT+I=; b=EjVhGqmjFmCR446lomfWhEKdRSlprpuxWiESS2e1gVP+/KzCk+l5mS4o/rHQnsG9W2 M1xOjeLOvk/pKgoUMxpZNgZtvcrQ58qDwuPKDJkzW3HJILOHfi7I5KDJF+YXpNa9/2mJ R8COpWeaTroFz9czhh3oEOJ6S0FEcz7hrkMrCbTF5D3Zw3watJ2Y5StT+Mya+j31MqoI KuDwWIKP0wNXGQoQbfkLkMTH1icjKUfzbzzvLTEfsX0QBDHiJKgPQ1jDpLTZTBaNjn3v 392YoAZ5jaBVqdDSA02DjcLLe4leMCedqV+4f0OTin+xEtftJTWMpyRQ6hN+7AcUQsFJ vc9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732861353; x=1733466153; 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=mCVQrs6CxcZsTHYJqMpoZDWKX294nRf7F2/ohYvkT+I=; b=nKaMk0HupZ9Jh0WB7vEaQfDGpGzsgDFpfRpgma2rw8Ly83Q67e8nPF5283akYi9JJt 2E91O+U7Xw0OKekkArKC5CU+2tQi79n6wtpVm4HnGa1T/Zn0x6FjNO7tBq2uxg8ZFRNf 0d34D2+d+RC5zWC22XHJ06TkwhJNmHl9BbAtI3o2F1ZoTpgBnbJ6NYcprONsr2qB4OiF ql3KCeqW704FwYy+vq87YxH4RVppJxGiagCWtmgxZAu23rQOlzXki6q8tJ3+QssMlOUj QjOoR/DWhJqn3dS3km0JhVyTRsQ/a0wlA409RzC7cdeR+RogIgkkRc7+bPMJlpA7eNW+ CzVg== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCVQKL6ZKPzTGTRAd6hTDamQcnQ5846EmLPB3sbYHPPxhw/sAIG0g23fYlgpJi4klZ/ZYRM1YCM=@isar-build.org X-Gm-Message-State: AOJu0YweafdAmrUQB962WKV/iouN1wgO+iVO9y9DwdvGckFGs9fuy6Jg TENhUnJjSrEDYRrBNnA6IPZJiQLl5NVpReVSFWGlkREHEmAZMFfL X-Google-Smtp-Source: AGHT+IEsA8/uOyzVtWfQQVd5JYP57diMXguPXS5RyW/v0meU5pdrUlq6d9Iqornnehncrajmcd5kJg== X-Received: by 2002:a17:903:283:b0:214:f87b:c154 with SMTP id d9443c01a7336-21501087636mr139118795ad.5.1732861353160; Thu, 28 Nov 2024 22:22:33 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:fc90:b0:215:3d34:776c with SMTP id d9443c01a7336-2153d34791bls3039305ad.0.-pod-prod-03-us; Thu, 28 Nov 2024 22:22:31 -0800 (PST) X-Received: by 2002:a17:902:db0e:b0:20c:bbac:2013 with SMTP id d9443c01a7336-21501f63db2mr144517525ad.48.1732861351444; Thu, 28 Nov 2024 22:22:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732861351; cv=none; d=google.com; s=arc-20240605; b=jsXR7m8Y/QQd1EVjdUYQ+ArkYDhwno+Vf8rSCtekiqBEkkqvydIbCn3Xj7ppjHbvRH NqWk2VP9kddys6ijumHHfR08OxdYQNHY8bHhz+q3X/94nI6l/eFwzh4915ki4+VwDVMS yZcCknp/iMypkl2XQHXYHzfi5BAlBQPQkNloo/Zn4NQmaUqBUD5vISAamQXnmkyIWnkk 2LKKxstN2ORouHYfg71PUsvekewaviJCD1LKF1sZOM255UlC4XkLd/3nP6Ig4dXhl9FE 7fTDD3zb4x+NhgEzzZWZihFP69C+ckqLBxx4imXQW5t1aEK3nKzDdKOEWjLR+sPk0dYd GBMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=3FUnBugxmOHbrkmYO2YRHsPHkUHowmyY90vJOtv/iik=; fh=95wLIF1hw/zIpqq2Ec+GyUgTsRZ8XfjQM59TjRw6kJk=; b=Q2bRwZLGvfaEFIqyjfTM/qzOVp/R+HhfzOzBGcFxxa9H+XyCkllk2cHF+/waf0VzMZ Of6Qhx3EC9M3XkgJPfa210gfTrW3PNGqaFXSdFnW7LQCupyM6cYQiPQznQzp+W/jvQ87 nizSjGcpgr6JCjjijDC+QAc6j8TW8USSNPoxxYxekJrpacnEG6LOpO2qNQKyCcLgNZu0 IwVrj/3JD1ijrU2glrfgiurIgbT7j7LprWIwGZ/8HmpyvyFcIYoF+Sk0IVpqEylfmbr1 mHLSi6efxv9N74LOrfkIj3Z00B3AHukwArlD8uXS6O7r5WIlP3Mfcs83kBHWcbvAUZUo kWWg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of adithya.balakumar@toshiba-tsip.com designates 210.130.202.152 as permitted sender) smtp.mailfrom=Adithya.Balakumar@toshiba-tsip.com Received: from mo-csw.securemx.jp (mo-csw1802.securemx.jp. [210.130.202.152]) by gmr-mx.google.com with ESMTPS id d9443c01a7336-2154759b5efsi104015ad.1.2024.11.28.22.22.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 22:22:31 -0800 (PST) Received-SPF: pass (google.com: domain of adithya.balakumar@toshiba-tsip.com designates 210.130.202.152 as permitted sender) client-ip=210.130.202.152; Received: by mo-csw.securemx.jp (mx-mo-csw1802) id 4AT6MTm01827167; Fri, 29 Nov 2024 15:22:29 +0900 X-Iguazu-Qid: 2yAafOrBabhH3ttj97 X-Iguazu-QSIG: v=2; s=0; t=1732861349; q=2yAafOrBabhH3ttj97; m=LYxI0jO3jifroHhHj0XtEkMqELxegxB4i3YJbdU9ZcI= Received: from imx2-a.toshiba.co.jp (imx2-a.toshiba.co.jp [106.186.93.35]) by relay.securemx.jp (mx-mr1802) id 4AT6MSLJ851796 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 29 Nov 2024 15:22:28 +0900 From: Adithya Balakumar To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, kazuhiro3.hayashi@toshiba.co.jp, dinesh.kumar@toshiba-tsip.com, shivanand.kunijadar@toshiba-tsip.com, sai.sathujoda@toshiba-tsip.com, adithya.balakumar@toshiba-tsip.com Subject: [PATCH v1 1/1] image.bbclass: use oe.utils.directory_size() instead of du Date: Fri, 29 Nov 2024 11:58:26 +0530 X-TSB-HOP2: ON Message-Id: <20241129062827.527177-2-Adithya.Balakumar@toshiba-tsip.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241129062827.527177-1-Adithya.Balakumar@toshiba-tsip.com> References: <20241129062827.527177-1-Adithya.Balakumar@toshiba-tsip.com> MIME-Version: 1.0 X-OriginalArrivalTime: 29 Nov 2024 06:22:26.0558 (UTC) FILETIME=[0F4F61E0:01DB4227] X-Original-Sender: adithya.balakumar@toshiba-tsip.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of adithya.balakumar@toshiba-tsip.com designates 210.130.202.152 as permitted sender) smtp.mailfrom=Adithya.Balakumar@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-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE, SPF_PASS 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?= Currently the "du" command is used to calculate the rootfs size, and sometimes the reported size of the rootfs by "du" varies across multiple builds (usually by a few kb). But the rootfs contents are reproducible. Although this does not affect any functionality, but it does affect reproducibility of artifacts that rely on the calculated rootfs size. Some of the files/directories in the rootfs has different number of blocks allocated and "du" estimates the directory size based on the allocated blocks. The files/directories affected are not always the same across builds. OE-Core uses a custom function to calculate directory size (See [1]) and this patch introduces the use of that function from oe.utils to calculate the directory size. [1] https://github.com/openembedded/openembedded-core/commit/d8f1f3a6b024a2ae6631d1ce25421e8d94b69a12 Signed-off-by: Adithya Balakumar --- meta/classes/image.bbclass | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 982523b0..3e70fe83 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -85,13 +85,10 @@ inherit image-account-extension ROOTFS_EXTRA ?= "64" def get_rootfs_size(d): - import subprocess + import subprocess, oe.utils rootfs_extra = int(d.getVar("ROOTFS_EXTRA")) - output = subprocess.check_output( - ["sudo", "du", "-xs", "--block-size=1k", d.getVar("IMAGE_ROOTFS")] - ) - base_size = int(output.split()[0]) + base_size = int(oe.utils.directory_size(d.getVar("IMAGE_ROOTFS")) / 1024) return base_size + rootfs_extra * 1024