StoWiki/ blog/ debian/ debian-installer and l10n

Note

This post was written last week, I started to write it on a temporary directory and tonight I've noticed that it was not moved to the right place. Should I send this entry to the debian-boot mailing list? I'm unsure about the template updates, but maybe an evolution of what I've done could be used by the d-i l10n team, I have to calculate it, but maybe if each language is distributed on it's own udeb some space could be saved...

debian-installer and l10n

For a couple of weeks now I'm working on the debian-installer for LliureX using the Sarge version as a base.

In the past I did read about the installer internals and used some of the hooks it has, but only now I'm really looking at the code. The system is nice and quite customizable, but doing things like adding a non-standard locale to it are a real pain!

Initially I wanted to use the sarge debian-installer package to build mine, simply adding localudebs to it, but right now I'm using my own branch of the installer code with minimal changes (basically make rules); I'll try to use the standard debian-installer in the future, but it is not so important now, the patch is quite small and I'm using almost all the sarge .udeb packages and trying to change only binary-all packages to be able to build installers for architectures different than i386 with zero effort.

What are the problems and solutions I've found until now?

belocs-locales

First, I need to use a non-standard locale as a standard one on d-i and on the installed system. Until now we were using a hackish package that uses diversions to add our locale to some files of the system, mainly because the standard locales packages comes from the glibc source, and that is a package I don't want to rebuild unnecessarily.

The good solution would have been to use a package that only includes locales, splitted from the glibc source. Fortunately there is such a package in Debian, so what I've done is to move our distribution to belocs locales, generating a new package based on belocs-locales-data with an additional patch that adds support for the non-standard language.

The package is called lliurex-belocs-locales-data and provides and replaces belocs-locales-data; I have not used the same name to keep my system compatible with Debian, it will not break if the user uses testing and the belocs-locales-data is updated, as they will not have it installed.

With that change I've removed the dirty hacks on the gettext support for the non-standard locale on the installed system, on the next version I'll try to remove a couple of hacks still needed to add the language to X and to the gdm menu.

languagechooser

The first udeb I need to modify is languagechooser, my version has to build-depend on lliurex-belocs-locales-data to support my new locale and I also had to update the languagemap to support extra languages and change some defaults (i.e. our distribution uses UTF-8, so now if you select Spanish or Valencian your charset is UTF-8 by default).

countrychooser

It also has to build-depend on lliurex-belocs-locales-data and I also updated get-iso-codes to generate the right *.tab files from the iso-codes.updates (now it works, but I'm not sure if that was really needed).

kbd-chooser

I've left that program as is, but I've built a custom version of the console-data-* packages including my new locale... in fact that is not really needed, as the user can choose the right keyboard by hand, but it is nice to have it auto selected and also be able to translate the debconf templates in my package.

additional packages

The big problem with the rest of the udeb packages is the debconf template translations, as they are included on the udebs.

I had various options:

I've found that the second option was the best one, and that I can implement it without recompilation; the idea is to replace the current debconf-loadtemplates by a script that calls the original program and, if there is a file with updated template translations, calls the original program again using the new templates as input.

I've done it using a new package that installs a wrapper for debconf-loadtemplate on /bin/debconf-loadtemplate, that way it is called before the cdebconf version (at least from udpkg) and the other program that calls it is also bypassed (rootskell calls /usr/bin/debconf-loadtemplate on the debian-installer start up, but we install a script that is called before the rootskell one and makes the original script do nothing).

The updated templates have to be installed inside a gzipped tarball that is stored into /var/lib/cdebconf/updated-templates/ with a name of the form *.tgz.

The contents of the tarballs are the template files directly, i.e., to update /var/lib/dpkg/info/console-keymaps-at.templates the tarball has to include a file named console-keymaps-at.templates.

If someone wants the package send me a note and I'll put it somewhere (it will be available from the LliureX repository in September).

cddtk udebs

That's for another post, I have to finish the cddtk-di and cddtk-bi scripts to be able to install different CDD flavours getting all the data from the CDD Description, I have more or less a clear idea of how to do it, but probably I'll finish other things before implementing it...

To be continued...