Skip to content

Commit fb97eeb

Browse files
committed
harden ACL installFIPS with explicit addon existence check
Adds a pre-flight check that /boot/acl/uki-addons/fips.addon.efi exists before attempting to install it, producing a clear error message if the source addon is missing. The Packer invocation already runs the script under bash -eux so a missing addon would fail the build either way, but the explicit check yields a much clearer diagnostic than the raw 'install: cannot stat' stderr.
1 parent f85e769 commit fb97eeb

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

vhdbuilder/scripts/linux/acl/tool_installs_acl.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ disableNtpAndTimesyncdInstallChrony() {
3232
installFIPS() {
3333
echo "Installing FIPS..."
3434

35-
install -D -m 0644 \
36-
/boot/acl/uki-addons/fips.addon.efi \
37-
/boot/EFI/Linux/acl.efi.extra.d/fips.addon.efi
35+
local fips_addon_src="/boot/acl/uki-addons/fips.addon.efi"
36+
local fips_addon_dst="/boot/EFI/Linux/acl.efi.extra.d/fips.addon.efi"
37+
38+
if [ ! -f "${fips_addon_src}" ]; then
39+
echo "FIPS addon not found at ${fips_addon_src}" >&2
40+
exit 1
41+
fi
42+
43+
install -D -m 0644 "${fips_addon_src}" "${fips_addon_dst}"
3844

3945
touch /etc/system-fips
4046
chmod 644 /etc/system-fips

0 commit comments

Comments
 (0)