cc_grub_dpkg: preserve existing backup EFI partitions - #7056
Open
sundeep8967 wants to merge 3 commits into
Open
Conversation
When rendering schema property documentation, module_property.tmpl previously appended 'Each object in <name> list supports the following keys:' to all properties with nested properties, regardless of whether the property was an array of items or a single object. Fix module_property.tmpl to distinguish between list types (items) and single object types (properties/patternProperties directly), rendering 'The <name> object supports the following keys:' for object properties. Fixes canonicalGH-7046
Boot deadlocks can occur in the network stage if a cyclic dependency prevents a start job from becoming runnable (e.g. systemd-networkd-wait-online.service). TimeoutSec=0 allows the service to hang indefinitely, rendering the host unbootable. This change imposes a 300s upper bound on the network stage so that if it hangs, the service fails and the boot sequence can continue. Fixes canonicalGH-7052 Signed-off-by: sundeep8967 <sundeep8967@gmail.com>
When the system is set up with multiple EFI System Partitions (ESPs), curtin configures grub-efi/install_devices with multiple partitions. Previously, the grub_dpkg module changed this debconf key to a single device mounted at /boot/efi with the type set to string, which overwrites existing backup ESP partitions and causes them not to be upgraded when the GRUB package is updated. This commit updates get_debconf_config to read existing debconf values using debconf-communicate. If existing devices are found, it merges them with the new device and filters out any devices that no longer exist on the system (which is critical when instantiating from an image). It also changes the debconf type from string to multiselect. Fixes canonicalGH-7045
sundeep8967
force-pushed
the
fix/cc_grub_dpkg-preserve-backup-efi-7045
branch
from
August 30, 2026 01:30
41dc055 to
558b16c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the system is set up with multiple EFI System Partitions (ESPs), for example in a RAID setup, curtin sets up multiple partitions in
grub-efi/install_devices.However,
cc_grub_dpkg.pycurrently fetches only a single device mounted in/boot/efiand overwritesgrub-efi/install_deviceswith it. It also changes the type frommultiselecttostring. This causes backup ESP partition(s) not to be upgraded when the GRUB package is upgraded.Solution
get_existing_idevs()to querydebconf-communicatefor existinginstall_devices.combine_idevs()to merge existing devices with the newly fetched device.os.path.exists()to prune stale disks from instantiated cloud images, ensuring grub doesn't fail on non-existent devices.get_debconf_config()to usemultiselecttype instead ofstring.Fixes #7045
Testing
python3 -m pytest tests/unittests/config/test_cc_grub_dpkg.py