i18n for bootscripts

Anderson Lizardo lizardo at linuxfromscratch.org
Thu Jan 22 10:34:57 PST 2004

On Thursday 22 January 2004 08:28, Ken Moffat wrote:
> On Thu, 22 Jan 2004, Christoph Berg wrote:
> > Yep, the .po files are a good thing, but we have a problem where to
> > place them. Normally they are placed in /usr/include/locales or
> > something like that, but the problem is, if the user has the /usr dir
> > not on the root partition, because there are messages before "Mounting
> > all remaining file systems".
>  For bootscripts, I suggest any particular system should only boot in
> one language.  Maybe the translators could provide patches for the
> bootscripts to put them all into the desired language ?  Probably doesn't
> help for non-left-to-right languages, and I'm not sure if the kernel
> can display non-American characters without using setfont, which is also
> in /usr.

I also don't like the idea of a critical package like the LFS-bootscripts 
depending on a package from /usr (gettext). I have some suggestions though, 
that I will describe below. Notice that I didn't fully test these 
instructions yet.

(1) Regarding setfont: we can add instructions (to a hint or to each 
translated LFS-book version which uses non-ascii chars) to copy a static 
version of the necessary console font to the /boot dir, and then mv (or cp) 
the setfont program to /bin. Eg:

cp /usr/share/kbd/consolefonts/lat1-16.psfu.gz /boot/defaultfont.psfu.gz
mv /usr/bin/setfont /bin

(2) The next step is to modify the LFS-bootscripts package. Each supported 
language will have a rc.d.LANG dir, where LANG is the ISO language code (eg. 
pt_BR). Each rc.d.LANG directory tree will have its comments and/or boot 
messages translated to LANG, and those languanges which need non-ascii chars 
to display text correctly will need to add an additional script (and the 
necessary symlinks) to init.d (rc.d.LANG/init.d/setfont) which runs setfont 
with the proper parameters. Eg:

setfont /boot/defaultfont.psfu.gz

(3) Only the "Installing LFS-Bootscripts" section will need to be modified 
(not on the LFS-en book, but on each translated version which wants i18n'ed 
bootscripts), adding the instructions (1) above and modifying the following 
installation instruction:

cp -a rc.d sysconfig /etc


cp -a rc.d.LANG /etc/rc.d
cp -a sysconfig /etc

Advantages of this approach:
- No modification to the current LFS-en instructions is needed.
- No modification to the "default" rc.d tree of the LFS-bootscripts package. 
Each translation will have its own tree.
- It doesn't depend on gettext.

Anderson Lizardo
lizardo at linuxfromscratch.org

More information about the lfs-dev mailing list