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

CentOS 9 grub cannot find kernel #59

Open
lttlrck opened this issue Sep 10, 2024 · 10 comments
Open

CentOS 9 grub cannot find kernel #59

lttlrck opened this issue Sep 10, 2024 · 10 comments

Comments

@lttlrck
Copy link

lttlrck commented Sep 10, 2024

Hi,

If I enable --bootloader grub-bios this happens:

image

It's looking in a non-existent path. Any ideas where I could look?

Thanks.

@lttlrck
Copy link
Author

lttlrck commented Sep 10, 2024

Also if I run without --bootloader grub-bios and boot the VM then install grub manually and reboot I get exactly the same issue. So it seems there is something dragged into the VM from the docker environment? It's very strange.

@lttlrck
Copy link
Author

lttlrck commented Sep 10, 2024

here is the source:

image

@Adphi
Copy link
Member

Adphi commented Sep 10, 2024

Hello @lttlrck !

I cannot reproduce using the main branch:

d2vm convert quay.io/centos/centos:stream9 --bootloader grub-bios -o centos-stream.qcow2 -v --force
d2vm run qemu --mem 4096 --cpus 4 centos-stream.qcow2
Using existing disk [images/centos-stream.qcow2] format
SeaBIOS (version 1.13.0-1ubuntu1.1)
Machine UUID e9da08a1-8081-4c66-9376-b235f295e37b


iPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+7FF8C730+7FECC730 CA00



Booting from Hard Disk...
GRUB loading..
Welcome to GRUB!
  Booting `CentOS Stream (5.14.0-505.el9.x86_64) 9'

Probing EDD (edd=off to disable)... ok
[    0.000000] Linux version 5.14.0-505.el9.x86_64 ([email protected]
[    0.000000] The list of certified hardware and cloud instances for Red Hat Enterprise .
[    0.000000] Command line: BOOT_IMAGE=(hd0,msdos1)/boot/vmlinuz-5.14.0-505.el9.x86_64 r8
[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007ffdefff] usable
[    0.000000] BIOS-e820: [mem 0x000000007ffdf000-0x000000007fffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000b0000000-0x00000000bfffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fed1c000-0x00000000fed1ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000017fffffff] usable
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] APIC: Static calls initialized
[    0.000000] SMBIOS 2.8 present.
[    0.000000] DMI: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014
...

Can you share the Dockerfile please ?

@lttlrck
Copy link
Author

lttlrck commented Sep 10, 2024

I cannot share my dockerfile but it is:

FROM quay.io/centos/centos:stream9-minimal

# lots of regular dnf install, nothing that touches /boot/ or grub. no kernel installs.

I should try an empty dockerfile

I worked around the issue by adding this to the centos template, which is horrible and fragile:

{{- if .GrubBIOS }}
RUN sed -i 's#/root/var/lib/docker/btrfs/subvolumes/[0-9a-f]*##' /boot/loader/entries/*
{{- end }}

@Adphi
Copy link
Member

Adphi commented Sep 10, 2024

Is it possible that one of the dnf contains a vmlinuz which would then be discovered by grub ?

@lttlrck
Copy link
Author

lttlrck commented Sep 10, 2024

I don't think so.

image

As it is my hosts docker volume path leaking in, maybe this is an environment issue. Something strange with my dev environment/docker install.

@Adphi
Copy link
Member

Adphi commented Sep 10, 2024

Can you run find / -name 'vmlinuz*' inside the vm please ?

@lttlrck
Copy link
Author

lttlrck commented Sep 10, 2024

the full docker image, converted to QCOW2, without --bootloader:

image


with a dockerfile containing only:

FROM quay.io/centos/centos:stream9-minimal

it boots ok. So something in my dockerfile is causing an issue.

I will try to track it down, and report back if I find it.

@Adphi
Copy link
Member

Adphi commented Sep 10, 2024

You will not find it without the --bootloader grub-bios. Due to the following lines, it will be moved to /boot/vmlinuz:

{{- if not .Grub }}
RUN cd /boot && \
mv $(find {{ if le $version 8 }}.{{ else }}/{{ end }} -name 'vmlinuz*') /boot/vmlinuz && \
mv $(find . -name 'initramfs-*.img') /boot/initrd.img
{{- end }}

Can you run the find command directly in your container image ?

@lttlrck
Copy link
Author

lttlrck commented Sep 10, 2024

nothing.

image

I did some grepping and there is no trace of this path either:

image

this doesn't make any sense and I fear I am wasting your time because of a strange artifact in my environment.

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

No branches or pull requests

2 participants