You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Injecting configuration files after installation, before first boot #531
How does one inject a configuration file post bootc install but before the first system boot? A customized /etc/fstab is a good example or perhaps some systemd mount units. With a non-ostree system when the installation chroot is setup this is a straightforward copy operation. bootc should document this process a bit better or provide a more convenient method as it will be a common need to drop some configuration files in place post install but before the system boots for the first time. Not everyone will want to adopt ignition to do these tasks.
bootc should document this process a bit better or provide a more convenient method
See #267 for a more convenient method. We are indeed in a relatively inconsistent situation where e.g. Anaconda allows this, but bootc-image-builder and bootc install don't in any kind of direct way; the above PR helps.
Not everyone will want to adopt ignition to do these tasks.
I gathered there was divergent functionality here and this was not really supported now. What is the present day workaround?
What is going on in your PR with let target_etc = root.open_dir("etc").context("Opening deployment /etc")?;? Are you effectively just grabbing the etc directory of the ostree deployment in sysroot? figured this out for myself.
As for a workaround, should I just dump stuff into <physroot>/ostree/deploy/default/deploy/<hash>/etc/? What I've come up with to use in a script with a filesystem install to get to this location: ostree admin status | head -n 1 | cut -d ' ' -f 3 -
As for a workaround, should I just dump stuff into <physroot>/ostree/deploy/default/deploy/<hash>/etc/? What I've come up with to use in a script with a filesystem install to get to this location: ostree admin status | head -n 1 | cut -d ' ' -f 3 -
ostree admin status --sysroot=<wherever sysroot is mounted>doesn't work right after install as it reports works only if the boot partition is mounted otherwise it reports No deployments. It looks like ostree rev-parse --repo=<wherever sysroot is mounted>/ostree/repo ostree/1/1/0 could work if boot isn't mounted for some reason.
It would be a much more pleasant experience if bootc install subcommands could cleanly output this bit of info. It is present internally.
ostree admin status --sysroot= doesn't work right after install as it reports No deployments.
It's almost certainly because you have a distinct /boot filesystem which isn't mounted, and ostree uses the bootloader configs as source of truth.
This is exactly what the issue was. The documentation for ostree admin status does not indicate it pulls data from /boot, however. I wrongly presumed it inspected the repository somehow.
Especially with composefs we'll need to offer a proper API for this because today anaconda and bootc-image-builder e.g. basically hardcode looking for the ostree deployment, and that will break with a composefs native install.
Activity
cgwalters commentedon May 15, 2024
See #267 for a more convenient method. We are indeed in a relatively inconsistent situation where e.g. Anaconda allows this, but bootc-image-builder and bootc install don't in any kind of direct way; the above PR helps.
Yes, agreed.
jmpolom commentedon May 15, 2024
I gathered there was divergent functionality here and this was not really supported now. What is the present day workaround?
What is going on in your PR withfigured this out for myself.let target_etc = root.open_dir("etc").context("Opening deployment /etc")?;? Are you effectively just grabbing the etc directory of the ostree deployment in sysroot?As for a workaround, should I just dump stuff into
<physroot>/ostree/deploy/default/deploy/<hash>/etc/? What I've come up with to use in a script with a filesystem install to get to this location:ostree admin status | head -n 1 | cut -d ' ' -f 3 -jmpolom commentedon May 16, 2024
ostree admin status --sysroot=<wherever sysroot is mounted>doesn't work right after install as it reportsworks only if the boot partition is mounted otherwise it reportsNo deployments.It looks likeostree rev-parse --repo=<wherever sysroot is mounted>/ostree/repo ostree/1/1/0could work if boot isn't mounted for some reason.It would be a much more pleasant experience if
bootc installsubcommands could cleanly output this bit of info. It is present internally.cgwalters commentedon May 17, 2024
It's almost certainly because you have a distinct
/bootfilesystem which isn't mounted, and ostree uses the bootloader configs as source of truth.jmpolom commentedon May 17, 2024
This is exactly what the issue was. The documentation for
ostree admin statusdoes not indicate it pulls data from/boot, however. I wrongly presumed it inspected the repository somehow.Merge pull request bootc-dev#531 from coreos/dependabot/cargo/serde_j…
Merge pull request bootc-dev#531 from cgwalters/fix-panic-on-updated
cgwalters commentedon Oct 27, 2025
Especially with composefs we'll need to offer a proper API for this because today anaconda and bootc-image-builder e.g. basically hardcode looking for the ostree deployment, and that will break with a composefs native install.
docs: Document finding deployments in install-to-existing-root
docs: Document finding deployments in install-to-existing-root