mkosi icon indicating copy to clipboard operation
mkosi copied to clipboard

systemd-nspawn overwrites timezone after postinstall script

Open lahtima opened this issue 3 years ago • 2 comments

mkosi seems to use systemd-nspawn without --timezone flag during the build even after running postinstall causing it to always set timezone to be same as host by default. This means that image timezone can only be set to different than host timezone during finalize step if I checked correctly.

This isn't a big deal once realized but having some option to disable this behavior during the image build would make forcing specific timezone to the image more intuitive.

lahtima avatar Jun 03 '22 08:06 lahtima

Thanks for the report!

Yeah, this might be useful, but adding this is a bit niche. I would be happy to review a patch adding a CLI option adding this feature, but I actually think, that we should add a mechanism to funnel arbitrary settings to nspawn - similar to Settings=, but at build time (BuildSettings= or BuildtmeSettings=?), since I'm quite sure, that this will come up again and this would similarly allow pass credentials to nspawn.

behrmann avatar Jun 09 '22 17:06 behrmann

I agree that the build time Settings= would be more general fix for this. resolv.conf handling comes to mind as another example where changing build time nspawn settings might be useful sometimes.

lahtima avatar Jun 10 '22 06:06 lahtima

We don't use systemd-nspawn during the build process anymore so this should be fixed

DaanDeMeyer avatar Feb 14 '23 14:02 DaanDeMeyer