grml-debootstrap icon indicating copy to clipboard operation
grml-debootstrap copied to clipboard

Allow to configure Linux kernel image package type

Open paulmenzel opened this issue 3 years ago • 5 comments

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.

paulmenzel avatar Jun 07 '21 05:06 paulmenzel

I like that idea! I just gave it a quick shot (untested!), maybe you wanna test https://github.com/grml/grml-debootstrap/commit/43406e8955d683da38ac2cccb797a2213cc92e1c and let me know if that would solve your use case and works as intended?

mika avatar Jun 07 '21 13:06 mika

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.

paulmenzel avatar Jun 07 '21 13:06 paulmenzel

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. https://github.com/grml/grml-debootstrap/issues/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.

mika avatar Jun 07 '21 13:06 mika

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

paulmenzel avatar Jan 24 '24 09:01 paulmenzel

Hm ok, https://github.com/grml/grml-debootstrap/commit/43406e8955d683da38ac2cccb797a2213cc92e1c would be need to be rebased on current master. Maybe @adrelanos is already interested in this feature?

mika avatar Jan 29 '24 11:01 mika