eclass/mount-boot-utils: Sync with Gentoo

It's from Gentoo commit a9b25945f57ea44213913ed4796582435d011b1a.
This commit is contained in:
Flatcar Buildbot 2025-01-13 07:07:57 +00:00 committed by Krzesimir Nowak
parent 9b7a373a49
commit d02447b9d1

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors # Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# @ECLASS: mount-boot-utils.eclass # @ECLASS: mount-boot-utils.eclass
@ -16,6 +16,18 @@
# This eclass provides the functions used by mount-boot.eclass in an "inherit- # This eclass provides the functions used by mount-boot.eclass in an "inherit-
# safe" way. This allows these functions to be used in other eclasses cleanly. # safe" way. This allows these functions to be used in other eclasses cleanly.
# @ECLASS_VARIABLE: DONT_MOUNT_BOOT
# @USER_VARIABLE
# @DESCRIPTION:
# May be set by the user or an ebuild to completely disable mount checking
# of the /boot partition and the EFI System Partition.
# @ECLASS_VARIABLE: DONT_MOUNT_ESP
# @USER_VARIABLE
# @DESCRIPTION:
# May be set by the user or an ebuild to disable mount checking of the
# EFI System Partition only.
case ${EAPI} in case ${EAPI} in
7|8) ;; 7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
@ -62,7 +74,7 @@ mount-boot_check_status() {
local candidates=( /boot ) local candidates=( /boot )
# If system is booted with UEFI, check for ESP as well # If system is booted with UEFI, check for ESP as well
if [[ -d /sys/firmware/efi ]]; then if [[ -d /sys/firmware/efi && -z ${DONT_MOUNT_ESP} ]]; then
# Use same candidates for ESP as installkernel and eclean-kernel # Use same candidates for ESP as installkernel and eclean-kernel
candidates+=( /efi /boot/efi /boot/EFI ) candidates+=( /efi /boot/efi /boot/EFI )
fi fi