OSInside / kiwi

KIWI - Appliance Builder Next Generation
https://osinside.github.io/kiwi
GNU General Public License v3.0
306 stars 152 forks source link

grub config fail after kiwi update #2321

Closed talk2drys closed 1 year ago

talk2drys commented 1 year ago

Problem description

Yesterday i updated my Kiwi version from KIWI (next generation) version 9.24.57 to KIWI (next generation) version 9.24.61 and since then i can no longer build images. at first i though maybe something wrong with my description file, i pulled down know working description file and all produce same error.

The error is occurring at the stage when it is trying to configure grub. it keeps giving unknown filesystem, but nothing as changed from my PC, still the same file system i have been using for 2yrs now. to troubleshoot i chrooted into the root filesystem and tried to run the shell command directly and getting same issue. i might be wrong but it seems grub2-probe is detecting my host lvm volumes and causing error, but i have `lvm2' package install. so not sure.

[ DEBUG   ]: 15:47:38 | EXEC: [chroot /var/tmp/kiwi_mount_manager._dfnnpqe grub2-mkconfig -o /boot/grub2/grub.cfg]
[ DEBUG   ]: 15:47:40 | EXEC: Failed with stderr: Generating grub configuration file ...
/usr/sbin/grub2-probe: error: ../grub-core/kern/fs.c:120:unknown filesystem.
, stdout: (no output on stdout)
[ ERROR   ]: 15:47:40 | KiwiCommandError: chroot: stderr: Generating grub configuration file ...
/usr/sbin/grub2-probe: error: ../grub-core/kern/fs.c:120:unknown filesystem.
, stdout: (no output on stdout)
[ INFO    ]: 15:47:40 | Cleaning up BootLoaderConfigGrub2 instance
[ DEBUG   ]: 15:47:40 | EXEC: [mountpoint -q /var/tmp/kiwi_mount_manager._dfnnpqe//secondary]
[ DEBUG   ]: 15:47:40 | EXEC: [umount /var/tmp/kiwi_mount_manager._dfnnpqe//secondary]
[ DEBUG   ]: 15:47:40 | EXEC: [mountpoint -q /var/tmp/kiwi_mount_manager._dfnnpqe//home]

Full Log

output.log

Expected behaviour

Image build successfully

Steps to reproduce the behaviour

here is the exactly description file i am using

<image schemaversion="6.8" name="AlmaLinux-8_appliance">
    <description type="system">
        <author>Marcus Schaefer</author>
        <contact>ms@suse.de</contact>
        <specification>Alma Linux 8 Appliance</specification>
    </description>
    <profiles>
        <profile name="Live" description="Live image" import="true"/>
        <profile name="Virtual" description="Simple Disk image"/>
        <profile name="Disk" description="Expandable Disk image"/>
    </profiles>
    <preferences>
        <version>8.3.0</version>
        <packagemanager>dnf</packagemanager>
        <bootsplash-theme>charge</bootsplash-theme>
        <locale>en_US</locale>
        <keytable>us</keytable>
        <timezone>UTC</timezone>
        <rpm-check-signatures>false</rpm-check-signatures>
    </preferences>
    <preferences profiles="Live">
        <type image="iso" flags="dmsquash" firmware="uefi" kernelcmdline="console=ttyS0"/>
    </preferences>
    <preferences profiles="Virtual">
        <type image="vmx" primary="true" filesystem="xfs" kernelcmdline="rhgb console=ttyS0" firmware="uefi" bootloader="grub2"/>
    </preferences>
    <preferences profiles="Disk">
        <type image="oem" initrd_system="dracut" filesystem="ext4" installpxe="true" firmware="bios" kernelcmdline="console=ttyS0" bootloader="grub2">
            <oemconfig>
                <oem-unattended>true</oem-unattended>
                <oem-swap>true</oem-swap>
                <oem-swapsize>16000</oem-swapsize>
                <oem-device-filter>/dev/ram</oem-device-filter>
            </oemconfig>
            <!-- <systemdisk name="SystemVG" preferlvm="true"> -->
            <!--     <volume name="lvswap" size="8G"/> -->
            <!--     <volume name="@root=primarylv" size="30G" label="primary"/> -->
            <!--     <volume name="secondarylv" size="30G" label="secondary" mountpoint="/secondary"/> -->
            <!--     <volume name="home" size="10G" label="home" mountpoint="/home"/> -->
            <!--     <volume name="common" size="20G" label="common" mountpoint="/common"/> -->
            <!-- </systemdisk> -->
        </type>
    </preferences>
    <users>
        <user password="testpassword" home="/root" name="root" groups="root" pwdformat="plain"/>
    </users>
    <repository type="rpm-md" alias="AlmaLinux8-BaseOS">
        <source path="https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/"/>
    </repository>
    <repository type="rpm-md" alias="AlmaLinux8-AppStream">
        <source path="https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/"/>
    </repository>
    <repository type="rpm-md" alias="AlmaLinux8-PowerTools">
        <source path="https://repo.almalinux.org/almalinux/8/PowerTools/x86_64/os/"/>
    </repository>
    <repository type="rpm-md" alias="AlmaLinux8-Extras">
        <source path="https://repo.almalinux.org/almalinux/8/extras/x86_64/os/"/>
    </repository>
    <repository type="rpm-md" alias="EPEL8-Everything" imageinclude="true">
        <source path="https://download.fedoraproject.org/pub/epel/8/Everything/x86_64/"/>
    </repository>
    <packages type="image">
        <namedCollection name="core"/>
        <package name="syslinux"/>
        <package name="grub2"/>
        <package name="kernel"/>
        <package name="attr" />
        <package name="lvm2" />
        <package name="plymouth-theme-charge"/>
    </packages>
    <packages type="image" profiles="Disk">
        <package name="dracut-kiwi-oem-repart"/>
        <package name="dracut-kiwi-oem-dump"/>
    </packages>
    <packages type="bootstrap">
        <package name="filesystem"/>
        <package name="basesystem"/>
        <package name="grub2-efi-x64-modules"/>
        <package name="grub2-efi-x64"/>
        <package name="shim-x64" arch="x86_64"/>
    </packages>
</image>

OS and Software information

Is there something i might need to do to get the issue fix

schaefi commented 1 year ago

Hmm

/usr/sbin/grub2-probe: error: ../grub-core/kern/fs.c:120:unknown filesystem.

grub2-probe tries to retrieve the filesystem marked as root and grub is not able to detect it. There might be several reasons for this:

  1. Incompatibility between filesystem created with host tools (from TW) compared to grub's code for detecting
  2. A change in grub2-probe that gets pulled with an update in Rocky ?
  3. A change in kiwi

At least for 3. I can assure you we haven't changed the code. The most comparable Rocky Linux test to compare is probably the CentOS-8 integration test from here:

As you can see they are all successful

My first guess would be a change on the Tumbleweed side which now uses tools that produces Rocky incompatible results, most probably on the filesystem creation side. On a personal note; I think TW is not a good host for building images, it's a rolling release that changes every day, so it's risky for reproducible image builds.

Can you try to run on another host environment to test if this might be the problem ?

The easiest way to do this is via the kiwi box plugin. I would use "--box fedora" for testing. More details here:

Thanks

talk2drys commented 1 year ago

@schaefi yep, you are right, it seems something has changed in tumbleweed not sure what. before i saw your reply i already got the builder to work using docker. maybe later i will find what is the issue and play with the boxbuild. but for now, this is not an issue and i will close the ticket