Skip to content

Commit f222b05

Browse files
installkernel: also relocate if $4 is set to default
Signed-off-by: Andrew Ammerlaan <[email protected]>
1 parent 58e9984 commit f222b05

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

installkernel

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,18 @@ export INSTALLKERNEL_INITRD_GENERATOR
138138
export INSTALLKERNEL_UKI_GENERATOR
139139

140140
suffix=
141-
if [ "${INSTALLKERNEL_LAYOUT}" = efistub ] && [ ${#} -le 3 ]; then
142-
# Relocate to ESP
143-
for candidate in /boot/EFI /boot/efi /boot /efi; do
144-
if [ -d ${candidate}/EFI/Gentoo ]; then
145-
dir=${candidate}/EFI/Gentoo
146-
suffix=.efi
147-
else
148-
continue
149-
fi
150-
done
141+
if [ "${INSTALLKERNEL_LAYOUT}" = efistub ]; then
142+
if [ ${#} -le 3 ] || [ "${4}" = "/boot" ]; then
143+
# Relocate to ESP
144+
for candidate in /boot/EFI /boot/efi /boot /efi; do
145+
if [ -d ${candidate}/EFI/Gentoo ]; then
146+
dir=${candidate}/EFI/Gentoo
147+
suffix=.efi
148+
else
149+
continue
150+
fi
151+
done
152+
fi
151153
fi
152154

153155
# If installing in the usual directory, run the same scripts that hook
@@ -189,7 +191,7 @@ fi
189191
# If we found a uki.efi, install it instead of kernel+initrd
190192
if [ -f "${uki}" ] && [ "${INSTALLKERNEL_LAYOUT}" = uki ]; then
191193
suffix=.efi
192-
if [ ${#} -le 3 ]; then
194+
if [ ${#} -le 3 ] || [ "${4}" = "/boot" ]; then
193195
# Relocate to ESP
194196
for candidate in /boot/EFI /boot/efi /boot /efi; do
195197
if [ -d ${candidate}/EFI/Linux ]; then

0 commit comments

Comments
 (0)