Allow checking more disk space, for users with many split volumes and ever-larger packages.Meta:
gentoo-kernel-bin:
/ >=350MB/version (in /lib/modules)
/boot >=40MB/version
rust-bin:
/opt >=450MB/version
Allow checking more disk space, for users with many split volumes and ever-larger packages.
gentoo-kernel-bin:
/ >=350MB/version (in /lib/modules)
/boot >=40MB/version
rust-bin:
/opt >=450MB/version
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
---
eclass/check-reqs.eclass | 44 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index fac2f4553d74..7b65f44e8c41 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -24,12 +24,21 @@
# # need this much temporary build space
# CHECKREQS_DISK_BUILD="2G"
#
+# # install will need this much space in /
+# CHECKREQS_DISK_ROOT="1G"
+#
+# # install will need this much space in /boot
+# CHECKREQS_DISK_BOOT="128M"
+#
# # install will need this much space in /usr
# CHECKREQS_DISK_USR="1G"
#
# # install will need this much space in /var
# CHECKREQS_DISK_VAR="1024M"
#
+# # install will need this much space in /opt
+# CHECKREQS_DISK_OPT="1G"
+#
# @CODE
#
# If you don't specify a value for, say, CHECKREQS_MEMORY, then the test is not
@@ -56,6 +65,16 @@ _CHECK_REQS_ECLASS=1
# @DESCRIPTION:
# How much diskspace is needed to build the package? Eg.: CHECKREQS_DISK_BUILD=2T
+# @ECLASS_VARIABLE: CHECKREQS_DISK_ROOT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# How much space in / is needed to install the package? Eg.: CHECKREQS_DISK_ROOT=1G
+
+# @ECLASS_VARIABLE: CHECKREQS_DISK_BOOT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# How much space in /boot is needed to install the package? Eg.: CHECKREQS_DISK_BOOT=128M
+
# @ECLASS_VARIABLE: CHECKREQS_DISK_USR
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -66,6 +85,11 @@ _CHECK_REQS_ECLASS=1
# @DESCRIPTION:
# How much space is needed in /var? Eg.: CHECKREQS_DISK_VAR=3000M
+# @ECLASS_VARIABLE: CHECKREQS_DISK_OPT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# How much space is needed in /opt? Eg.: CHECKREQS_DISK_OPT=1G
+
# @ECLASS_VARIABLE: CHECKREQS_DONOTHING
# @USER_VARIABLE
# @DEFAULT_UNSET
@@ -121,8 +145,11 @@ _check-reqs_prepare() {
if [[ -z ${CHECKREQS_MEMORY} &&
-z ${CHECKREQS_DISK_BUILD} &&
+ -z ${CHECKREQS_DISK_ROOT} &&
+ -z ${CHECKREQS_DISK_BOOT} &&
-z ${CHECKREQS_DISK_USR} &&
- -z ${CHECKREQS_DISK_VAR} ]]; then
+ -z ${CHECKREQS_DISK_VAR} &&
+ -z ${CHECKREQS_DISK_OPT} ]]; then
eerror "Set some check-reqs eclass variables if you want to use it."
eerror "If you are user and see this message file a bug against the package."
die "${FUNCNAME}: check-reqs eclass called but not actually used!"
@@ -161,6 +188,16 @@ _check-reqs_run() {
fi
if [[ ${MERGE_TYPE} != buildonly ]]; then
+ [[ -n ${CHECKREQS_DISK_ROOT} ]] && \
+ _check-reqs_disk \
+ "${EROOT%/}/" \
+ "${CHECKREQS_DISK_ROOT}"
+
+ [[ -n ${CHECKREQS_DISK_BOOT} ]] && \
+ _check-reqs_disk \
+ "${EROOT%/}/boot" \
+ "${CHECKREQS_DISK_BOOT}"
+
[[ -n ${CHECKREQS_DISK_USR} ]] && \
_check-reqs_disk \
"${EROOT%/}/usr" \
@@ -170,6 +207,11 @@ _check-reqs_run() {
_check-reqs_disk \
"${EROOT%/}/var" \
"${CHECKREQS_DISK_VAR}"
+
+ [[ -n ${CHECKREQS_DISK_OPT} ]] && \
+ _check-reqs_disk \
+ "${EROOT%/}/opt" \
+ "${CHECKREQS_DISK_OPT}"
fi
}
Allow checking more disk space, for users with many split volumes and >ever-larger packages.
gentoo-kernel-bin:
/ >=350MB/version (in /lib/modules)
/boot >=40MB/version
On Mon, Feb 19, 2024 at 02:08:32PM -0800, Robin H. Johnson wrote:
Allow checking more disk space, for users with many split volumes and ever-larger packages.
gentoo-kernel-bin:
/ >=350MB/version (in /lib/modules)
/boot >=40MB/version
rust-bin:Meta:
/opt >=450MB/version
Is this the time where we should rethink the CHECKREQS syntax?
CHECKREQS_DISK="/:2G /opt/random:1G /usr:1G" etc?
If we need to support paths with space, newline or array here.
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 <robbat2@gentoo.org>
---
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" \
Am 26.02.24 um 07:31 schrieb Robin H. Johnson:I just summed up the 2 example packages here.
Allow checking any runtime path for installing ever-larger packages.
CHECKREQS_DISK_RUNTIME=( /boot:40M /:350M /opt:500M )
In the example case: Shouldn't the eclass check for 850M on / if /opt is
not a separate partition?
I am not sure how often it really happens that multiple large
requirements for different folders exist.
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 <robbat2@gentoo.org>
---
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" \
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 491 |
Nodes: | 16 (2 / 14) |
Uptime: | 82:50:13 |
Calls: | 9,679 |
Calls today: | 3 |
Files: | 13,722 |
Messages: | 6,173,299 |
Posted today: | 3 |