Skip to content

Commit

Permalink
🐛 Merge grub yip config (#1426)
Browse files Browse the repository at this point in the history
With yip 1.x things can run at the same level as its now using a DAG.
Problem is with the grub stuff it was 2 files trying to mount and
unmount the state dir. That worked as expected before as it run one
after the other but now they can run in parallel as they dont depend on
each other.

This PR merges both configs into one to avoid mount/umount several times
and because both deal with grub stuff.

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka authored and mauromorales committed Jun 30, 2023
1 parent 2a5debc commit aaee0e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# - If we get back again at the GRUB menu, a failure must have occurred and we select the fallback entry, creating also
# sentinels files and a specific cmdline option indicating we failed booting after an upgrade

name: "Boot assessment"
name: "Boot assessment and branding"
stages:
boot.before:
# Remove any grub sentinel and add
Expand Down Expand Up @@ -40,6 +40,7 @@ stages:
group: 0
after-install:
# After install, reset, and upgrade, we install additional GRUB configuration for boot assessment into COS_STATE.
# We also add any branding that exists

- &statemount
name: "Mount state"
Expand Down Expand Up @@ -97,11 +98,15 @@ stages:
fi
fi
fi
- &grubinstall
name: "Grub branding"
if: '[ -e "/etc/kairos/branding/grubmenu.cfg" ]'
commands:
- cp -rfv /etc/kairos/branding/grubmenu.cfg /tmp/mnt/STATE/grubmenu
- &stateumount
name: "umount state"
commands:
- |
umount /tmp/mnt/STATE
- umount /tmp/mnt/STATE

# Here we do enable boot assessment for the next bootup.
# Similarly, we could trigger boot assessment in other cases
Expand All @@ -113,12 +118,14 @@ stages:
grub2-editenv /tmp/mnt/STATE/boot_assessment set enable_boot_assessment=yes
# We do re-install hooks here if needed to track upgrades of boot assessment
- <<: *customhook
- <<: *grubinstall
- <<: *bootgrub
- <<: *stateumount

after-reset:
- <<: *statemount
# Reset completely restores COS_STATE, so we re-inject ourselves
- <<: *customhook
- <<: *grubinstall
- <<: *bootgrub
- <<: *stateumount
18 changes: 0 additions & 18 deletions overlay/files/system/oem/21_grub.yaml

This file was deleted.

0 comments on commit aaee0e7

Please sign in to comment.