Localized LiveCD
From openSUSE
Here is a Howto make a localized LiveCD of openSUSE 11.1 with Kiwi. This method is the one tried by Jean Cayron, based on the Howto of Vavai. It may be improved.
Contents |
Introduction
As the openSUSE live CD are only shipped with English and German translations, if one needs to promote his favorite distribution in another language, a localized LiveCD may be useful. In that exemple, one needed to do it in Walloon, a minority language. But the case can be extended for all languages.
Preparation
1. You need to have a clean install of openSUSE with the same programs than the ones you'll have on the LiveCD and the desired locale fully installed.
2. Install Kiwi tools
# zypper ar http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.1/ kiwi # zypper ref # zypper in kiwi kiwi-tools kiwi-config-openSUSE kiwi-desc-isoboot kiwi-desc-usbboot createrepo squashfs
You can do it also with Yast modules, adding the repository http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.1/ and installing the packages kiwi kiwi-tools kiwi-config-openSUSE kiwi-desc-isoboot kiwi-desc-usbboot createrepo squashfs
3. Create local repositories as base installation source. The easiest way to make local repositories is by mounting manually your Installation DVD and your Add-on language CD or by mounting the ISO's. You may use online repositories if you have fast and stable internet connection but be careful, all the packages will be downloaded in your root partition before installation. So, you need to have plenty of room in it, otherwise you could damage your system (consider that you must also have room both kiwi source (1,8 G) and kiwi image (700 Mb), if you build it in the same partition).
4. In this scenario, the DVD and the ISO of the Add-on language CD are mounted. To know where to find your DVD, run the command df and find your DVD/CD in the list. In this case it's /dev/sdb1.
For the DVD
# mkdir /mnt/DVD # mount /dev/sdb1 /mnt/DVD
For the ISO image
# mkdir /mnt/iso # mount -o loop openSUSE-11.1-Addon-Lang-i586.iso /mnt/iso/
If you want to add other packages like some that are on OSS but not on the DVD, you can creat a repomd (Yum) repository on your computer. Copy the RPM files in it and create the repo with the command :
# createrepo /path-to-the-folder/Repo
Run it each time you change the content of the repository.
Configuring schema
5. Go to /usr/share/openSUSE-kiwi/ and choose the schema you want to use (liveCD KDE4, KDE3, Gnome...). In this scenario we will use KDE4.
6. Make a copy of the schema you have chosen to work on it.
# cp -r /usr/share/openSUSE-kiwi/livecd-kde /usr/share/openSUSE-kiwi/livecd-kde-i18n
7. Open the configuration schema with a text editor : /usr/share/openSUSE-kiwi/livecd-kde-i18n/config.xml
8. Optional : Change header of configuration schema, e.g : author, contact, specification and version.
9. Change the locale :
<locale>en_US.UTF-8</locale>
into your locale.
10. Change the important portion : Base installation source from :
<repository type="yast2"> <source path="http://download.opensuse.org/distribution/11.1/repo/oss/"/> </repository>
into
<repository type="yast2"> <source path="/mnt/DVD/"/> </repository> <repository type="yast2"> <source path="/mnt/iso/"/> </repository>
As you have created a local repository, add :
<repository type="rpm-md">
<source path="/path-to-the-folder/Repo/"/>
</repository>
11. If you have no internet connection, remove this portion :
<repository type="rpm-md"> <source path="http://download.opensuse.org/repositories/openSUSE:/11.1:/Live/standard/"/> </repository>
and
<package name="openSUSE-release-livecd-kde"/>
(it comes twice, remove it twice).
12. Remove the German translation packages to make some room and replace it by the ones from your language (if exists)
<package name="aspell-de"/> <package name="bundle-lang-common-de"/> <package name="bundle-lang-kde-de"/> <package name="kde3-i18n-de"/> <package name="kde4-l10n-de"/> <package name="translation-update-de"/> <package name="yast2-trans-de"/>
There are other translation packages but installing them all would make your image too large to fit in a CD. These package are these ones bundle-lang-other bundle-lang-common bundle-lang-kde bundle-lang-gnome eel-lang glib2-lang gtk2-lang kdebase4-openSUSE-lang PolicyKit-kde-lang powerdevil-lang simple-ccsm-kde-lang glibc-i18ndata desktop-translations PackageKit-lang, etc.
To have a fully localized build, you'll add later the MO files from your locale to the source of the image.
Prepare the system
13. Run the first stage process, creating the source of the image. You need a folder to store the source of the system (the system uncompressed), it may be around 1.8 Gb. You may use your /tmp/ folder but be careful not to fill up your root or tmp partition, it could damage your system. In this scenario we used a folder in our home partition in /home/user.
kiwi --prepare /usr/share/openSUSE-kiwi/livecd-kde-i18n --root /home/user/kde4-source --logfile terminal --force-new-root
If there is an error, read the output : it can be a dependency problem, a typing error... There are two main problems that usually occur on that stage: error with base installation source and package not found. If it stopped after having already installed packages, you can use the command hereunder to avoid to restart everything:
kiwi -u /home/user/kde4-source
You have now a full system tree in the kde4-source folder. You can browse in it (as root).
Modify the source
14. Change the locale preferences for the Desktop environment in the newly created kde4-source/ folder.
Open in a text editor (as root) the file home/linux/.profile and add this line:
export LANG=wa_BE.UTF-8
where you replace wa_BE.UTF-8 with your locale.
For KDE, open in a text editor (as root) the file home/linux/.kde4/share/config/kdeglobals and add the following lines:
[Locale] Country=be DateFormat=%A %d di %B %Y Language=wa
where you replace be with your country code, the DateFormat with your locale one and the wa with your language code. To make it simple, just copy this portion from your own local kdeglobals file (if in the same locale). If your language is not fully translated, you can also add a fall-back language by using : between the language code. In this example, I can add French as second language:
Language=wa:fr
For Gnome, the .profile may do the trick.
15. Copy the missing translations from your local system (see point 1) to the source of the image (change wa by your locale code) :
# cp -u /usr/share/locale/wa/LC_MESSAGES/*.mo /home/user/kde4-source/usr/share/locale/wa/LC_MESSAGES/
Check if there is a folder /home/user/kde4-source/usr/share/locale-bundle/wa (where you replace wa with your locale).
If not, then run:
# cp -r /usr/share/locale-bundle/wa /home/user/kde4-source/usr/share/locale-bundle/
If yes, then run:
# cp -u /usr/share/locale-bundle/wa/LC_MESSAGES/*.mo /home/user/kde4-source/usr/share/locale-bundle/wa/LC_MESSAGES/
You can also copy the KDE3 translations if needed:
# cp -u /opt/kde3/share/locale/wa/LC_MESSAGES/*.mo /home/usr/kde4-source/opt/kde3/share/locale/wa/LC_MESSAGES/
or (see remark above)
# cp -r /opt/kde3/share/locale/wa /home/usr/kde4-source/opt/kde3/share/locale/
16. Optionally, you can change other things but be aware to respect the openSUSE Trademark Guidelines (We suppose here that copying the *.mo files from a clean installation from the official sources can be admitted as Project-based modifications)
Generate the ISO
17. Run the command:
# kiwi --type iso --create /home/user/kde4-source -d /home/usr/kde4-iso --logfile terminal --check-kernel
18. ISO image can be found in /home/user/kde4-iso. Run the image by burning the ISO image into a CD or DVD or run the ISO with VMWare or VirtualBox or Xen Virtualization
Comments
- If your image is to big, you'll have to remove some packages.
- To build a 64 bit image, you'll need a 64 bit installation to run kiwi. In the opposite case, there is no way to build a 32bit image on 64bit installation.
- I had some keyboards issue but cannot say if this should occur for you with this tutorial.
Links
- Article about the localized LiveCD created with this method (wa)
- Suse Studio, an easier way to make images
Categories: Localization | Kiwi | HOWTOs

