Hebrew OpenSolaris 2008.11

We needed to create a modified OpenSolaris 2008.11 release for our Hebrew customer.

Our Hebrew customer had these requirements:

  • Keyboard layout should be automatically set to English, without prompting a user (during the boot from the Live CD)
  • Desktop language should be automatically set to Hebrew, without prompting a user (during the boot from the Live CD)
  • All desktop icons should be localized into Hebrew
  • Change default terminal font

And we fulfilled with pleasure his wishes. Here is our how to.

Creating Hebrew image

System requires:

  1. Distribution Constructor
  2. Local Repository
  3. Caiman Project source

1. Distribution Constructor

For more information on what Distribution Constructor is and How to use it, please read the blog about Distribution Constructor

2.  Local Repository

Local repository was required for publishing our changed packages (SUNWslim-utils)

Two ways exist to start an empty repository:

Start local repository manually:

Open terminal and run the following command:

 $ /usr/lib/pkg.depotd -d ~/repo -p 10000

This command creates directory repo in home directory, and local repository is running on port 10000

You can access http://localhost:10000 via web browser to confirm the repository is running. The page will indicate number of packages is zero.

Note - you must keep running terminal window and after reboot it's necessary start local repository again.

Start local repository as a system service

In terminal:

$ pfexec sh

Set repository's listen port, e.g.: 10000 

# svccfg -s pkg/server setprop pkg/port=10000

Set repository's storage to repo/dir e.g.: ~/repo

# svccfg -s pkg/server setprop pkg/inst_root=~/repo

Refresh repository:

# svcadm refresh pkg/server 

Enable repository:

# svcadm enable pkg/server

Restart repository:

# svcadm restart pkg/server

Confirmation of running repository - open web browser and type: http://localhost:10000

Check the contents of the repository:

# ls ~/repo

This system service is enabled from now and it's automatically enabled after every reboot.  

3.  Caiman Project source

We needed to add Hebrew translations of desktop icons on the Live CD. The package which includes desktop icons on the Live CD is SUNWslim-utils and is part of Caiman  projects.

Required Packages:

  • SUNWonbld
  • SUNWmercurial
  • SUNWwbint
  • SUNWzoneint
  • SUNWldskint

The package SUNWmercurial can be installed directly from the OpenSolaris.org repository by Package Manager or by the following command:

$ pfexec pkg install SUNWmercurial

The packages SUNWwbint, SUNWzoneint and SUNWldskint must be downloaded from OpenSolaris Download Center.

Download packages according to your architecture!

To install use command pkgadd (run these commands in the same directory where you downloaded the packages)

Note - For all questions answer y (yes)

$ pfexec pkgadd -d SUNWwbint.i386.pkg
$ pfexec pkgadd -d SUNWldskint.i386.pkg
$ pfexec pkgadd -d SUNWzoneint.i386.pkg

The package SUNWonbld can be downloaded from the ON downloads page. The package is in a compress form: SUNWonbld.i386.tar.bz2

Decompress SUNWonbld.i386.tar.bz2

In terminal (in the same directory where you download this package) type:

$ bunzip2 SUNWonbld.i386.tar.bz2

$ tar -xvf  SUNWonbld.i386.tar

$ cd onbld

$ pfexec pkgadd -d . SUNWonbld

Note - For all questions answer y (yes) 

The best way to get the source code for the Caiman projects is to use the Mercurial repository. Obtain a local copy of the source using:

$ cd ~
$ hg clone ssh://anon@hg.opensolaris.org/hg/caiman/slim_source slim_source

The slim_source directory was created in your actual directory.

To build this repository use the following steps:  

$ cd slim_source/usr/src
$ cp tools/env/developer.sh .; chmod +wx developer.sh

GATE, CODEMGR_WS and PATHS need to be changed as follows:

$ gedit developer.sh
  export GATE=slim_source;
export CODEMGR_WS="/directory/where/you/downloaded/slim_source${GATE}"; 
  BUILD_TOOLS=/opt;                       export BUILD_TOOLS
  ONBLD_TOOLS=/opt/onbld;                 export ONBLD_TOOLS
  SPRO_ROOT=/opt/SunStudioExpress;        export SPRO_ROOT

We edited desktop icons sources of package SUNWslim-utils - can be found in ./cmd/slim-install/user/jack directory.

We added Hebrew strings for desktop icons (ddu.desktop, getting_started.desktop and install-icon.png). We used the CTI application for translating. Then we used Sun Tools (also include in the CTI) to convert and download translated Hebrew strings.

To create SVR4 packages run:

$ /opt/onbld/bin/nightly developer.sh 

After a few minutes compilation is done.

Our new compiled package SUNWslim-utils is located in slim_source/i386/nightly-nd/SUNWslim-utils directory.

Publishing SVR4 Package to the local repository

