ostreedev / ostree

Operating system and container binary deployment and upgrades
https://ostreedev.github.io/ostree/
Other
1.28k stars 295 forks source link

The /run/ostree-booted API #480

Open gatispaeglis opened 8 years ago

gatispaeglis commented 8 years ago

This API possibly could be improved as it won't work for some use cases, especially when using ostree-prepare-root as PID1 (/run is not mounted). The current approach does nothing if /run is not mounted.

One solution could be to add a new subcommand to the ostree command line - "ostree booted", where it parses /proc/self/mountinfo to check if / -> ostree/deploy

wmanley commented 8 years ago

An alternative would be to (automatically?) include a file called .ostree-root in / or /usr. This could happen at deploy time? or when you build the image itself?

I suppose it all depends on the use-cases. I'm a bit of a newbie to ostree so I'm unsure of other's use cases. I see that 79fa7ca (bz#725380) says:

The idea with this is that things like yum should be able to look for it and determine whether or not they should assume that they can change things on the system.

I'm not sure how this fits in with ostree admin unlock as well.

gatispaeglis commented 8 years ago

An alternative would be to (automatically?) include a file called .ostree-root in / or /usr. This could happen at deploy time? or when you build the image itself?

Deploy time sounds good to me.

cgwalters commented 8 years ago

Hmm. Can we change ostree-remount.c to write it in the case of no-initramfs? Basically write it early in userspace boot after /run has been mounted.