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

Experiment: Setting up OSTree from the initramfs #34

Closed
ajeddeloh opened this issue Aug 22, 2018 · 4 comments
Closed

Experiment: Setting up OSTree from the initramfs #34

ajeddeloh opened this issue Aug 22, 2018 · 4 comments

Comments

@ajeddeloh
Copy link
Contributor

In #18 we discussed the possibility of setting up ostree after the Ignition disks stage but before the files stage. This would pull down the contents of the ostree from some remote location and "install" it to the new root filesystem the disks stage set up. We'd want to only do this if the root fs actually changed, since it would be somewhat slow.

We should investigate this and make sure it's possible.

This would also enable us to create an "ultra-small" OS image which is just the ESP/boot partition and optionally a bios-boot partition, which I think would be neat.

cc @jlebon @cgwalters

@cgwalters
Copy link
Member

It's totally possible...the main thing is that today ostree assumes it's either running outside the system, or it's running inside. This would be between the two, and also intersect a lot with the mess inside libostree around handing /boot as a separate partition or not. In this case we probably wouldn't need to change /boot (or even mount it in the initramfs) but it'd definitely need libostree to understand that.

Another thing that gets messier here is that (AIUI) on CL this relies on the /usr partitions staying around, and implicitly on the fact that when switching the rootfs you don't need to e.g. change /etc/fstab. But depending on what we end up doing with partitioning, we may need to change /etc/fstab right? Or maybe if we go with a LABEL=fedora-coreos-rootfs based approach and only add the label after everything is done, and remove it from the other disk it'd be OK.

@ajeddeloh
Copy link
Contributor Author

With CL and Ignition, it's up to the user to write out mount units or /etc/fstab (we encourage mount units) themselves. CL uses a label to find and mount / which has worked nicely. I don't see we why we'd have to wait to add the label until the end? Traditionally with Ignition the disks stage creates the rootfs and sets the label (on the filesystem not on the partition, fwiw). The initramfs unit ordering ensures (or at least should ensure) we don't switch-root preemptively.

@Promaethius
Copy link

Promaethius commented Nov 8, 2018

So similar to the discussion in coreos/ignition#661, Ignition couldn't use a plugin or module to issue ostree setup. @bgilbert noted that the rootfs is contained within the initramfs, I'm assuming the rootfs (generated within dracut within rpm-ostree) also contains the ostree local repo and deployed filesystem including packages? For some reason, I kept thinking that the initramfs only contained a bare filesystem and had to go through some setup phases to be bootable.

Edit: Got a chance to root through a dracut generated img and noted that yes indeed it's only a bare filesystem. Getting familiar with how ostree-prepare-root.c works as well.

@jschintag
Copy link

I'm closing this issue as there has been no activity for quite some time.

If you think there should be something done here, please reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants