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

Can't boot on some platforms, need way to modify initramfs contents #180

Closed
5 of 6 tasks
wgwoods opened this issue Dec 12, 2019 · 5 comments
Closed
5 of 6 tasks

Can't boot on some platforms, need way to modify initramfs contents #180

wgwoods opened this issue Dec 12, 2019 · 5 comments
Assignees

Comments

@wgwoods
Copy link
Contributor

wgwoods commented Dec 12, 2019

Some platforms (notably Azure) require that the initramfs contains certain binaries, modules, or kernel drivers in order to boot properly.

This means osbuild needs a way to modify the contents of the image's current initramfs (if it has one), and to make those configuration changes persistent so any future initramfs built inside the image (e.g. on a future kernel update) will also contain the needed pieces.

lorax-composer and other tools handle this by creating files in /etc/dracut.conf.d/ in kickstart %post scriptlets - see vhd.ks for an example.

The best way for osbuild to handle this is probably to have a stage that allows creating dracut config files and building new initrd images for any/all kernel(s) present in the tree.

For feature parity with lorax-composer and current official RHEL images, this stage needs to support at least the following dracut.conf(5) options:

  • add_drivers
  • add_dracutmodules
  • install_items
  • dracut_rescue_image (most image types remove the rescue image to save space)
  • early_microcode (on by default but some image types turn it off)
  • omit_dracutmodules (e.g. live-img removes plymouth)

After modifying the dracut config, the initrd images have to be (re)generated by (re)running dracut. See pylorax.treebuilder.rebuild_initrds() and pylorax.creator.rebuild_initrds_for_live() for details on how lorax-composer handles finding the correct kernel version, output filename, etc.

@gicmo
Copy link
Contributor

gicmo commented Dec 12, 2019

I started with a dractu stage for doing that.

@ondrejbudai
Copy link
Member

I think we should finish the work here. The current initramfs generation is host-dependant. Ami images generated on Travis cannot be booted on EC2, whereas the ones generated on Fedora work without any issues. When I used the initramfs from a working image in the broken image, it successfully booted.

lsinitrd of the working image (generated on Fedora 31): https://gist.githubusercontent.com/ondrejbudai/d3e40ee3756178e43e56b48e53c2f6ba/raw/c5b5f097cb48f982dc395b392c459e6f4dd558a9/gistfile1.txt

lsinitrd of the broken image (generated on Ubuntu 18.04 on Travis): https://gist.githubusercontent.com/ondrejbudai/3d890c32a6717c75c0a7755f0ceee799/raw/f3b81b975c08500a037272b5b720c52353ec4b6f/gistfile1.txt

usr/lib/dracut/loaded-kernel-modules.txt in the working initramfs: https://gist.githubusercontent.com/ondrejbudai/46ea60edd74a04be9d642bc9e8d0edf6/raw/d1e59bf5ace187aa8349c7f8f966ca9486f31a9b/gistfile1.txt

usr/lib/dracut/loaded-kernel-modules.txt in the broken initramfs: https://gist.githubusercontent.com/ondrejbudai/eb6ba9a6e9b236b5074e2cf8fd7bc741/raw/0b95227736b4048aef0c5c1bbfc6876c9114725e/gistfile1.txt

@gicmo
Copy link
Contributor

gicmo commented Mar 31, 2020

I think we should finish the work here.

Yes, totally agree. Will put it to the top of my list.

@ondrejbudai
Copy link
Member

This is the ami generated on Travis if anyone needs it:
https://obudai.fedorapeople.org/broken-ami-image-from-travis.raw.xz

@gicmo
Copy link
Contributor

gicmo commented Jul 22, 2021

Done with #194

@gicmo gicmo closed this as completed Jul 22, 2021
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

Successfully merging a pull request may close this issue.

3 participants