New Locale Workspace in OpenSolaris
By Jan Lana on Sep 17, 2009
A locale is a collection of files, and data, that contains the necessary information to adapt Solaris to a specific geographical market. It is essentially a "bundle", containing information such as date/time format, monetary and numeric format, or collation sequence.
From Solaris 10 8/07 further the majority locales is based on CLDR data. However a creation and addition of new locales has not been an easy process so far. Solaris 10 locales are packed by regions, and simultaneously different parts of one locale are stored in different packages (libc locale objects, Xserver data, CDE applications, ...). The origin idea was to minimalize number of packages - put together similar locales and parts and simplify dependencies. Unfortunately, the reverse was true. For example Spanish locales are located in West Europe region (Spain), North America region (Mexico, USA) and South America region (Argentina, Bolivia, ...). The same for French language, Portuguese laguage, ... If you need to install one locale, you have to install the whole region. For example for Polish you have to install all Central European locales. If you want to install Spanish, you install all West European, Nothern America and South America locales.
In Nevada project (Solaris Express) we have simplified the packaging. We re-packaged locales per language - for each language there are two packages only, SUNWlang-<language code> and SUNWlang-<language code>-extra, and the packages contain all data for the locales. The first package contains all UTF-8 locales, the “-extra” package contains locales with other codesets (ISO8859, KOI8, ...) and other files not necessary for UTF-8 locales.
The second issue was the Solaris installer – the installer was not designed for many new locales and it has many limitations. To add a new locale correctly to Solaris 10 installer is a bit of black magic. OpenSolaris brought a new installer. Big benefit of the OpenSolaris installer is that the boot environment (LiveCD) and the installed system is used the same packages. Solaris 10 boot environment (“miniroot”) uses special packages - to add a new locale to Solaris 10 means to do modification on two places - standard packages and miniroot package. This, and some another changes simplify new locales process a lot.
Our experience with Indian community that was willing to add aprox. 10 new Indian locales (integrated in the latest devel repository from build 123 that will be a part of next OpenSolaris release 2010.02) proved that it is not easy to contribute. In order to compile and test a new locale, many steps had to be done and tight cooperation with Sun engineering was necessary.
Due to the fact mentioned above and because it was too demanding to do so many steps manually, I changed locale packages compilation process from scratch and “moved” all manual steps into build scripts. To simplify the build process I created a separate mercurial workspace for the locale packages only.
I am excited with the result – a new locale can be created within several minutes. In order to setup a build machine you need 3 commands only, and 1 command to publish a new pkg to local IPS
|New Locale process description for Solaris 10, for Nevada, for Nevada with the new workspace and for OpenSolaris|
You can see the new workspace and how to use it at
Next week I am going to show you how to create a new locale in minutes.