SVR4 packages can be published to the IPS repository by using the pkgsend command. Our repository is running on localhost on port 10000

We need to know what version of package we are going to publish. Actual version of SUNWslim-utils on official repository http://pkg.opensolaris.org/release  was: SUNWslim-utils@0.5.11,5.11-0.101
Published package must have the same or higher version, otherwise the Distribution Constructor will ignore it!

Open the transaction:

$ eval `pkgsend open SUNWslim-utils@0.5.11,5.11-0.101`

Import the package

$ pkgsend import SUNWslim-utils

Close the transaction

$ pkgsend close 

Open web browser and type: http://localhost:10000 to verify if SUNWslim-utils is published to this repository. In this way the Distribution Constructor will compare versions of SUNWslim-utils packages and choose a newer/higher version automatically.

Creating Hebrew Image

Editing the Manifest File as following

  • The name of the release - <distribution name="Hebrew_OpenSolaris-RC2">
  • The default url <pkg_repo_default_authority> - url="http://localhost:10000"
  • Any additional non-preferred authorities <pkg_repo_addl_authority> - url="http://pkg.opensolaris.org/release" and authname="opensolaris.org"/>

Don't forget to uncomment an additional non-preferred authorities before using!

You can find more information about what the Manifest File is and how to edit it in blog about the Distribution Constructor.

Running the Distribution Constructor:

Run Distribution Constructor with the snapshot option. We paused building process in step 1 and edited startup script to set up the US keyboard and the Hebrew local there.

$ pfexec distro_const build -p 1 all_lang_slim_cd.xml

When Distribution Construction paused the building, created the snapshot: rpool/dc/build_data@.step_im-mod

To verify existing snapshots type following command:

$ zfs list -t snapshot | grep mod

We destroyed this snapshot - rpool/dc/build_data@.step_im-mod

$ pfexec zfs destroy rpool/dc/build_data@.step_slim-im-mod

Note - the snapshot name can be different.

Then we made changes - edit the startup script to choose automatically the Hebrew keyboard layout and the Hebrew locale during the boot from Live CD.

$ cd /rpool/dc/build_data/pkg_image/lib/svc/method/

We edited file live-fs-root

$ pfexec gedit live-fs-root

Last section looked like following:

 # Ask user to configure Keyboard Layout
	export TERM
	exec /dev/console 2>&1
	if [ "x$assistive_tech" != "x" ] ; then
		echo -e \\\\a
	/usr/bin/kbd -s US-English

	# Ask user to configure Language
	if [ "x$assistive_tech" != "x" ] ; then
		echo -e \\\\a
	# /usr/sbin/set_lang
        mkdir -p "/etc/sysconfig"

        # store the selected language to the gdm configuration file
        printf "RC_LANG=he_IL.UTF-8" > "/etc/sysconfig/language"

	# /usr/bin/setup.sh
	livemode=`prtconf -v /devices|sed -n '/livemode/{;n;p;}'|cut -f 2 -d\\'`
	if [ "$livemode" = "text" ]; then
		/usr/sbin/svcadm disable -t application/graphical-login/gdm
		/usr/sbin/svcadm enable application/graphical-login/gdm

The terminal font looks ugly in Hebrew locale. See bug 5349


We created file local.conf in /rpool/dc/build_data/pkg_image/etc/fonts with this content:

<?xml version="1.0"?> 
       <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> 
       <match target="pattern"> 
               <test qual="all" name="family"> 
               <test qual="all" name="lang" compare="contains"> 
               <edit name="family" mode="assign"> 
               <edit name="style" mode="assign"> 

Then we recreated deleted snapshot rpool/dc/build_data@.step_im-mod

$ pfexec zfs snapshot rpool/dc/build_data@.step_im-mod

and resumed building the image from step 1

$ pfexec distro_const build -r 1 all_lang_slim_cd.xml

The Distribution Constructor started building our image form created snapshot pool/dc/build_data@.step_im-mod which contained our changes.

After a while, the building process finished successfully and we found our images: Hebrew_OpenSolaris-RC2.iso and Hebrew_OpenSolaris-RC2.usb in /rpool/dc/media

Note - To burn the image on a CD use your favorite burning application.

To create a bootable USB flash disk form Hebrew_OpenSolaris-RC2.usb use the command:

$ pfexec usbcopy Hebrew_OpenSolaris-RC2.usb


Unfortunately, we hit the bug  5226
Our workaround was simple: we just added Hebrew strings to the installed SUNWslim-utils package in  /rpool/dc/build_data/pkg_image/jack/Desktop

Owing to Jan(dot)Damborsky(at)sun(dot)com help!


Post a Comment:
  • HTML Syntax: NOT allowed

Solaris l10n & i18n, locales, keyboards, fonts and related topics.


« July 2016