canonical / canonical/cloud-init

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

Open
#7,045 0 comments 0 reactions 0 assignees View on GitHub
bug new
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

# Bug report
When the system is set up with multiple EFI System Partitions (ESPs), for example, RAID setup, curtin sets up multiple partitions in `grub-efi/install_devices`.

However, grub_dpkg module changes `grub-efi/install_devices` to single device mounted in `/boot/efi`, which can then cause backup ESP partition(s) not to be upgraded when GRUB package is upgraded.

The type of the debconf field `grub-efi/install_devices` is also changed from `multiselect` to `string`.

Note that, the backup EFI partitions feature is Ubuntu specific, and does not exist in Debian. I am not sure whether we should note it but not to handle this issue, as simply disabling this module can avoid this problem.

## Steps to reproduce the problem
* Have a multiple disk system, install Ubuntu Server 24.04 LTS with multiple boot drives
* After installation, run `debconf-show grub-efi-amd64` (or equivalent), ensure in `grub-efi/install_devices` two partitions in `/dev/disks/by-id` are listed
* Provision the system with cloud-init once, run `debconf-show grub-efi-amd64` again

Expected:
* The latter should return 2 partitions

Actual:
* The latter returns single partition currently mounted in `/boot/efi`

## Environment details
- Cloud-init version: 26.1-0ubuntu1~24.04.1
- Operating System Distribution: Ubuntu 24.04 LTS
- Cloud provider, platform or installer type: NoCloud

## cloud-init logs
```
cc_grub_dpkg.py[DEBUG]: considering these device symlinks: /dev/disk/by-label/boot,...,
/dev/disk/by-id/nvme-Micron_7450_MTFDKBA480TFR_254954CD71E8-part1,
/dev/disk/by-id/nvme-Micron_7450_MTFDKBA480TFR_254954CD71E8_1-part1,
/dev/disk/by-id/nvme-eui.000000000000000100a0752554cd71e8-part1
cc_grub_dpkg.py[DEBUG]: filtered to these disk/by-id symlinks:
cc_grub_dpkg.py[DEBUG]: selected /dev/disk/by-id/nvme-Micron_7450_MTFDKBA480TFR_254954CD71E8-part1
cc_grub_dpkg.py[DEBUG]: Setting grub debconf-set-selections with
'grub-pc grub-efi/install_devices string /dev/disk/by-id/nvme-Micron_...CD71E8-part1
```

Contributor guide

Open the contributing guide

Research direction

Start with the grub_dpkg module and its cc_grub_dpkg.py log output, then reproduce the issue with debconf-show grub-efi-amd64 on a multiple-ESP Ubuntu system. Trace how grub-efi/install_devices is selected and written. Done means backup ESP entries remain listed and the debconf field remains a multiselect rather than becoming a single string.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.