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

RFE: Support setting hostname, locale and timezone #131

Closed
dteleguin opened this issue Jul 26, 2017 · 4 comments
Closed

RFE: Support setting hostname, locale and timezone #131

dteleguin opened this issue Jul 26, 2017 · 4 comments

Comments

@dteleguin
Copy link

At the moment, generated image ends up with the following settings:

  • hostname: localhost
    This comes from /etc/hostname which belongs to systemd RPM and contains "localhost" (however may be specific to my distro, Mageia). If the image is used as a systemd-nspawn bootable container, this static hostname prevents the transient hostname (= machine name) to be set correctly (as of systemd-230). Hence, the hostname may need to be set for VMs and to be unset for containers;
  • locale: (not set)
  • timezone: inherited from the build machine (?)

It would be nice to have an ability to configure this all on the image building stage. However, this can be tricky, since hostnamectl/localectl/timedatectl all require running systemd inside the image.

@dteleguin dteleguin changed the title Support setting hostname, locale and timezone RFE: Support setting hostname, locale and timezone Jul 26, 2017
@dteleguin
Copy link
Author

dteleguin commented Jul 26, 2017

Of course this could be solved by manipulating /etc/hostname, /etc/locale.conf and /etc/localtime from a mkosi.postinst script, or even installing a first-run script into the image itself. Feel free to close if insignificant/irrelevant.

@dteleguin
Copy link
Author

I have just noticed #105, so the hostname part seems to be dealt with already. I think setting timezone and locale could be implemented in a similar manner.

@poettering
Copy link
Member

I'd probably add explicit support for setting the hostname, but I am not sure about /etc/locale.conf, as mkosi.extra/ appears fully sufficient to cover that, and similar for /etc/localtime.

@dteleguin would mkosi.extra/ suffice for you? If yes, we can close this and leave #105 for the hostname thing.

@dteleguin
Copy link
Author

@poettering yep I'm OK with that, closing the issue

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

No branches or pull requests

2 participants