systemd icon indicating copy to clipboard operation
systemd copied to clipboard

introduce systemd-volatile-usr

Open esposem opened this issue 3 months ago • 8 comments

More context explained here: https://github.com/systemd/systemd/issues/38986

This unit is triggered by kernel cmdline systemd.volatile=overlay-usr and it runs systemd-volatile-usr, a binary which is very similar to systemd-volatile-root but overlays only /usr.

esposem avatar Sep 25 '25 10:09 esposem

@vittyvk @keszybz FYI

esposem avatar Sep 25 '25 10:09 esposem

  • keep a separate binary (systemd-volatile-usr) or merge a lot of the logic into a single one? For simplicity I did a separate binary

Please make this into a single binary. There is significant overlap between what those two programs do, and they are installed in the initrd, where space it at premium. Those binaries are fairly small, but the combined binary will be only a bit larger than either of them, so I think it's worth the effort. (Also, simplicity is relative. Having a single binary is a bit more work now, but it makes packaging easier, so we also save work later.)

  • Currently the binary doesn't check if /usr is mounted or not. I guess it's fine, we don't really need to enforce /usr to be mounted as separate partition right? Or am I missing something

Yeah, I don't think we need to enforce that. A setup where /usr is just a subdirectory of some bigger system and is set up as volatile probably would not be very useful, but meh, everything should still work. I don't think we should try to regulate this in any way. I don't see a reason to forbid such a setup and maybe people will find a use for this.

keszybz avatar Oct 10 '25 10:10 keszybz

@esposem update?

keszybz avatar Oct 16 '25 08:10 keszybz

Sounds good to me, give me a bit and I'll update the PR

esposem avatar Oct 16 '25 08:10 esposem

Didn't test it yet, but that's more or less the idea

esposem avatar Oct 17 '25 08:10 esposem

Probably I'll need to remove the volatile-usr unit too, we can do a single binary and a single unit. Will update it on Monday

esposem avatar Oct 17 '25 08:10 esposem

@keszybz tested, should be ready to be reviewed

esposem avatar Oct 20 '25 10:10 esposem

@keszybz can you review?

esposem avatar Nov 10 '25 17:11 esposem