Can you pivot a fedora install to a fedora core os install?

On a scale of “here is a script someone wrote to do it” to “you are out of your mind” how easy/possible is it to take a running fedora system and do some stuff to it, then reboot and be running fcos?

For context I am using fcos more and more, but not all cloud providers have core os images(there is a long tail out there). Some of them give you the ability to upload custom images, but many don’t.

1 Like

I would venture the latter option.

Fedora workstation is a normal system managed by dnf.
FCOS is an immutable system managed by ostree. There are very many major differences in the overall system.

It would seem much easier to start with a clean install of fcos then make the desired changes there. Thus, if one cannot upload a custom image it seems a different issue entirely.

Essentially I suppose you could make your standard workstation immutable using ostree, but you would never end up with core os or Silverblue, it would always be something you would have to maintain throughout it’s usable life cycle. Not to mention all of the testing that takes place on Core OS images (and other immutable images use by Fedora) would be lost to you.

We haven’t really done much on this front but I just tried starting on a Fedora Cloud base instance and ran a short script that uses kexec and it seems to work:

#!/bin/bash
set -eux -o pipefail
install_dev='vda'
install_ignition='https://example.com/config.ign'
sudo dnf install -y kexec-tools coreos-installer 
coreos-installer download -f pxe
kernel=$(ls fedora-coreos-*-live-kernel-x86_64)
initramfs=$(ls fedora-coreos-*-live-initramfs.*.img)
rootfs=$(ls fedora-coreos-*-live-rootfs.*.img)
cat $initramfs $rootfs > combined.img
sudo kexec -l $kernel --initrd=./combined.img  --command-line="coreos.inst.install_dev=${install_dev} coreos.inst.ignition_url=${install_ignition} console=ttyS0"
sudo systemctl kexec

The system boots into the live environment and runs the install and then reboots.

Awesome. Glad to hear you are using more and more FCOS. Which cloud providers have you tried running FCOS on? Which ones work and which ones don’t?

3 Likes

beautiful!

I haven’t tried fcos on cloud providers yet, just local vms. Hard to say how many exactly, but all my new vms are fcos now.

Neither of the two clouds where I have vms running provides a fcos option out of the box. DO is the main one, and I have seen there are docs for doing a custom image there, but I am not sure I want to do that. The other small niche cloud doesn’t even provide a fedora image, or allow for custom images as far as I can tell, so something like the kexec might be the only way to get fcos.