Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adoption failure on Atomic Desktops using BIOS #717

Open
travier opened this issue Sep 5, 2024 · 7 comments · Fixed by #723
Open

Adoption failure on Atomic Desktops using BIOS #717

travier opened this issue Sep 5, 2024 · 7 comments · Fixed by #723
Assignees

Comments

@travier
Copy link
Member

travier commented Sep 5, 2024

Trying to adopt / update an Atomic Desktop using BIOS boot fails:

$ bootupctl adopt-and-update -vvvv
[TRACE bootupd] executing cli
Running as unit: bootupd.service
[TRACE bootupd] executing cli
[TRACE bootupd::bootupd] No saved state
[TRACE bootupd::bootupd] Remaining known components: 2
[TRACE bootupd::bootupd] Not adoptable: BIOS
[DEBUG bootupd::efi] Unmounting
error: Failed to find ESP device

This is on a Fedora Silverblue 41 system, installed from F40, with the latest SELinux policy fixes & bootupd code:

root@fedora:~# rpm-ostree status
State: idle
Deployments:
● fedora:fedora/41/x86_64/silverblue
                  Version: 41.20240903.n.0 (2024-09-03T08:13:22Z)
               BaseCommit: 9c5a385934b5948c1f4bb23a441c7bcd85ed250455d75fbb06a3318c35de1b77
             GPGSignature: Valid signature by 466CF2D8B60BC3057AA9453ED0622462E99D6AD1
           LocalOverrides: bootupd 0.2.20-2.fc41 -> 202409030125.0.2.21.4.g0f3de09-1.fc41
                           selinux-policy selinux-policy-targeted 41.14-1.fc41 -> 41.15-1.20240904174231942019.pr2344.8.g9131c0b7b.fc41

  fedora:fedora/41/x86_64/silverblue
                  Version: 41.20240903.n.0 (2024-09-03T08:13:22Z)
                   Commit: 9c5a385934b5948c1f4bb23a441c7bcd85ed250455d75fbb06a3318c35de1b77
             GPGSignature: Valid signature by 466CF2D8B60BC3057AA9453ED0622462E99D6AD1

  fedora:fedora/40/x86_64/silverblue
                  Version: 40.20240904.0 (2024-09-04T02:12:02Z)
                   Commit: d516f5b47a48e18e2317f9f038656363384b0b880bf9d48cd9686991bb3a8a2d
             GPGSignature: Valid signature by 115DF9AEF857853EE8445D0A0727707EA15B79CC
                   Pinned: yes
@travier
Copy link
Member Author

travier commented Sep 5, 2024

