Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-dev] [PATCH] check-reqs.eclass: more disk checks

2 views
Skip to first unread message

Robin H. Johnson

unread,
Feb 19, 2024, 5:10:05 PMFeb 19
to
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 <rob...@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
}

--
2.43.0

Robin H. Johnson

unread,
Feb 19, 2024, 5:20:04 PMFeb 19
to
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:
> /opt >=450MB/version
Meta:
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.

--
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation President & Treasurer
E-Mail : rob...@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
signature.asc

Sam James

unread,
Feb 19, 2024, 11:40:05 PMFeb 19
to

"Robin H. Johnson" <rob...@gentoo.org> writes:

> 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
>

LGTM, but give a bit of time for other comments.
signature.asc

Andrew Ammerlaan

unread,
Feb 20, 2024, 1:00:05 AMFeb 20
to


On 19 February 2024 23:08:32 CET, "Robin H. Johnson" <rob...@gentoo.org> 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
>

The problem here is that the kernel is not always installed to /boot. If systemd-boot is used they are installed to the ESP instead, and UKI's go on the ESP as well. The ESP may be mounted at /boot, /efi, /boot/efi or /boot/EFI.

Michał Górny

unread,
Feb 20, 2024, 1:20:03 AMFeb 20
to
On Mon, 2024-02-19 at 22:14 +0000, Robin H. Johnson wrote:
> 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:
> > /opt >=450MB/version
> Meta:
> 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.
>

Precisely what I wanted to say. Instead of adding more variables, let's
add an array and mark the existing vars as legacy.

CHECKREQ_DISK=(
/opt:...
/usr:...
)

However, Andrew's comment poses a bigger problem here.

--
Best regards,
Michał Górny

signature.asc
0 new messages