Skip to content

Commit 28bc6b0

Browse files
installkernel: write ifs in full
1 parent 55fb303 commit 28bc6b0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

installkernel

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ updatever() {
108108

109109
cleanup() {
110110
# shellcheck disable=SC2317
111-
[ -n "${INSTALLKERNEL_STAGING_AREA}" ] && rm -rf "${INSTALLKERNEL_STAGING_AREA}"
111+
if [ -n "${INSTALLKERNEL_STAGING_AREA}" ]; then
112+
rm -rf "${INSTALLKERNEL_STAGING_AREA}"
113+
fi
112114
}
113115

114116
trap cleanup EXIT
@@ -205,8 +207,12 @@ uki=${INSTALLKERNEL_STAGING_AREA}/uki.efi
205207

206208
# Copy kernel and prebuilt initrd, uki.efi at kernel location
207209
cp "${img}" "${kernel}"
208-
[ -f "${prebuilt_initrd}" ] && cp "${prebuilt_initrd}" "${initrd}"
209-
[ -f "${prebuilt_uki}" ] && cp "${prebuilt_uki}" "${uki}"
210+
if [ -f "${prebuilt_initrd}" ]; then
211+
cp "${prebuilt_initrd}" "${initrd}"
212+
fi
213+
if [ -f "${prebuilt_uki}" ]; then
214+
cp "${prebuilt_uki}" "${uki}"
215+
fi
210216

211217
# If installing in the usual directory, run the same scripts that hook
212218
# into kernel package installation. Also make sure the PATH includes

0 commit comments

Comments
 (0)