On Sun, 17 Jun 2018 02:53:15 +0200 Jonas Meurer <jo...@freesources.org> wrote:
> That's why I'd like to add locale and gettext support to initramfs but
> make it optional. Without any prompts targeted at endusers, there's no
> real need to bloat the initramfs with locales and gettext files. But
> e.g. in the cryptsetup package, we would enable it.
> 
> I've prepared a patch that optionally adds locale and gettext support to
> initramfs (depending on a initramfs.conf variable). You can find the
> patch attached to this bugreport or as a merge request on Salsa[2].

Reading through the patch, most of it seems reasonable; however, I
noticed a few issues:

- /usr/bin/locale isn't in the locales package, it's in libc-bin, which
  is essential. So, please don't point people towards the locales
  package.
- You're filtering out LC_COLLATE from the locale output, but that just
  leads LC_COLLATE to default to the same locale specified by other
  variables. If you want to avoid referencing the collation files, you
  need to *explicitly* set LC_COLLATE=C.
- For the purposes of localized message support *only*, could you do
  without the (large) LC_CTYPE file as well? Or perhaps more generally,
  would it make sense to *only* support LC_MESSAGES and nothing else?
- For invoking find, please see how other hook scripts do so, and please
  quote the resulting filenames. Yes, files under /usr/lib/locale should
  never contain whitespace, but despite that, please don't encode such
  assumptions.
- Nit: rather than providing a function gettext_support to conditionally
  source /usr/bin/gettext.sh and otherwise provide dummy functions, have
  you considered just putting a /usr/bin/gettext.sh in the initramfs
  that defines those dummy functions, so that scripts can use it
  unconditionally?

Have you confirmed that this support works on a system with locales not
installed and only the C.UTF-8 locale configured?

Reply via email to