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

Improve "is kernel compressed" check #60

Merged
merged 3 commits into from
Aug 29, 2023

Commits on Aug 28, 2023

  1. bootloader: Only check for uncompressed kernel on arm64

    The code was checking for this on all arches, but it's only arm64
    kernels which vfkit can't boot if they are compressed.
    cfergeau committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    f1a10c1 View commit details
    Browse the repository at this point in the history
  2. bootloader: Rework isUncompressedKernel

    So far we were using `h2non/filetype` which is not a great fit for what
    we want to do, as kernels do not have their own mimetypes, and there is
    no nice way to convey compressed/uncompressed/arch through mime types.
    
    This was working through heuristics so far, but the used heuristics
    break for the kernel used by puipui linux
    (https://github.com/Code-Hex/puipui-linux)
    
    This commit removes the use of h2non/filetype, and reuses the patterns
    from https://github.com/file/file/blob/master/magic/Magdir/linux to do
    the detection we need.
    
    This only adds a magic for uncompressed arm64 kernels.
    There's also a pattern for compressed kernels, but it does not match the arm64
    kernels I tested with. They are either detected as gzip files, or as EFI files,
    and don't contain the magic pattern.
    cfergeau committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    f23bc98 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2023

  1. bootloader: Add test for isKernelUncompressed

    This ensures both puipui kernel and fedora/RHEL kernels are detected as
    uncompressed when they are.
    cfergeau committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    2caf3a4 View commit details
    Browse the repository at this point in the history