From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C5DA9158041 for ; Mon, 26 Feb 2024 06:31:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2A517E29CC; Mon, 26 Feb 2024 06:31:12 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D460AE29C9 for ; Mon, 26 Feb 2024 06:31:11 +0000 (UTC) Received: from grubbs.orbis-terrarum.net (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F338E33BEEB for ; Mon, 26 Feb 2024 06:31:10 +0000 (UTC) Received: from grubbs.orbis-terrarum.net (localhost [127.0.0.1]) by grubbs.orbis-terrarum.net (Postfix) with ESMTP id 59B5A2601A2 for ; Mon, 26 Feb 2024 06:31:10 +0000 (UTC) Received: (qmail 2690 invoked by uid 129); 26 Feb 2024 06:31:10 -0000 X-HELO: bohr-int.orbis-terrarum.net Authentication-Results: orbis-terrarum.net; auth=pass (plain) smtp.auth=robbat2-bohr@orbis-terrarum.net; iprev=pass Received: from d206-116-35-168.bchsia.telus.net (HELO bohr-int.orbis-terrarum.net) (206.116.35.168) by orbis-terrarum.net (qpsmtpd/0.95) with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted); Mon, 26 Feb 2024 06:31:10 +0000 Received: (nullmailer pid 1802 invoked by uid 10000); Mon, 26 Feb 2024 06:31:08 -0000 From: "Robin H. Johnson" To: gentoo-dev@lists.gentoo.org Cc: "Robin H. Johnson" Subject: [gentoo-dev] [PATCH v2 1/2] check-reqs.eclass: runtime disk checks for any path. Date: Sun, 25 Feb 2024 22:31:03 -0800 Message-ID: <20240226063105.1767-1-robbat2@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240219220832.25919-1-robbat2@gentoo.org> References: <20240219220832.25919-1-robbat2@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on orbis-terrarum.net X-Archives-Salt: ae73abce-9424-4a60-8d3f-f2d8fd884bae X-Archives-Hash: b92d0b9577f30b2d0a89b7825a2d74bd Allow checking any runtime path for installing ever-larger packages. CHECKREQS_DISK_RUNTIME=( /boot:40M /:350M /opt:500M ) Recent example of large packages: gentoo-kernel-bin: / >=350MB/version (in /lib/modules) /boot >=40MB/version rust-bin: /opt >=450MB/version Signed-off-by: Robin H. Johnson --- eclass/check-reqs.eclass | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass index fac2f4553d74..1c59c69489a9 100644 --- a/eclass/check-reqs.eclass +++ b/eclass/check-reqs.eclass @@ -30,6 +30,13 @@ # # install will need this much space in /var # CHECKREQS_DISK_VAR="1024M" # +# # install will need this much space in listed paths. +# CHECKREQS_DISK_RUNTIME=( +# /var:1G +# /boot/efi:32M +# /opt/giant-package-with-dedicated-disk:100G +# ) +# # @CODE # # If you don't specify a value for, say, CHECKREQS_MEMORY, then the test is not @@ -66,6 +73,11 @@ _CHECK_REQS_ECLASS=1 # @DESCRIPTION: # How much space is needed in /var? Eg.: CHECKREQS_DISK_VAR=3000M +# @ECLASS_VARIABLE: CHECKREQS_DISK_RUNTIME +# @DEFAULT_UNSET +# @DESCRIPTION: +# How much space is needed in paths? Eg.: CHECKREQS_DISK_RUNTIME=( /:1G /var:5G ) + # @ECLASS_VARIABLE: CHECKREQS_DONOTHING # @USER_VARIABLE # @DEFAULT_UNSET @@ -120,6 +132,7 @@ _check-reqs_prepare() { debug-print-function ${FUNCNAME} "$@" if [[ -z ${CHECKREQS_MEMORY} && + "${#CHECKREQS_DISK_RUNTIME[@]}" -eq 0 && -z ${CHECKREQS_DISK_BUILD} && -z ${CHECKREQS_DISK_USR} && -z ${CHECKREQS_DISK_VAR} ]]; then @@ -161,6 +174,16 @@ _check-reqs_run() { fi if [[ ${MERGE_TYPE} != buildonly ]]; then + if [[ "${#CHECKREQS_DISK_RUNTIME[@]}" -gt 0 ]]; then + for _path_size in "${CHECKREQS_DISK_RUNTIME[@]}"; do + _path=${_path_size/:*} + _size=${_path_size/*:} + _check-reqs_disk \ + "${EROOT%/}${_path}" "${_size}" + done + unset _path_size _path _size + fi + [[ -n ${CHECKREQS_DISK_USR} ]] && \ _check-reqs_disk \ "${EROOT%/}/usr" \ -- 2.43.0