From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7068176960994672640 X-Received: by 2002:a17:907:2a53:b0:6ce:e4fe:3f92 with SMTP id fe19-20020a1709072a5300b006cee4fe3f92mr1185283ejc.389.1645688191920; Wed, 23 Feb 2022 23:36:31 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:c45a:0:b0:410:98bf:fa0c with SMTP id n26-20020aa7c45a000000b0041098bffa0cls553765edr.2.gmail; Wed, 23 Feb 2022 23:36:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYyvwODuIZc2Qo/s/LkCsoaBP2pMOKm+T0+KQgtz7SHAOFsLTMmxAX6Px7maw14I3fwug3 X-Received: by 2002:aa7:cf93:0:b0:40d:e8eb:1dd2 with SMTP id z19-20020aa7cf93000000b0040de8eb1dd2mr1076796edx.441.1645688190977; Wed, 23 Feb 2022 23:36:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645688190; cv=none; d=google.com; s=arc-20160816; b=yzU/v9QkM1j7y1jEOhOjdP0nqUn2Mam0W6+dg6a/D5DKgwMJe50NivB1W2CrmkmYEJ 85AUshM9C/dri+98EdFrETm0BIdl/zk6gD+7PjGWGSofZQt2tLGk48wGl9soEbjZJZ2F DUPf46gaoJDVTVQswdvXJTDNcogByRxz905fX+WidaO0sJGKtAJJvrM2oTk8YrvCx6Q4 CnuOlBELY29mX8fLoa+7hyw3HhmLwbk4CIKtFoPifCmFq7rBtx7hSu4h2qpRAWMeVC3M eVTZBOs1ykBa+XYZlhlcojN+jM2UySXxzpCM14Fk+6FGiHmmgulzZBFblnlotEK/hyV8 gejA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=FlIy3jSz5IvdERaxpWKMGSCo+40NwPJ94vLTxcBp3Nk=; b=sVGStS+L7rC/Q2+jdg5Lhs2hYNOPu8hLL4nRVeAXCNxRICU7a03MBucVCyTFbyshh+ 3tsh+dJ6oeUlTP6Z21jpOhnQhXqzfcq8QwHbtdrqXn92kqq2sCXp8sspUpWjSK6p5RRF np36zi+DUaZTeR4zoC/hIXlABpSHrA+yRfFs/0fyNENhWLHDHGKp27eVPSkjCp7wZT9Z 1iRLWFjHYZ1DFsQhKPKkoAady+SzX+1OgJyxpuZIrU3V5cGQXWyRdp4MMCYp5x9IdSxA P0H+IbP02UM+FqrBpg2XzEuMpw9W1KzQv4iKQD3wGST4QWMB88Wp3kf/lSQf0+RAfG1o GupA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id d13si61729ede.0.2022.02.23.23.36.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Feb 2022 23:36:30 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 21O7aT9b029752 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 Feb 2022 08:36:30 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v2 1/1] sstate: do not keep intermediate sstate files Date: Thu, 24 Feb 2022 08:36:29 +0100 Message-Id: <20220224073629.23717-2-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220224073629.23717-1-ubely@ilbers.de> References: <20220224073629.23717-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED 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-TUID: YDuYXu1PQBOW This saves about 2...5 GiB of disk space per multiconfig depending on package list, cross-build mode, etc. Signed-off-by: Uladzimir Bely --- meta/classes/dpkg-base.bbclass | 7 +++++++ meta/classes/rootfs.bbclass | 7 +++++++ meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index 928856a9..b5090d13 100644 --- a/meta/classes/dpkg-base.bbclass +++ b/meta/classes/dpkg-base.bbclass @@ -253,6 +253,7 @@ dpkg_build_sstate_finalize() { if [ -n "$(find ${DPKG_SSTATE} -maxdepth 1 -name '*.deb' -print -quit)" ]; then ln -f ${DPKG_SSTATE}/*.deb -t ${S}/.. fi + do_dpkg_build_sstate_cleanup } python do_dpkg_build_setscene() { @@ -263,6 +264,12 @@ python do_dpkg_build_setscene() { addtask dpkg_build_setscene do_dpkg_build_setscene[dirs] += "${S}/.." +do_dpkg_build_sstate_cleanup() { + rm -rf ${DPKG_SSTATE} +} + +addtask dpkg_build_sstate_cleanup before do_build after do_dpkg_build + KEEP_INSTALLED_ON_CLEAN ?= "0" CLEANFUNCS += "deb_clean" diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index 2bdb3b6d..0c7b535c 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -305,6 +305,7 @@ do_rootfs_install_sstate_prepare[lockfiles] = "${REPO_ISAR_DIR}/isar.lock" rootfs_install_sstate_finalize() { sudo tar -C ${WORKDIR} -xpf ${ROOTFS_SSTATE}/rootfs.tar + do_rootfs_install_sstate_cleanup } python do_rootfs_install_setscene() { @@ -312,3 +313,9 @@ python do_rootfs_install_setscene() { bb.build.exec_func('rootfs_install_sstate_finalize', d) } addtask do_rootfs_install_setscene + +do_rootfs_install_sstate_cleanup() { + rm -rf ${ROOTFS_SSTATE} +} + +addtask rootfs_install_sstate_cleanup before do_rootfs_postprocess after do_rootfs_install diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index 2f483f5a..16c04bf8 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -408,6 +408,7 @@ bootstrap_sstate_prepare() { bootstrap_sstate_finalize() { sudo tar -C $(dirname "${ROOTFSDIR}") -xpf ${BOOTSTRAP_SSTATE}/bootstrap.tar sudo ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}" + do_bootstrap_sstate_cleanup } python do_bootstrap_setscene() { @@ -418,6 +419,12 @@ python do_bootstrap_setscene() { addtask do_bootstrap_setscene do_bootstrap_setscene[dirs] = "${DEPLOY_DIR_BOOTSTRAP}" +do_bootstrap_sstate_cleanup() { + rm -rf ${BOOTSTRAP_SSTATE} +} + +addtask bootstrap_sstate_cleanup before do_build after do_bootstrap + CLEANFUNCS = "clean_deploy" clean_deploy() { rm -f "${DEPLOY_ISAR_BOOTSTRAP}" -- 2.20.1