Korean (other) locale support on OpenBSD through linux emulation HOWTO written by pilot (http://www.monkey.org/~pilot) [background] I have been using OpenBSD since OpenBSD 2.7. Many people using CJKV(Chinese, Japanese, Korean, and Vietnamese) and the other languages want to use their native languages on many programs such as netscape, mozilla and gaim. However, since the first release of OpenBSD, it does not have supported locales while FreeBSD does and NetBSD recently merged citrus codes. For this problem, many users hesitate to use the OpenBSD in spite of its stability and security; most Korean users said "OpenBSD does not support a locale. It sucks" The citrus (http://citrus.bsdclub.org/) project aims for the support of locales on the OpenBSD. Although dugsong@ and kevlo@ took parts in the project, this difficult project faced some problems such as conflict between libc and the citrus codes. Last year, I tried to convert the FreeBSD locale to OpenBSD, but could not solve the crash problem of OpenBSD's libc. So I think native locale support on the OpenBSD may be great work. (need libc hack and printf() style convert) this week, I found one possibility of the locale support on the OpenBSD through linux emulation because linux libraries support the locales; I hacked the linux libraries and finally succeeded in using Korean language. [Step by Step hacked(?) a locale on OpenBSD] The OpenBSD supports linux binary emulation [compat_linux(8)], which shows very good performance. (/usr/src/sys/compat/linux) Remember redhat_base port is English RedHat 6.2 version. Our goal is to localize the English RedHat 6.2 as in wowlinux (Korean linux distribution based on the RedHat). 1. confirm the 'option COMPAT_LINUX' in your kernel configuration file. examples-GENERIC) grep LINUX /usr/src/sys/arch/i386/conf/GENERIC 2. upgrade the port tree (http://www.openbsd.org/anoncvs.html) and then install redhat_base package. cd /usr/ports/emulators/redhat/base && make install clean 3. delete the rpm(misc/rpm) package because can not run a "rpm -i --ignoreos --dbpath /var/lib/rpm --root /emul/linux ..." pkg_info|grep rpm pkg_delete rpm-3.0.6p1 <- this is a rpm-3.0.6p1 on current 4. install the rpm2cpio package cd /usr/ports/converters/rpm2cpio && make install clean The following lines are only for Korean guys, but other people can use this method in the similar way. WORK DIR is /emul/linux . 5. add these lines into /emul/linux/usr/share/locale/locale.alias korean ko_KR.eucKR ko ko_KR.eucKR ko_KR ko_KR.eucKR ko_KR.euc ko_KR.eucKR 5. download the Korean locale and GTK Korean version into /emul/linux ftp.wowlinux.com/wow/6.2-Puberty/i386/RedHat/RPMS/locale-ko-2.1-2.noarch.rpm ftp.wowlinux.com/wow/6.2-Puberty/i386/RedHat/RPMS/gtk+-1.2.6-7kr.i386.rpm 6. download the ami (gtk-based Korean (hangul) input method program for XFree86 ) and Korean-netscape into /emul/linux ftp.wowlinux.com/wow/6.2-Puberty/i386/RedHat/RPMS/ami-1.0.5-1kr2.i386.rpm ftp.wowlinux.com/wow/6.2-Puberty/i386/RedHat/RPMS/netscape-navigator-4.74-0.6.2kr4.i386.rpm 7. extract the rpm packages using rpm2cpio into /emul/linux rpm2cpio locale-ko-2.1-2.noarch.rpm | cpio -id rpm2cpio gtk+-1.2.6-7kr.i386.rpm | cpio -id rpm2cpio ami-1.0.5-1kr2.i386.rpm | cpio -id rpm2cpio netscape-navigator-4.74-0.6.2kr4.i386.rpm | cpio -id 8. set up the environment variable, XMODIFIERS is for XFree86 4.x.x bash) cd /emul/linux;export LANG=ko;export XMODIFIERS="@im=Ami" csh ) cd /emul/linux;setenv LANG ko;setenv XMODIFIERS "@im=Ami" 9, run ami and netscape cd /emul/linux;usr/bin/ami&;usr/lib/netscape/netscape-navigator 10. press shift and space key simultaneously to use Korean (hangul) language on netscape ;-) Sample screenshot (input Korean(hangul) on netscape through ami) is available at http://www.monkey.org/~pilot/openbsd/openbsd_korean.gif Other Linux programs Linux library setting file is at /emul/linux/etc/ld.so.conf if you want other libraries, add line (/other/lib), do not execute /sbin/ldconfig but /emul/linux/sbin/ldconfig . To run a linux program on OpenBSD, you should know about linux libraries. (/emul/linux/etc/ld.so.conf) /usr/lib -> /emul/linux/usr/lib /usr/X11R6/lib -> /emul/linux/usr/X11R6/lib /usr/i486-linux-libc5/lib -> /emul/linux/usr/i486-linux-libc5/lib /other/lib -> /emul/linux/other/lib Example: gaim (http://gaim.sourceforge.net) and Korean version (http://www.intosea.com) search gaim's libraries at http://www.freebsd.org/ports/, then download the libraries (rpm), gaim Korean version in /emul/linux; extract them and run them to input Korean letters. Search linux programs in rpm at http://www.rpmfind.net and more sites (Korean linux distributions - ftp.wowlinux.com) You need this one - http://www.dqc.org/~brad/openbsd.jpg p.s OpenBSD compat_linux(8) doesn't support ****64 linux syscall. [thanks] r0ar.net 's bknight . #openbsd(efnet)'s friends with niness, dugsong@cvs.openbsd.org, kevlo@cvs.openbsd.org [references] kurati@bigfoot.com xpg4dl(citrus) convert to openbsd http://www.nurs.or.jp/~kurati/bsd/index-en.html kevlo@ and itojun@ 's conversation http://www.haun.org/ml/b-l-j/a/700/758.html dugsong@ 's citrus work ftp://ftp.monkey.org/pub/users/dugsong/citrus-obsd.tar.gz OpenBSD src tree http://www.openbsd.org/cgi-bin/cvsweb/src/sys/compat/linux/ OpenBSD compat_linux(8) manpage. FreeBSD ports http:/www.freebsd.org/ports/