HOWTO Localize Knoppix for your language using knoppix-customize


This document shows how to create a localized version of Knoppix without remastering Knoppix. Because no remastering is needed it is very easy to make a Knoppix version that uses your desired language settings as default. But it also limits your choice to the languages Knoppix already supports, you only change the default. If you want to make changes to the installed Software please see Customising FAQ.

The settings we are going to change all reside on the 1.44MB boot image which is inside the iso image. knoppix-customize allows to make changes to the boot image inside the iso and to a seperate boot image that can be used to create a boot floppy. knoppix-customize is a command line tool that can be used under GNU/Linux and Windows.

Now let's look at the required steps to localize a German Knoppix iso image for spanish speakers. I assume you've got the downloaded iso image on harddisk, named KNOPPIX_V3.2-2003-04-18-DE.iso.

Set variable to image file, to make things easier:


$ IMAGE=KNOPPIX_V3.2-2003-04-18-DE.iso
To completely localize Knoppix, we need to do the following things. Of course it's up to you if you want to take every step. Sometimes it may be enough just to set the language for the main system.
  1. Change the "lang=xx"-option in the APPEND-option of syslinux.cfg. This is passed on to the kernel and will set environment variables and make applications use the right language:

    
    $ echo "lang=es" | knoppix-customize --image $IMAGE --action set_append_opt
    


  2. Exchange the keyboard-map for syslinux. This keymap is used when entering commands at the bootprompt. When the system is started later the proper new map will be loaded according to the settings from the previous step.

    Create a lilo-keymap file (this is also used by syslinux) for your language:

    
    $ /usr/sbin/keytab-lilo es > es.kbd
    
    Note What's keytab-lilo?
     

    • The program may be called keytab-lilo.pl if you don't have it, download the lilo source it's included as keytab-lilo.pl there

    • the keyboard map should be found, of course you can also specify a full path



    Insert the new keymap file into the image:
    
    $ knoppix-customize --image $IMAGE --action import_file --image_file es.kbd --local_file es.kbd
    
    Warning Error?
     

    Sorry, at the moment it isn't possible to create new files in the image. so please use the method described next.

    Caution On filenames
     

    Be careful to choose a filename on the image that is DOS (8.3) compatible.

    Now make syslinux use our new keymap file:
    
    $ echo "KBDMAP=es.map" | knoppix-customize --image $IMAGE --action set_syslinux_opt
    
    Note On disk space
     

    In case there isn't enough space you can overwrite the original file, then you don't need to change the KBDMAP-option. But the result may be irrating to someone who examines the CD. Unfortunatly renaming or removing files is not yet supported in knoppix-customize. I hope to add the possibility to rename files soon

    Overwrite original kbd-file:

    
    $ knoppix-customize --image $IMAGE --action import_file --image_file german.kbd --local_file es.kbd
    




  3. Exchange the boot message and help file. This is the message we see directly after inserting the CD and the help screen you get, when pressing F2.

    Check which files are inside the boot image:

    
    $ knoppix-customize --image $IMAGE --action list
    syslinux.cfg
    german.kbd
    logo.16
    boot.msg
    f2
    miniroot.gz
    vmlinuz
    

    Export the files you want to change:

    
    $ knoppix-customize --image $IMAGE --action export_file --image_file boot.msg --local_file .
    $ knoppix-customize --image $IMAGE --action export_file --image_file f2 --local_file .
    
    Now you may edit the files according to you wishes.

    Note What are these strange symbols?
     

    The files use the bios vga font, so it may help you using this font when editing:

    
    $ xterm -fn vga -e vi boot.msg f2
    
    If you haven't got this font you may still change the files. On debian the font is in the package xfonts-dosemu.

    Now re-insert the modified files into the image:

    
    $ knoppix-customize --image $IMAGE --action import_file --image_file . --local_file boot.msg
    $ knoppix-customize --image $IMAGE --action import_file --image_file . --local_file f2
    
    Warning Wrong filesize?
     

    At the moment knoppix-customize still has the serious limitation that the file size may not change at all. So make sure the files have exact the same size after editing as before. Some time, I hope to remove this limitation. (This is no problem for the keymap file above, as that is alwas 256 Bytes).

  4. Exchange boot logo. If you want to start with the logo in the CD, extract it. You may skip this step and overwrite the logo with your own logo.

    
    $ knoppix-customize --image $IMAGE --action export_file --image_file logo.16 --local_file .
    
    To edit the logo, convert it to ppm:
    
    $ lss16toppm < logo.16  > logo.ppm
    
    Now edit the logo from the CD (you may use any bitmap image manipulation program)
    
    $ gimp logo.ppm
    
    Convert it back to the format requiredd by syslinux
    
    $ ppmtolss16 < logo.ppm > logo.16
    
    Note Wrong format?
     

    If the last line doesn't work, a comment mark in line maybe the reason. You can remove it and proceed (check the file for a # at the beginning of a line and make sed delete line 2, if that's where the comment is)

    
    $ sed '2d' logo.ppm |  ppmtolss16 > logo.16
    


    To make a new logo, save a file as gif-file, sized 640*400 in 16 colors and convert it:
    
    $ giftopnm  < logo.gif > logo.pnm
    $ ppmtolss16 < logo.pnm > logo.16
    
    If you have problems, see note above. Re-insert logo into the image:
    
    $ knoppix-customize --image $IMAGE --action import_file --image_file . --local_file logo.16
    
    Warning Wrong filesize?
     

    As montioned above, knoppix-customize still has the serious limitations that the file size may not change at all. For the image this is a bigger problem than for the text files. One solution is to create a smaller logo and pad it with zeros:

    
    $ dd if=/dev/zero bs=1 count=541 >> logo.16
    
    Of course you'll have to choose the right number of missing bytes as value for count.



Tip Burn CD for each test?
 

Instead of on an ISO image you may perform these steps on a floppy boot image. So you can test boot without burning a CD every time:


$ knoppix-customize --image $IMAGE --action export_floppy --local_file boot.img
Now you can do all steps with "--image boot.img" and then put it on floppy:

$ dd if=boot.img of=/dev/fd0 bs=18k
You may even modify the floppy directly using "--image /dev/fd0". Test boot your floppy and when you're ready to burn the image insert the boot.img again:

$ knoppix-customize --image $IMAGE --action import_floppy --local_file boot.img




2003-04-27, Kester Habermann .