Skip to content

cc_grub_dpkg: preserve existing backup EFI partitions - #7056

Open
sundeep8967 wants to merge 3 commits into
canonical:mainfrom
sundeep8967:fix/cc_grub_dpkg-preserve-backup-efi-7045
Open

cc_grub_dpkg: preserve existing backup EFI partitions#7056
sundeep8967 wants to merge 3 commits into
canonical:mainfrom
sundeep8967:fix/cc_grub_dpkg-preserve-backup-efi-7045

Conversation

@sundeep8967

Copy link
Copy Markdown
Contributor

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.py currently fetches only a single device mounted in /boot/efi and overwrites grub-efi/install_devices with it. It also changes the type from multiselect to string. This causes backup ESP partition(s) not to be upgraded when the GRUB package is upgraded.

Solution

  • Added get_existing_idevs() to query debconf-communicate for existing install_devices.
  • Added combine_idevs() to merge existing devices with the newly fetched device.
  • Filtered merged devices against os.path.exists() to prune stale disks from instantiated cloud images, ensuring grub doesn't fail on non-existent devices.
  • Updated get_debconf_config() to use multiselect type instead of string.

Fixes #7045

Testing

  • python3 -m pytest tests/unittests/config/test_cc_grub_dpkg.py
  • All tests passed cleanly.

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>
@github-actions github-actions Bot added the documentation This Pull Request changes documentation label Aug 30, 2026
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
sundeep8967 force-pushed the fix/cc_grub_dpkg-preserve-backup-efi-7045 branch from 41dc055 to 558b16c Compare August 30, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation This Pull Request changes documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grub_dpkg removes configs with backup EFI partitions in grub-efi/install_devices debconf key

1 participant