星期五 九月 05, 2008

Just enjoy it :)

pkg:/SUNWscim-anthy@1.2.4,5.11-0.96:20080825T192330Z Info Manifest
pkg:/SUNWscim-chewing@0.3.1,5.11-0.96:20080825T192330Z Info Manifest
pkg:/SUNWscim-hangul@0.3.2,5.11-0.96:20080825T192331Z Info Manifest
pkg:/SUNWscim-pinyin@0.5.91,5.11-0.96:20080825T192331Z Info Manifest
pkg:/SUNWscim-sunpinyin@1.0,5.11-0.96:20080825T192335Z Info Manifest
pkg:/SUNWscim-tables-chinese@0.5.7,5.11-0.96:20080825T192355Z Info Manifest
pkg:/SUNWscim-tables-extra@0.5.7,5.11-0.96:20080825T192401Z Info Manifest
pkg:/SUNWscim-tables-india@0.5.7,5.11-0.96:20080825T192401Z Info Manifest
pkg:/SUNWscim-tables-japanese@0.5.7,5.11-0.96:20080825T192401Z Info Manifest
pkg:/SUNWscim-tables-korean@0.5.7,5.11-0.96:20080825T192402Z Info Manifest
pkg:/SUNWscim-tables@0.5.7,5.11-0.96:20080825T192354Z Info Manifest
pkg:/SUNWscim-thai@0.1.0,5.11-0.96:20080825T192402Z Info Manifest
pkg:/SUNWscim@1.4.7,5.11-0.96:20080825T192322Z Info Manifest

Our next plan is to integrate libm17n and scim-m17n. Stay tuned.

星期二 七月 22, 2008

为方便大家浏览查阅,将SunPinyin代码导读系列的blog整合为两部分,发布到OS.oinput-method项目网站上了,
后面还计划将第一部分翻译为英文(第二部份是比较特定于中文的)。

星期六 七月 05, 2008

I tried to test the scim/scim-bridge gtk-im-modules for 64bits applications, however, the gnome applications on Solaris are 32bits, except this one, /usr/demo/bin/{amd64,sparcv9}/gtkdemo.

Unlike Linux, which has different distributions for 32bits and 64bits (for both kernel and userland), Solaris ships them together (the default loaded kernel is 64bits).

星期一 五月 26, 2008

Before you start the build, make sure you have setup your build environment, you may refer to my blog "Setup Indiana as Developer Desktop for Gnu/Gnome".

Download the source tar file from stardict.sf.net, and apply the patch,

$ patch -p1 < stardict-3.0.1-on-ss12-patch.diff
$ ./autogen.sh --prefix=/usr --disable-festival --disable-espeak; make
# make install


The major problem of this porting, is related to my last entry, "Function Pointer as Template Parameter in SunStudio C++".

星期一 五月 05, 2008

After you install Indiana May Release (OpenSolaris 2008.05) in your box, you may need install the following packages to setup your box as a Gnu/Gnome developer desktop:

$ pkg install ss-dev SUNWxwinc SUNWxorg-headers SUNWgnome-common-devel \
  SUNWperl-xml-parser SUNWiconv-unicode SUNWiconv-extra SUNWgit

It's a little strange, that the gtk/gnome header files are shipped in the liveCD and got installed by default, but not the X11 headers (in SUNWxwinc).

Besides that, you may still need the CBE. If you already have the installation on other machine, directly copy them to your box could just work. Or, pkgadd(1) is still available to install the SVR4 packages.

星期三 三月 12, 2008

