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

    From Robin H. Johnson@21:1/5 to All on Mon Feb 19 23:10:01 2024
    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.: CHECKR
  • From Robin H. Johnson@21:1/5 to Robin H. Johnson on Mon Feb 19 23:20:01 2024
    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 : robbat2@gentoo.org
    GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
    GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2
    Comment: Robbat2 @ Orbis-Terrarum Networks - The text below is a digital signature. If it doesn't make any sense to you, ignore it.

    iQKTBAABCgB9FiEEveu2pS8Vb98xaNkRGTlfI8WIJsQFAmXT0rpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEJE RUJCNkE1MkYxNTZGREYzMTY4RDkxMTE5Mzk1RjIzQzU4ODI2QzQACgkQGTlfI8WI JsS7Yw/9F6uYQwpsjDGBKxalMyj9mSKtgCreYbNmOqalEISpYN29XWV4O/bUfZ67 PqFmWxvJAuRu32TTCT5CJvyatIW6NH3FyZl/RHlnj8iKsjmWGNAXw1uxUiVjJKBJ QBRnJgVNzFg/FiFhbOHECe71ZBl+u46L1KWfgqSDrb/BkRz1Nkp3XP4gInoHfUcl fre8cMN8Pin6lWp3iDUEXf5ObtnPaxILBSqMmD+W7B23XqMaQ0CJcEmtxUZREoDH gBc22TljTNBKI8gXdp/zBPnw5waWodRHUxg0jBDTrkA7XuPqOlti+yjKKjk0uBW5 OYLwHLWZZTjgTdGpJiOdgfnpUiTVifq/2FnzgeOyZG/pf0RvTyidHKyu9e1wJKky
    Xddr0eKo
  • From Sam James@21:1/5 to Robin H. Johnson on Tue Feb 20 05:40:02 2024
    "Robin H. Johnson" <robbat2@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.

    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
    }


    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCZdQs7V8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZAlbgEAic0TUyImiexKuXfKypOcfcRYJDfVmLKu+csv 67lZXagBANyqmdw0lZfqkbgCzweEoTpEt1Ebhb2f1BKKUPw14qAB
    =CqJn
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew Ammerlaan@21:1/5 to Robin H. Johnson on Tue Feb 20 07:00:01 2024
    On 19 February 2024 23:08:32 CET, "Robin H. Johnson" <robbat2@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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Robin H. Johnson on Tue Feb 20 07:20:01 2024
    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


    -----BEGIN PGP SIGNATURE-----

    iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmXUQ6kSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOO0AH/11MPHGADY14LFLUrZ6GK0mhGQfO1JhG XZf7olx3ueEQlV7fkwIyNf5Jsjp69vrQX5I/+wUWQOCcVCXJKdFr3vuKzkFmrayL Bdvv4rLs7fRc/ehzm98A4fjVV1lQWqPYlMqHuYGK5KOCTU8NRcl6YeLTKUzsPvDc WmV5kpAeXGlNEfwQLKfUPEsiEMe7rr2y0bRs2AkLpLFbpqmozr29cvffa5+Y4y2Q Zga6G7xTKhR/bdJHve282Pe5M3uj0uf5jJol7Qb84ZAkJy5zvRVtK2MOsIgpwlC4 Zf8Q5f3aSLID2/FCa1sNVZMtJQDXkjn5pOg+DB6fVG9UKi6UwT61G5o=
    =WjLx
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robin H. Johnson@21:1/5 to All on Mon Feb 26 07:40:01 2024
    Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
    ---
    .../intel-microcode-20231114_p20231114.ebuild | 13 +++++++++++--
    1 file changed, 11 insertions(+), 2 deletions(-)

    diff --git a/sys-firmware/intel-microcode/intel-microcode-20231114_p20231114.ebuild b/sys-firmware/intel-microcode/intel-microcode-20231114_p20231114.ebuild
    index 5d1ff1e7f4be..30aca9ccbecf 100644
    --- a/sys-firmware/intel-microcode/intel-microcode-20231114_p20231114.ebuild +++ b/sys-firmware/intel-microcode/intel-microcode-20231114_p20231114.ebuild
    @@ -3,7 +3,7 @@

    EAPI=8

    -inherit linux-info mount-boot
    +inherit linux-info mount-boot check-reqs

    # Find updates by searching and clicking the first link (hopefully it's the one):
    # https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
    @@ -52,6 +52,9 @@ BDEPEND=">=sys-apps/iucode_tool-2.3"
    # !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586
    RDEPEND="hostonly? ( sys-apps/iucode_tool )"

    +# Plus a /boot check further down that, based on USE=initramfs. +CHECKREQS_DISK_RUNTIME=(
  • From Robin H. Johnson@21:1/5 to All on Mon Feb 26 07:40:01 2024
    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
  • From zzam@gentoo.org@21:1/5 to All on Mon Feb 26 08:10:02 2024
    Am 26.02.24 um 07:31 schrieb Robin H. Johnson:
    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.


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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robin H. Johnson@21:1/5 to zzam@gentoo.org on Mon Feb 26 10:50:01 2024
    On Mon, Feb 26, 2024 at 08:01:28AM +0100, zzam@gentoo.org wrote:
    Am 26.02.24 um 07:31 schrieb Robin H. Johnson:
    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.
    I just summed up the 2 example packages here.

    I do see your concern about the filesystem/mountpoint layout.

    If it's a single /: that needs 850M
    If it's split / and /opt: then it's the listed space in each location.

    Correctly processing this would require converting each of the listed
    check locations to their common mounts, summing the needs, and then
    validating.

    This should be possible with "stat --printf=%m" to resolve any directory
    into it's mountpoint.

    I'll see if it can be done trivially enough for the eclass.

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

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2
    Comment: Robbat2 @ Orbis-Terrarum Networks - The text below is a digital signature. If it doesn't make any sense to you, ignore it.

    iQKTBAABCgB9FiEEveu2pS8Vb98xaNkRGTlfI8WIJsQFAmXcXhFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEJE RUJCNkE1MkYxNTZGREYzMTY4RDkxMTE5Mzk1RjIzQzU4ODI2QzQACgkQGTlfI8WI JsQjmA/+P4f2oCOYOpyFEUhZN7OKKCHxIg0wdZn417QkHR0O1Xq+7gXUcmi9kP12 11+LX5aBO5dM4sXvCjzLF1Ncx3M5a+bVPxbJ8hrvp18WjN6nxTjnRV3LVkvTD/Dy 0Ct6SXb+lxWSslf5z7bBJpuYhiXGI0Rsix6pQDwgeCKkAEH2a7Jy7UuLkQJz6ccS gGN0K216i8EW7C955LaSwQeVhuKtzk591uU7b5NvBVgm9zquLJHTbZLcVtG9hFLC AwgbgC7Wpppuuy0Ve3vXZdyp2i/kBpjNYoVbmN+YbfOykgwx6xVz8vogsa1dvNFM 80ON9xH8hFtXn2T8/naK4eEfTHBUdZc5Ryu/C0yz1jOPt4O+0jKXmlawJqNAbpKt
    MGdrL3+J
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Robin H. Johnson on Mon Feb 26 15:00:01 2024
    On Sun, 2024-02-25 at 22:31 -0800, Robin H. Johnson wrote:
    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

    I'd avoid listing /boot/efi as an example, as /boot is a bit special
    and might need special handling in the eclass. In particular,
    on the system here I have EFI mounted at /boot, so there
    is no /boot/efi.

    A possible generic solution would be to "fall back" from non-existing
    locations to a "higher" directory, assuming they would normally be
    created as subdirectories.

    +# /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

    Considering all the extra logic discussed in this thread, it might be reasonable to implicitly convert CHECKREQS_DISK_* into
    CHECKREQS_DISK_RUNTIME, so they'd share all the solutions discussed.

    So ideally the logic would be something like:

    1. Append CHECKREQS_DISK_* into CHECKREQS_DISK_RUNTIME.

    2. Replace missing paths with the first parent directory that exists.

    3. Replace paths with their respective mount points.

    4. Sum the values corresponding to the same mount point.

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

    Instead of setting them globally, then unsetting, you should use local variables.

    + fi
    +
    [[ -n ${CHECKREQS_DISK_USR} ]] && \
    _check-reqs_disk \
    "${EROOT%/}/usr" \

    --
    Best regards,
    Michał Górny


    -----BEGIN PGP SIGNATURE-----

    iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmXclzMSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOAZIH/Aq0M2qiVq0+edD2kJYZkmKRge2y53YJ VU9ZhJJ137NjZZnwwYD9SlRL3lsMf/QXOUPWClcM3SgLhD8r4ZHp8/3iroJJbJvO 8JhQRHrfOaPKjtbXU5oyAxpoLnHbKL6FTgeZFJ3U8qRatsdjDkD0cjEUzU28QFqG m78J6dqW9BKGxSqxzFNu6id/1AYab5VITlgsDZneOPyr173xE26Zxagl+TAam99A 8bTzuO6MbJVqVY65J8s0LgMlTWABHdAepDe+IdPbFklfEPtpaF1Oy1QxDgZLnF1T HO1LYRph3D58FeMBcKYzD+ZsVrai+KeI9cqs7TLKt0m91KLl6hXY4ms=
    =pZHZ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)