bootc install to-filesystem uses the wrong efi partition
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 230
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 38
Description
I'm running `bootc install to-filesystem /mnt`. I am doing this with the composefs backend, but the same issue occurs on both composefs and ostree. The mount structure I have is as follows:
- /dev/sda4 (btrfs): /mnt
- /dev/sda3 (vfat): /mnt/boot/efi
My partitions overall look like this:
- /dev/sda1: vfat, type EFI System
- /dev/sda2: btrfs, type Linux filesystem
- /dev/sda3: vfat, type EFI System
- /dev/sda4: btrfs, type Linux filesystem
When I run the `bootc install to-filesystem` command, it completes successfully, but it doesn't populate `/mnt/boot/efi` at all (/dev/sda3). That's because it's actually populating /dev/sda1, which is a completely different EFI partition. This means that it is creating boot entries and installing systemd-boot to a partition that is **not mounted under the directory that i invoked `bootc install to-filesystem` on.** This is very bad.
When I set the type of `/dev/sda1` to anything that isn't EFI System and then run `bootc install to-filesystem`, it uses the correct filesystem. My assumption was that whatever EFI partition was mounted in the directory that I invoked `bootc install to-filesystem` on would be used, since it requires that you mount the EFI partition `boot/efi` in advance. Instead what happens is it uses the first available partition on the same disk that has its type set to `EFI System`.
Contributor guide
Assessment
This issue has not been assessed yet.