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

Boot Ignition from my own built fedora coreos image #201

Closed
zhengxiaomei123 opened this issue Jun 10, 2019 · 13 comments
Closed

Boot Ignition from my own built fedora coreos image #201

zhengxiaomei123 opened this issue Jun 10, 2019 · 13 comments

Comments

@zhengxiaomei123
Copy link

Hi,
According to the link https://coreos.com/ignition/docs/latest/boot-process.html, ignition only takes effect at the first boot.
But we want to make it effect later if we missed something in the first boot, or we want to debug ignition.
So question is: how can I set file coreos/first_boot in the EFI System Partition, or set 'coreos.first_boot=detected' in kernel parameter line in an existing
coreos qcow2 image which can be started, so that I can make ignition work?
The cmdline now is :
ostree=/ostree/boot.1/fedora-coreos/c2182f8fe3ba1f8ffe5dbc9ee89503637e06a7e1d7a0e12b50d4d0d4665c063e/0 no_timer_check net.ifnames=0 biosdevname=0 ip=dhcp rd.neednet=1 rootflags=defaults,prjquota rw coreos.oem.id=qemu root=UUID=0c21f6a7-d4ce-422c-a357-daefa120459f
The expect is coreos.first_boot=detected
Thanks.

@lucab
Copy link
Contributor

lucab commented Jun 10, 2019

Hi @zhengxiaomei123! That documentation page applies to ContainerLinux, not to Fedora-CoreOS.

The relevant path here is /boot/ignition.firstboot, see https://github.com/coreos/ignition-dracut/blob/2b47c9cfbaa5223c945372ec6c71f71389dc214f/grub/02_ignition_firstboot#L11.
Kernel argument is now just ignition.firstboot.

But we want to make it effect later if we missed something in the first boot

This is explicitly not supported by design by Ignition, and it has high chances of misbehaving in subtle ways. If your first-boot configuration needs some tweaks, just re-provision the whole node from scratch.

@zhengxiaomei123
Copy link
Author

Thanks @lucab , I know that the ignition not supported to boot after first boot. My question now is I can not boot ignition on the first boot. I try to do some debug and there is no coreos.first_boot=detected args even through I boot the instance first time. So I want to know If there any method to add this args ?

@zhengxiaomei123
Copy link
Author

zhengxiaomei123 commented Jun 10, 2019

Or my question is how to config fedora coreos 's kernel command line , I tried to config it refer to :
While OSTree parallel installs deployments cleanly inside the /ostree directory, ultimately it has to control the system's /boot directory. The way this works is via the boot loader specification, which is a standard for bootloader-independent drop-in configuration files.

When a tree is deployed, it will have a configuration file generated of the form /boot/loader/entries/ostree-osname-checksum.serial.conf. This configuration file will include a special ostree= kernel argument that allows the initramfs to find (and chroot() into) the specified deployment.

but there is no any difference.

@lucab
Copy link
Contributor

lucab commented Jun 10, 2019

My question now is I can not boot ignition on the first boot

If you want Ignition not to run on first boot on Fedora CoreOS, then you should remove /boot/ignition.firstboot from the image before running it the first time.

So I want to know If there any method to add this args?

Yes, the link in my previous comment shows how that happens on Fedora CoreOS.
A Grub configuration fragment looks for the /boot partition. If a file named ignition.firstboot exists there it adds ignition.firstboot to the kernel arguments, for this specific boot (i.e. not persisted).

Further (persistent) runtime changes can be performed via rpm-ostree kargs.

@zhengxiaomei123 zhengxiaomei123 changed the title How to add Kernel Command line for my built fedora coreos Boot Ignition from my own built fedora coreos image Jun 10, 2019
@zhengxiaomei123
Copy link
Author

For my question, I think add the kernel cmd line may can not help solve it. I built the fedora coreos image for x390 arch. When the vm boots , there is no any logs for Ignition. May the pre-request for ignition is not meeted so that the igniton-setup unit can not run. Any advice for the pre-check to let ignition boot?

@zhengxiaomei123
Copy link
Author

@dustymabe Hi , I see the rpm package of Ignition is maintained by you[https://src.fedoraproject.org/rpms/ignition], can you give me any advice for Ignition work properly on my image?Thanks.

@dustymabe
Copy link
Member

hi @zhengxiaomei123 - I think you have found some of us in the IRC channel. Turns out we have a grub specific bit that is handling detecting the /boot/ignition.firstboot file and adding a kernel command line arg. Colin has opened an issue for us to discuss other options. I don't have any experience with s390x but if I were you I'd try manually adding ignition.firstboot to the kernel command line when you boot your machine the first time and then later remove it.

@tuan-hoang1
Copy link

tuan-hoang1 commented Jun 11, 2019

The Fedora CoreOS s390x image I gave @zhengxiaomei123 is simply a prototype version of manually running zipl to make it bootable.

I bypassed ostree and simply ignored any Ignition configuration (even though I built and installed coreos-installer, ignition, ignition-dracut rpms). So Ignition would not work at all, due to what @dustymabe said above, it requires many grub2 stuffs, iirc.

I think the next step would be actually fixing bootloader code first then we can talk about Ignition.

@zhengxiaomei123
Copy link
Author

hi @zhengxiaomei123 - I think you have found some of us in the IRC channel. Turns out we have a grub specific bit that is handling detecting the /boot/ignition.firstboot file and adding a kernel command line arg. Colin has opened an issue for us to discuss other options. I don't have any experience with s390x but if I were you I'd try manually adding ignition.firstboot to the kernel command line when you boot your machine the first time and then later remove it.

Thank you very much ! That sounds great. I will discuss more details on an issue . I will try to add 'ignition.firstboot' to the kernel command line but not sure it a good chance.

@zhengxiaomei123
Copy link
Author

The Fedora CoreOS s390x image I gave @zhengxiaomei123 is simply a prototype version of manually running zipl to make it bootable.

I bypassed ostree and simply ignored any Ignition configuration (even though I built and installed coreos-installer, ignition, ignition-dracut rpms). So Ignition would not work at all, due to what @dustymabe said above, it requires many grub2 stuffs, iirc.

I think the next step would be actually fixing bootloader code first then we can talk about Ignition.

Hi Tuan, Thank you very much. I have found the fedora-coreos-config for the bootloader in your patch. You just deleted the grub2 details. But the ignition-dracut and ignition and CoreOS-installer rpms is consistent with the upstream ? If we add the "ignition.firstboot" kernel command line , will the corers-installer and dracut make ignition work well?

@dustymabe
Copy link
Member

hey @zhengxiaomei123 - did your questions get answered? Is there anything left before we need to close this issue?

@tuan-hoang1
Copy link

Cannot speak for @zhengxiaomei123, but I think we have made good progress and I think this issue should not be an issue anymore.

@dustymabe
Copy link
Member

OK. Let's close then. @zhengxiaomei123 please re-open if you think this issue should still be open.

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

5 participants