Looks like we never actually implement adoption for BIOS: 870023e (#420)

@HuijingHei HuijingHei self-assigned this Sep 11, 2024
HuijingHei added a commit to HuijingHei/bootupd that referenced this issue Sep 12, 2024
HuijingHei added a commit to HuijingHei/bootupd that referenced this issue Sep 12, 2024
HuijingHei added a commit to HuijingHei/bootupd that referenced this issue Sep 12, 2024
HuijingHei added a commit to HuijingHei/bootupd that referenced this issue Sep 13, 2024
HuijingHei added a commit to HuijingHei/bootupd that referenced this issue Sep 13, 2024
HuijingHei added a commit to HuijingHei/bootupd that referenced this issue Sep 18, 2024
@HuijingHei HuijingHei reopened this Sep 18, 2024
@HuijingHei
Copy link
Member

HuijingHei commented Sep 18, 2024

Look more about the error, find #723 (included in bootupd-202409180258.0.2.21.20.g4c5a514-1.fc41.x86_64) can not fix the issue, boot silverblue rawhide using BIOS and run bootupctl status will also get the error: Failed to find ESP device.

I think the original designation is for hybrid partition layout which supports both BIOS and UEFI booting, so there is no such error for fcos or rhcos.

But for none hybrid partition disk, for example, when booting BIOS, there is no ESP device and so we hit the error.

fedora@fedora:~$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
zram0  251:0    0  3.8G  0 disk [SWAP]
vda    252:0    0   20G  0 disk 
├─vda1 252:1    0    1M  0 part 
├─vda2 252:2    0    1G  0 part /boot
└─vda3 252:3    0   19G  0 part /var/home
                                /var
                                /sysroot/ostree/deploy/fedora/var
                                /usr
                                /etc
                                /
                                /sysroot

fedora@fedora:~$ sudo bootupctl status -vvvvv
[TRACE bootupd] executing cli
Running as unit: bootupd.service
[TRACE bootupd] executing cli
[TRACE bootupd::bootupd] Gathering status for installed component: BIOS
[TRACE bootupd::bootupd] Remaining known components: 1
[DEBUG bootupd::efi] Unmounting
error: Failed to find ESP device

root@fedora:~# ls /dev/disk/by-label/
fedora_fedora

To fix this, on none hybrid partition disk:

  • booting with BIOS, skip gathering UEFI status if ESP device not exists
  • booting with UEFI, skip gathering BIOS status (not sure about the condition)
    Or just update the current boot firmware, but this will also prevent for the hybrid partition layout, maybe not suitable.

@travier any suggestions? Thanks!

@HuijingHei HuijingHei mentioned this issue Sep 18, 2024
41 tasks
@travier
Copy link
Member Author

travier commented Sep 18, 2024

Ideally, bootup would skip updating the EFI if the system is BIOS booted and it can not find an EFI partition.

@cgwalters
Copy link
Member

Yeah, when adopting I think we can gracefully handle the case where we don't find one or the other.

On CoreOS derivatives we could detect that it's a CoreOS and require finding both of them, but honestly at this point that's a real corner case because you'd have to have a really old system to need to go through that path.

@HuijingHei
Copy link
Member

When booting UEFI, also need to skip adopt BIOS if bios_boot partition not found.

root@fedora:/home/fedora# bootupctl adopt-and-update -vvvvv
[TRACE bootupd] executing cli
Running as unit: bootupd.service
[TRACE bootupd] executing cli
[TRACE bootupd::bootupd] No saved state
[TRACE bootupd::bootupd] Remaining known components: 2
[TRACE bootupd::component] No CoreOS aleph detected
[DEBUG bootupd::efi] Reusing existing "/boot/efi"
[TRACE bootupd::efi] No EFI variable LoaderInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
[TRACE bootupd::efi] No EFI variable StubInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
[TRACE bootupd::component] No CoreOS aleph detected
[DEBUG bootupd::efi] Unmounting
[TRACE bootupd::component] No CoreOS aleph detected
Installing for i386-pc platform.
/usr/sbin/grub2-install: warning: ../grub-core/partmap/gpt.c:194:this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
/usr/sbin/grub2-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub2-install: error: will not proceed with blocklists.
error: Failed adopt and update: Failed to run "/usr/sbin/grub2-install" "--target" "i386-pc" "--boot-directory" "/boot" "--modules" "mdraid1x part_gpt" "/dev/vda"

@travier
Copy link
Member Author

travier commented Sep 19, 2024

Ouch, does this means we should not release 0.22.0 in Fedora as that will break EFI setups there?

@HuijingHei
Copy link
Member

Ouch, does this means we should not release 0.22.0 in Fedora as that will break EFI setups there?

I think it is safe for 0.22.0 or 0.22.1, but since 0.22.2 (which includes impl adopt-and-update for BIOS), it will break EFI update for none hybrid partition layout, get the same error when running update, will fix this soon.

root@fedora:/home/fedora# bootupctl update -vvvv
[TRACE bootupd] executing cli
Running as unit: bootupd.service
[TRACE bootupd] executing cli
[TRACE bootupd::bootupd] Gathering status for installed component: EFI
[DEBUG bootupd::efi] Unmounting
[TRACE bootupd::bootupd] Remaining known components: 1
[TRACE bootupd::component] No CoreOS aleph detected
[TRACE bootupd::component] No CoreOS aleph detected
Installing for i386-pc platform.
/usr/sbin/grub2-install: warning: ../grub-core/partmap/gpt.c:194:this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
/usr/sbin/grub2-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub2-install: error: will not proceed with blocklists.
error: Failed adopt and update: Failed to run "/usr/sbin/grub2-install" "--target" "i386-pc" "--boot-directory" "/boot" "--modules" "mdraid1x part_gpt" "/dev/vda"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants