Skip to content

Commit

Permalink
fix(fips): do not blindly remove /boot
Browse files Browse the repository at this point in the history
The `mount_boot` method called from fips-noboot.sh in the pre-pivot hook blindly
executes `rm -rf /boot` if there is no `boot=` command line parameter, without
first checking that /boot is not already mounted by other means.
  • Loading branch information
aafeijoo-suse authored and johannbg committed Feb 13, 2023
1 parent c95075e commit 1fabbb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules.d/01fips/fips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mount_boot() {
mkdir -p /boot
fips_info "Mounting $boot as /boot"
mount -oro "$boot" /boot || return 1
elif [ -d "$NEWROOT/boot" ]; then
elif ! ismounted /boot && [ -d "$NEWROOT/boot" ]; then
# shellcheck disable=SC2114
rm -fr -- /boot
ln -sf "$NEWROOT/boot" /boot
Expand Down

0 comments on commit 1fabbb6

Please sign in to comment.