Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure /run/elemental/efi is RW for upgrades #1976

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@ stages:
# enable_boot_assessment to 'yes'.
# This can be then customized easily by having a cloud-config file which always enables boot assessment on
# the boot stage.
- &remountEFIrw
name: "Mounting EFI as RW"
if: 'mountpoint -q /run/elemental/efi'
commands:
- mount -o rw,remount /run/elemental/efi
- name: "Remove GRUB sentinels"
if: '[ -f "/run/elemental/active_mode" ]'
commands:
- |
mount -o rw,remount /run/elemental/efi
grub2-editenv /run/elemental/efi/boot_assessment set enable_boot_assessment=
grub2-editenv /run/elemental/efi/boot_assessment set boot_assessment_tentative=
mount -o ro,remount /run/elemental/efi
- &remountEFIro
name: "Mounting EFI as RO"
if: 'mountpoint -q /run/elemental/efi'
commands:
- mount -o ro,remount /run/elemental/efi
- name: "Create upgrade failure sentinel if necessary"
if: cat /proc/cmdline | grep -q "upgrade_failure"
files:
Expand Down Expand Up @@ -88,6 +96,7 @@ stages:
# Here we do enable boot assessment for the next bootup.
# Similarly, we could trigger boot assessment in other cases
after-upgrade:
- <<: *remountEFIrw
- name: "Set upgrade sentinel on active"
if: '[ ! -f "/run/elemental/recovery_mode" ]'
commands:
Expand All @@ -99,8 +108,10 @@ stages:
# We do re-install hooks here if needed to track upgrades of boot assessment
- <<: *customhook
- <<: *bootgrub
- <<: *remountEFIro

after-reset:
- <<: *remountEFIrw
- name: "Remove GRUB sentinels"
commands:
- |
Expand All @@ -109,3 +120,4 @@ stages:
# Reset completely restores COS_STATE, so we re-inject ourselves
- <<: *customhook
- <<: *bootgrub
- <<: *remountEFIro
Loading