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

Dracut initramfs boot #1191

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

anderbubble
Copy link
Collaborator

@anderbubble anderbubble commented Apr 16, 2024

Description of the Pull Request (PR):

Support booting a dracut image from a container and using it to bootstrap a large container.

To-do

  • GRUB boot support
  • Kernel override support

This fixes or addresses the following GitHub issues:

Before submitting a PR, make sure you have done the following:

@anderbubble anderbubble added enhancement New feature or request discuss A topic for discussion in a community meeting labels Apr 16, 2024
@anderbubble anderbubble self-assigned this Apr 16, 2024
@anderbubble anderbubble mentioned this pull request Apr 16, 2024
6 tasks
@anderbubble
Copy link
Collaborator Author

@JasonYangShadow I refactored our work here, squashing redundant commits and making sure everything had a clear progression and commit messages. Let me know what you think.

@anderbubble anderbubble force-pushed the dracut-initramfs-boot branch 3 times, most recently from a8f9330 to 570e72f Compare April 16, 2024 22:37
@anderbubble
Copy link
Collaborator Author

Rebased on main.

@anderbubble anderbubble force-pushed the dracut-initramfs-boot branch 4 times, most recently from 8f7ce29 to a7ff590 Compare April 19, 2024 04:42
@anderbubble anderbubble added this to the v4.5.2 milestone May 1, 2024
@anderbubble anderbubble force-pushed the dracut-initramfs-boot branch 2 times, most recently from a54d8c5 to f6950ef Compare May 2, 2024 02:00
JasonYangShadow and others added 4 commits May 7, 2024 09:45
The initramfs stage supports serving an initramfs image from within the
container image, typically generated by dracut.

Signed-off-by: xu yang <xyang@ciq.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
warewulf-dracut includes a dracut module to be installed in a container
image to support building an initramfs that can boot from Warewulf.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
dracut.ipxe boots an initramfs detected in the container image. This
required a few small changes to warewulfd and the wwinit overlay to
accommodate the dracut initramfs configuring the network interface
before wwinit:

- Include .NetDevs in the ipxe configuration template, so that dracut
  can configure interfaces with the correct names.

- Configure NetworkManager to not keep the initramfs configuration, in
  stead applying the configuration found by wwinit.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
JasonYangShadow and others added 2 commits May 7, 2024 09:45
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
initramfs uses tmpfs regardless of whether root=tmpfs in Warewulf. As
such, 90-selinux needs to be updated to detect the actual provenance of
/, rather than the configured setting.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
@anderbubble anderbubble marked this pull request as ready for review May 7, 2024 15:45
@anderbubble
Copy link
Collaborator Author

@mslacken @jcsiadal and @griznog I'd still like to add Grub support and see if I can get kernel overrides working for this; but I'd love to get your thoughts on getting this merged in time for v4.5.2. Let me know what you think.

Thanks!

@mslacken
Copy link
Member

mslacken commented May 8, 2024

If we link this together with #815 we have state full install. Steps for this would be:

This would allow a dump of the container to the rootfs. What is till missing would be checks, if the rootfs needs to be updated or reinstalled. I think this could achieved by placing configurations in /warewulf on the node.

dracut/modules.d/90wwinit/parse-wwinit.sh Show resolved Hide resolved
then
info "Loading ${archive}"
(curl --silent -L "${archive}" | gzip -d | cpio -im --directory="${NEWROOT}") || die "Unable to load ${archive}"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

die isn't a posix shell function, so (echo "Unable to load ${archive}";exit 1) should do the same.

@anderbubble anderbubble modified the milestones: v4.5.2, v4.5.3 May 14, 2024
@mslacken
Copy link
Member

@anderbubble my commit is WIP, some args get lost

@mslacken
Copy link
Member

@anderbubble my commit is WIP, some args get lost

I think the problem here is that __child is tries to evaluate the options as arguments for wwctl and not dracut

had to add a new package containerrun which gathers
all functions which run or build a container in order
to avoid circular depencies

Signed-off-by: Christian Goll <cgoll@suse.com>
@mslacken
Copy link
Member

@anderbubble @JasonYangShadow Buidling the dracut works now on wwctl container build feel free to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss A topic for discussion in a community meeting enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a bootstrap stage to allow a two stage node boot process
3 participants