Skip to content

cfs/boot: Handle separate /boot mount - #2440

Open
Johan-Liebert1 wants to merge 1 commit into
bootc-dev:mainfrom
Johan-Liebert1:issue-2399
Open

cfs/boot: Handle separate /boot mount#2440
Johan-Liebert1 wants to merge 1 commit into
bootc-dev:mainfrom
Johan-Liebert1:issue-2399

Conversation

@Johan-Liebert1

Copy link
Copy Markdown
Collaborator

If /boot is mounted as XBOOTLDR partition then grub configs are stored there as we were unconditionally searching for grub configs in /sysroot/boot, which would fail every time. Fix this by checking if /boot is a mountpoint and then checking if we have grub configs in there.

This is only an issue with Grub as GrubCC and SystemdBoot both do not store anything inside of /sysroot/boot and will (should) always have the ESP mounted at /boot

Closes: #2399

If /boot is mounted as XBOOTLDR partition then grub configs are stored
there as we were unconditionally searching for grub configs in
`/sysroot/boot`, which would fail every time. Fix this by checking if
`/boot` is a mountpoint and then checking if we have grub configs in
there.

This is only an issue with Grub as GrubCC and SystemdBoot both do not
store anything inside of `/sysroot/boot` and will (should) always have
the ESP mounted at /boot

Closes: bootc-dev#2399

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
@cgwalters

Copy link
Copy Markdown
Collaborator

will (should) always have the ESP mounted at /boot

Actually won't it be at /efi if that dir exists? We need to handle that

@Johan-Liebert1

Copy link
Copy Markdown
Collaborator Author

Oh, you're right, that's the case with both ESP and XBOOTLDR. So this needs to be updated for the other two bootloaders as well. I'll add that

@Johan-Liebert1

Copy link
Copy Markdown
Collaborator Author

So this isn't actually an issue for us since we manually search for the ESP and temp mount it to get a handle. Trying the following setup, everything works as intended

[root@fedora boot]# findmnt /boot
TARGET SOURCE    FSTYPE OPTIONS
/boot  systemd-1 autofs rw,relatime,fd=89,pgrp=1,timeout=120,minproto=5,maxproto=5,direct,pipe_ino=9419
/boot  /dev/vda2 ext4   ro,relatime,seclabel

[root@fedora boot]# findmnt /efi
TARGET SOURCE    FSTYPE OPTIONS
/efi   systemd-1 autofs rw,relatime,fd=94,pgrp=1,timeout=120,minproto=5,maxproto=5,direct,pipe_ino=9447
/efi   /dev/vda1 vfat   rw,nosuid,nodev,noexec,relatime,nosymfollow,fmask=0177,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro
[root@fedora boot]# fdisk -l
Disk /dev/vda: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 78C1B509-AC00-4417-ADB9-8B2C1E481990

Device       Start      End  Sectors Size Type
/dev/vda1     2048  2099199  2097152   1G EFI System
/dev/vda2  2099200  4196351  2097152   1G Linux extended boot
/dev/vda3  4196352 20969471 16773120   8G Linux root (x86-64)
[root@fedora boot]# bootc status
[  240.313722] EXT4-fs (vda3): re-mounted df0fd0e2-f9f1-4e2d-b90f-515d284dde04.
● Booted image: localhost/bootc-bls
        Digest: sha256:026acb94e25c5b9a4c2f45a790377f8699434df90be3d033b6f1652cfaa524e3 (amd64)
        Verity: 641f49373ed6d35f6b274d8e8216ba39e63aa4378d150f404a09ba54f200f46241b1a72639b966513912da3715c3258f9259c345168bfe1909d5ce98f2cbc718
       Version: 44.20260908.0 (2026-09-09T03:29:24Z)

@Johan-Liebert1

Copy link
Copy Markdown
Collaborator Author

Also, currently, we just put everything in the ESP (for SystemdBoot and GrubCC) so I don't think this would be an issue for us. @cgwalters hope I'm not missing some use case here?

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 this pull request may close these issues.

Native composefs with a separate boot filesystem does not make it available at /sysroot/boot

2 participants