Comment 58 for bug 136682

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Agostino, I am thinking about some changes with regards to the configuration/storing of the locale setting.

Current flow:
1. Upon package installation, the locale is "guessed" from $LANG, and stored in /etc/initramfs/conf.d/root_locale. The user can edit this file later, in case the "guess" is not suitable.
2. update-initramfs will read from the above file, and copy in the locale files together with the configuration file itself.
3. Every boot, the mount options are generated and applied using the conf file copy in the initramfs.

This is nice and flexible, I thought. And good for a tweaking workarounds. However, at this point I don't see the need for this flexibility. So far, we have no reason to think the guessing in (1) will be wrong. OTOH, the user might change the default locale on his computer ($LANG) but initramfs will always pick up the old, initial setting.

I will therefore move the guessing to the initramfs hook, and to be done fresh each time. The conf file will just witness to what locale was chosen at last initramfs, but will not be used for anything.

We can then get rid of the postinst script. No configuration left around to become stale. A postrm can safely remove the conf file which is not used anyway (only internally in update-initramfs).

If needed we can add more flexibility later. It's easier that way, rather than drag along complexity from the start that we have to deal with when we change things in the future.

New flow:
101. update-initrams reads LANG from /etc/default/locale (to be sure to use the system default and not the one of the current session where it is run). Guesses locale from LANG and if it finds the matching locale files, copy them in and write out the conf file that is copied into the initramfs.
102. Every boot, the mount options are generated using the conf files in the initramfs.

Thinking about it, we even keep all flexibility, since the user can always create an root-locale-overrule file which will be read at boot as well after the autogenerated one (not recommmeded though). So it just simpler and better :)