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

Allow to configure Linux kernel image package type #178

Open
paulmenzel opened this issue Jun 7, 2021 · 5 comments
Open

Allow to configure Linux kernel image package type #178

paulmenzel opened this issue Jun 7, 2021 · 5 comments

Comments

@paulmenzel
Copy link
Contributor

For virtual machine images instead of the standard package linux-image-amd64 the package linux-image-cloud-amd64 with a smaller image and built-in ext4 file system driver to boot without an initrd might be wanted. It’d be great, if that could be configured using an option or the configuration file, so it does not have to be done using the script hooks.

mika added a commit that referenced this issue Jun 7, 2021
With linux-image-cloud-amd64 we only need ~96MB of disk space, whereas
the corresponding linux-image-amd64 takes about 317MB of disk space.
Also there's usually no need to install linux-headers and firmware
packages inside a VM, so skip those as well.

Closes: #178
@mika
Copy link
Member

mika commented Jun 7, 2021

I like that idea! I just gave it a quick shot (untested!), maybe you wanna test 43406e8 and let me know if that would solve your use case and works as intended?

@paulmenzel
Copy link
Contributor Author

Thank you. I am going to test it later.

Looking at the implementation, this would make it harder for people wanting to build a virtual machine image for desktop use as most drivers are missing. I would not mind, but it should be properly documented.

@mika
Copy link
Member

mika commented Jun 7, 2021

Hm, are "virtual machine images for desktop use" really a thing? :) How's that typically used? (Really wondering about it, because I'm coming mainly from the server side of things)

I agree with that this change might be kind of unexpected, and we might consider making it configurable (possibly through a cmdline option) or at least properly document it of course. But the more configuration options we provide, the harder it is to test and makes it less maintainable, so overall I'm very reluctant to make all bits and pieces optional.

Furthermore I'd like to have package lists per Debian/release (see e.g. #76), and am wondering which sane defaults users expect for such kind of things, and what customization should be left for further custom/user provided hooks/scripts instead.

@paulmenzel
Copy link
Contributor Author

Hm, are "virtual machine images for desktop use" really a thing? :) How's that typically used? (Really wondering about it, because I'm coming mainly from the server side of things)

Sorry for the late reply. I can’t remember, what I meant. Probably, that the resulting image is dd’ed to an actual disk.

As I built a VM image again with grml-debootstrap, optimizing the boot time, I was hit by this problem again. First I installed tiny-initramfs, but then remembered for an ext4 filesystem I shouldn’t need an initramfs/initrd at all, but this failed as the drivers are not built into the standard Linux kernel image. So it’d be really great to get this patch in.

PS: tiny-initramfs currently also fails with:

[    2.248116] Invalid ELF header magic: != ELF
initramfs: Couldn't load /crc32c-intel.ko.xz: Ex[    2.249299] Invalid ELF header magic: != ELF
ec format error
initramfs: Coul[    2.250618] Invalid ELF header magic: != ELF
dn't load /crc32c_generic.ko.xz:[    2.251905] Invalid ELF header magic: != ELF
 Exec format error
initramfs: Couldn't load /jb[    2.253604] Invalid ELF header magic: != ELF
d2.ko.xz: Exec format error
ini[    2.255050] Invalid ELF header magic: != ELF
tramfs: Couldn't load /mbcache.k[    2.256200] Invalid ELF header magic: != ELF
o.xz: Exec format error
initram[    2.257487] Invalid ELF header magic: != ELF
fs: Couldn't load /crc16.ko.xz: [    2.258784] Invalid ELF header magic: != ELF
Exec format error
initramfs: Co[    2.260059] Invalid ELF header magic: != ELF
uldn't load /ext4.ko.xz: Exec fo[    2.261347] Invalid ELF header magic: != ELF
rmat error
initramfs: Couldn't [    2.262631] Invalid ELF header magic: != ELF
load /virtio_blk.ko.xz: Exec for[    2.263921] Invalid ELF header magic: != ELF
mat error
initramfs: Couldn't l[    2.265238] Invalid ELF header magic: != ELF
oad /crct10dif_common.ko.xz: Exe[    2.266478] Invalid ELF header magic: != ELF
c format error
initramfs: Could[    2.267774] Invalid ELF header magic: != ELF
n't load /crc64.ko.xz: Exec form[    2.269097] Invalid ELF header magic: != ELF
at error
initramfs: Couldn't lo[    2.270347] Invalid ELF header magic: != ELF
ad /crct10dif-pclmul.ko.xz: Exec format error
initramfs: Couldn't load /crct10dif_generic.ko.xz: Exec format error
initramfs: Couldn't load /crc-t10dif.ko.xz: Exec format error
initramfs: Couldn't load /scsi_common.ko.xz: Exec format error
initramfs: Couldn't load /scsi_mod.ko.xz: Exec format error
initramfs: Couldn't load /crc64-rocksoft.ko.xz: Exec format error
initramfs: Couldn't load /t10-pi.ko.xz: Exec format error
initramfs: Couldn't load /sd_mod.ko.xz: Exec format error
initramfs: Couldn't load /virtio_mmio.ko.xz: Exec format error

@mika
Copy link
Member

mika commented Jan 29, 2024

Hm ok, 43406e8 would be need to be rebased on current master. Maybe @adrelanos is already interested in this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants