@@ -19,7 +19,14 @@ if [ "${SYSTEMD_KERNEL_INSTALL}" = "1" ] && command -v kernel-install >/dev/null
1919 # in the same way we do here. We could use "exec -a ${0} .. ${@}" for this,
2020 # but the -a argument is not POSIX, only bash.
2121 # TODO: maybe revisit this if we ever bashify the script.
22- exec kernel-install add --verbose " ${1} " " ${2} "
22+ if [ ${# } -le 3 ] || [ " ${4} " = " /boot" ]; then
23+ # kernel-install does not support relocation (ignores $4, see manual)
24+ exec kernel-install add --verbose " ${1} " " ${2} "
25+ else
26+ echo " WARNING: A custom installation directory is specified as fourth argument."
27+ echo " WARNING: Systemd kernel-install does not support this. Falling back"
28+ echo " WARNING: to legacy installkernel. SYSTEMD_KERNEL_INSTALL is ignored."
29+ fi
2330fi
2431
2532set -e
@@ -160,6 +167,7 @@ if [ "${INSTALLKERNEL_LAYOUT}" = efistub ]; then
160167 echo " Found vendor directory on ESP"
161168 dir=${candidate} /EFI/${NAME}
162169 suffix=.efi
170+ # backwards compatibility
163171 if [ -f " /boot/intel-uc.img" ]; then
164172 cp " /boot/intel-uc.img" " ${dir} /intel-uc.img"
165173 fi
@@ -203,6 +211,10 @@ if [ ${#} -le 3 ] || [ "${4}" = "/boot" ]; then
203211 echo " "
204212 done
205213 )
214+ else
215+ echo " WARNING: A custom installation directory is specified as fourth argument."
216+ echo " WARNING: In this configuration running installation hooks is not supported."
217+ echo " WARNING: All pre-installation hooks are ignored."
206218fi
207219
208220# use the same input path as /usr/lib/kernel/install.d/50-dracut.install
@@ -283,6 +295,10 @@ if [ ${#} -le 3 ] || [ "${4}" = "/boot" ]; then
283295 echo " "
284296 done
285297 )
298+ else
299+ echo " WARNING: A custom installation directory is specified as fourth argument."
300+ echo " WARNING: In this configuration running installation hooks is not supported."
301+ echo " WARNING: All post-installation hooks are ignored."
286302fi
287303
288304exit 0
0 commit comments