The NetBSD installers come in lots of packaging and formats. The main application at the heart of most of them is sysinst. We provide some translations of sysinst, which usually have been created by the user community.

When features are added to sysinst, the developer usually does not have ready access to the wide range of translators (or foreign native speakers) to update all translations. When new user interface items appear, the translated versions often are copied from the original English message. Ideally after each such addition the user community should be invoked to fill in the missing parts in translations, but sometimes it will take some time - or nobody will pick up the translation.

So whenever you should decide you could help with testing sysinst or its translation into your own native language, here is how you can locally test it easily without killing your existing NetBSD installation or waiting on new full builds of install media after each change.

However, most of this testing will have to happen as user root, and you need to be careful! Usual advice of creating (and double checking) backups upfront applies. This guide comes free without any warranty.

Testing sysinst

The easiest way to test run sysinst from an installed system is to create a vnd device and pointing sysinst at that as the installation target. You could also use a USB stick, but for sysinst user interface testing vnd works fine. The installation process will not write to many blocks on the install disk, so a lazily allocated image file can be used (which gives you the chance to experiment with installations to much larger disks). Unfortunately this testing will not be usefull to cover real tests like "is the installation actually bootable?" - but to check and verify the sysinst user interface and translations it is fine.

For more full testing, check emulators/virtualization for your target architecture and pkgsrc/misc/py-anita.

Setting up a sparse vnd disk image

Make sure you are on a filesystem that does support lazy allocation (that is: not tmpfs) and do something like this (as root):

# dd if=/dev/zero of=disk.img seek=6g count=1
# vnconfig -c vnd0 disk.img

This will create a virtual disk (vnd0) with about 3 TB space. (If you are curious about the math: 6g sectors of 512 byte each plus one, so 1 sector = 1/2 kByte and 6g sectors ~3 terrabyte.) To get rid of the vnd, use:

# vnconfig -u vnd0
# rm disk.img

Now you can just run:

# sysinst

and select vnd0 as installation target.

Checking translations

Translated messages can be found in the sysinst sources (in the usr.sbin/sysinst directory of the NetBSD source tree) in files called msg.., for example all MBR (the master boot record disk partitioning) related strings for the german sysinst translation are in msg.mbr.de.

In general they look like:

msg..

message name_of_message {translated_content}

and sometimes they have positional parameters, which typically are explained in a comment right before the message:

msg..

/* Called with:                         Example
 *  $0 = device name                    wd0
 *  $1 = outer partitioning name        Master Boot Record (MBR)
 *  $2 = short version of $1            MBR
 */
message dofdisk
{$0: schreibe die $2 Partitionstabelle ...
}

The content (between { braces }) is free flowing text, that is: if the display is wider, newlines may be replace by spaces to fill the display width. Whenever a hard line break is meant, a space followed by a newline is used. Newlines at the end of a message (right before the closing brace }) are always hard line breaks.

This may sound backwards, so double check when making changes.

If translations do not make sense, it sometimes helps to run two sysinst instances in two terminals side by side, using the english text in one and the translated in the other. This is easy to do with sparse vnd disk images as described above - just create a second vnd and run another sysint targetting that.

Here is an example image:

two sysinst instances (en and es) in parallel

You can navigate both instances in parallel until you get to the unclear point.

As you can see in the Spanish version, some translations are missing in this version. See below for systematically checking for this.

Building sysinst locally with changes

If you change translations and want to test the result, it is a lot faster to locally just build sysinst manually inside the source tree, than to do a complete "build.sh release iso-image" build to get the installer CD image.

This is a hack, but worth the time savings. Please carefully clean up afterwards (by doing "make cleandir").

If you are cross-compiling for some other machine, you have to identify the TOOLDIR binary sub directory and invoke the make stub from there.

Example:

cd src/usr.sbin/sysinst/arch/mac68k
$TOOLDIR/bin/nbmake-mac68k

This will create the mac68k sysinst binary, you will find the result in $OBJDIR/usr.sbin/sysinst/arch/mac68k and can directly copy the binary over to the test machine.

If building on the target machine itself you can use the USETOOLS=never environment setting:

cd src/usr.sbin/sysinst/arch/amd64
USETOOLS=never; export USETOOLS
make

This will create sysinst (and the translation files) in the current directory. You can run the modified version directly there:

sudo ./sysinst

But make sure to do a "make clean" when you are done!

Finding missing translations

When you pick up a translation and want to do an overall check for missing / untranslated strings, follow the recipe for local native builds above, and after the build do:

make check-lang LANG=de

This will test the given language (de here) and compare all translated strings against the original English text. You will get output like this:

#    create  amd64/check-lang
sed "s/@@VERSION@@/8.99.43/" msg.def |  ....   > /tmp/sysinst.en
ERROR: No translation for message MSG_kb_default

This error is ok, it just means the English string for the default keyboard layout is empty (and sysinst deals with that).

/bin/sh /work/src/usr.sbin/sysinst/arch/amd64/../../msg_cmp.sh ...... sysinstmsgs.de
Messages identical to the English version:
OK (10):        OK
ok (11):        ok
megname (35):   MB
gigname (36):   GB
ptnheaders_start (65):  Start
label_offset_tail (84): Start ($2)
Logging (201):  Logging
Gigabytes (231):        Gigabytes
Megabytes (232):        Megabytes
ftp (236):      FTP
http (237):     HTTP
nfs (238):      NFS

Some of this are fine (OK works in German just like in English), but some are errors (Gigabytes should probably be Gigabyte in German, but this needs to be properly checked with more context, see the side-by-side comparison above).