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

slim: Unable to uncompress kernel #285

Open
sertys3 opened this issue Feb 23, 2022 · 1 comment
Open

slim: Unable to uncompress kernel #285

sertys3 opened this issue Feb 23, 2022 · 1 comment

Comments

@sertys3
Copy link

sertys3 commented Feb 23, 2022

Greetings,
i'm trying to build qcow2 images from the ubuntu-20.04-cloud-init image, but am running into an issue.

Uncompressing compressed kernel
events.js:291
throw er; // Unhandled 'error' event
^

Error: incorrect header check
at Zlib.zlibOnError [as onerror] (zlib.js:182:17)
Emitted 'error' event on Gunzip instance at:
at errorOrDestroy (internal/streams/destroy.js:108:12)
at Gunzip.onerror (_stream_readable.js:754:7)
at Gunzip.emit (events.js:314:20)
at Zlib.zlibOnError [as onerror] (zlib.js:185:8) {
errno: -3,
code: 'Z_DATA_ERROR'
}

From what i can see the vmlinuz file is not compressed and the library is raising an error.

Are we certain that the docker kernel is at all compressed?

Regards,
Daniel

@chrisparnin
Copy link
Contributor

There have been quite a few big changes in the code base, so the qcow2 build pipeline might have been fully tested.

My guess for this issue: Differences in arm64/intel releases of the linux use different formats for the kernel.

  • For, arm64, vmlinuz is gzipped, and the new MacOS hypervisor bootloader needs the kernel to be uncompressed.
  • For, intel, vmlinuz a bzImage with containing a compressed kernel.

The quick work around is to use -f raw which would build a raw disk image, that can be manually converted to qcow2 using qemu-convert, etc.

const formatSteps = {
    'vhd': [dockerBuild, dockerExport, buildEfiImage, makeVhd],
    'raw': [dockerBuild, dockerExport, buildRootfsImage, cleanup],
    'initrd-m1': [dockerBuild, dockerExtract, uncompressKernel, cpioPack],
    'initrd': [dockerBuild, dockerExtract, cpioPack],
    'special': [dockerBuild, dockerExport, buildRootfsImage, dockerExtract, uncompressKernel, cpioPack],
    'iso': [dockerBuild, dockerExtract, uncompressKernel, rawExtract, buildRootfsImage, isoBuild, cleanup],
    'qcow2': [dockerBuild, dockerExtract, uncompressKernel, rawExtract, buildRootfsImage, isoBuild, qcowBuild, cleanup]
};

Simply removing the uncompressKernel step for qcow2 will probably work.

Longer term, I want to introduce the idea of pipelines to make it easier to pick what processing steps you want to do on images.

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