As I knew that IPS supports tagging on files (should be an attribute of 'file' action'?), and from the document I can tell, that tag is a key-value pair, e.g., arch=i386. And Indiana team may prefer to bundle the localization contents, such as messages and online helps, to base package. E.g., the french messages and docs of openoffice would not be shipped as individual packages, but in openoffice@2.3.1 package, so that you may set a filter to install them.

While I'm curious, can I specify the package patterns in a filter? Such as

(arc=i386 | arc=generic) &
    (packages=openoffice & locale=fr & (doc=true | message=true) |
     packages=all-installed & locale=fr & (doc=true | message=true) |
     packages=lang-french-support,ttf-french-fonts,...)


With this filter, I could install the docs and messages for openoffice and all existing packages (may already include oo), as well as the specified packages 'lang-french-support' and 'ttf-french-fonts'.

Certainly, lang-french-support and ttf-french-fonts should also have the locale=fr tag, while I may not want install all the fr l10n contents for un-installed packages.

And I assume that the sections or groups in IPS-Gui are actually filters, would the filters be able to be installed or updated by IPS updating, or enduser could import a filter?

I sent the above questions to pkg-discuss, while no response yet :(

星期五 一月 04, 2008

1. Resolve the dependency of gnu-gettext

In most cases, the gettext(3C) on solaris could fulfill the requirements of your application. You could make following change in configure.in (or configure.ac):

-AM_GNU_GETTEXT
+AM_GLIB_GNU_GETTEXT
+LTLIBINTL=
+AC_SUBST(LTLIBINTL)

The source package may ship with a completed gnu-gettext in its source tree (normally named 'intl'), remove it from the 'SUBDIRS' in the top-level Makefile.am. Sometimes, there is a 'm4' directory in the source tree, contains some macro files for checking gnu libraries or GCC compiler options, remove the option '-I m4' from 'ACLOCAL_AMFLAGS' in the top-level Makefile.am.

Then execute the following steps to update m4 macros and configure script:

glib-gettextize --force
aclocal $ACLOCAL_FLAGS
autoheader
libtoolize -c --automake
automake --add-missing
autoconf


Another note is, the gnu-gettext could not retrieve the localized message compiled by solaris' msgfmt (/usr/bin/msgfmt), but solaris' gettext works fine with the message compiled by gnu's msgfmt.

2. Build socket programs

You may find that the commonly used macro 'SUN_LEN' is not defined in Solaris, add the follow definition in your header file:

+#if defined(sun) && !defined(SUN_LEN)
+#define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
+#endif


And before you run configure script, set the LDFLAGS as following:

export LDFLAGS=-lsocket

3. 0-sized array member in C struct

struct Foo {int bar; char data[0];};

-char data[0];
+char data[];    //change the 0-sized array to flexible array


Note, according to C99 standard, the flexible array member could only be placed in the end of a structure. And this change will not impact the layout and size of the original data structure. (Thanks tchaikov for providing the perfect solution!) While, if the 0-sized array member is not on the tail, you may have to use 'union', which requires to change the accessing code.

4. struct initialization

struct point {int x, y, z;};
- struct point x = {x:2, z:3};
+ struct point x = {.x=2, .z=3}; // c99 extension,
not supported
                                 // by sunstudio C++ compiler

5. alloca(3C) on Solaris

You need include alloca.h in your source file where you call alloca(3C).

6. wchar_t

Do NOT assume a wide char is always a UCS4 character. It's true only in UTF-8 locales on Solaris.

7. Using gcc if the source uses too much gcc extensions.

The last choice, /usr/sfw/bin/gcc. The SunStudio C compiler and gcc are compatible in ABI. But C++ compilers are different. If you are building the package on SPARC platform, GCC4SS has better performance than gcc.

星期四 十一月 01, 2007



Today, I installed indiana preview release (get it here) on an existing solaris partition. And the installation time is a little longer than I expected. The only one issue I met is, after the installation, grub was not installed properly. So, we have to use installgrub(1) to reinstall it on MBR. The root password on livecd is "opensolaris".

Currently the software package repository is still small (have a look at http://pkg.opensolaris.org.) Anyway, it's the first step (also an important step), and I believe it will lead opensolaris to bigger success.

BTW, you may try to install Glassfish packages via IPS, refer to http://wiki.updatecenter.java.net/Wiki.jsp?page=MultiPlatformIPSPrototype.

星期三 十月 24, 2007

1. Configure the vnc password and default nic for xend service.

    # svccfg -s xvm/xend setprop config/vncpasswd="abc123"
    # svccfg -s xvm/xend setprop config/default-nic="bge0"
    # svcadm refresh xvm/xend
    # svcadm restart xvm/xend

The NIC must support the latest version of GLD (version 3), such as bge, e1000g, xge, nge, and rge devices. The way to determine if a NIC is GLDv3, run the dladm(1M) command with the 'show-link', and look for links that are not of type 'legacy'. In my case, my NIC device is bge0.

Refer to "Download, Installation, and Configuration Information"

2. Use virt-install(1M) to install the windows domain.

    # export DISPLAY=:0.0
    and you need enable your Xserver access from localhost

    # virt-install -n winxp --hvm -r 512 --vnc -f /export/winxp/winxp-disk.raw -s 10 -c /windows/media.iso
    # vncviewer :0

This will create a fully virtualized guest domain named as "winxp", 512M memory, 10G disk space. And then start to launch the installer in the installation CD image. With virt-install(1M), you DON NOT need qemu-img utility (get it from blastwave) to create the domain disk file.

Refer to "Using virt-install to Install a Domain"

3. After the initial installation is finished, that domain is poweredd off, to start it again

    # xm start winxp
    # vncviewer :0
  
While the post installer still needs load something from the CD image, while seems that the newly created domain does not remember its CDROM configuration. So I created a python configuration file ("xm block-attach" maybe a better solution), following the instructions in "Instant Windows—Recipe for Running Windows as a Guest on Solaris xVM", the only difference is I changed the vif to [ '' ] .

    # xm shutdown winxp
    # xm delete winxp
    # xm new winxp.hvm
    # xm start winxp

4. Finish the post installation of windows, and don't forget to install the security patches and antivirus software :)

星期二 十月 23, 2007

Thanks Jürgen Keil for the kindly help, I could boot solaris xVM off a ZFS root filesystem now.

Just one extra step to http://www.opensolaris.org/os/community/zfs/boot/zfsboot-manual,

# mount -F lofs -o nosub / /mnt
# cp /mnt/lib/libc.so.1 /zfsroot/lib

That's because the /lib/libc.so.1 is re-mounted by another more suitable libc for the running processor. E.g., for my Intel dual core, it's

$ mount -p | grep libc
/usr/lib/libc/libc_hwcap3.so.1 - /lib/libc.so.1 lofs - no

While, under xVM, the "sep" cpuid (see isainfo -v) feature isn't available.

This blog copyright 2009 by yongsun