From owner-freebsd-emulation@FreeBSD.ORG Fri Jun 23 11:33:58 2006 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E302E16A492 for ; Fri, 23 Jun 2006 11:33:57 +0000 (UTC) (envelope-from dima@apk-inform.com) Received: from apk-inform.com (apk-inform.com [82.207.49.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF50943D46 for ; Fri, 23 Jun 2006 11:33:56 +0000 (GMT) (envelope-from dima@apk-inform.com) Received: from alpha.aic-inf.dp.ua (alpha.aic-inf.dp.ua [10.0.2.5]) by apk-inform.com (8.12.11/8.12.11) with ESMTP id k5NBXlP0077688 for ; Fri, 23 Jun 2006 14:33:53 +0300 (EEST) (envelope-from dima@apk-inform.com) Date: Fri, 23 Jun 2006 14:35:20 +0300 From: Dmitry Ganenko X-Mailer: The Bat! (v1.61) UNREG / CD5BF9353B3B7091 X-Priority: 3 (Normal) Message-ID: <885310187.20060623143520@apk-inform.com> To: freebsd-emulation@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----------D4EAE116F414BE" Subject: Installation of Oracle10g Express Edition on FreeBSD 5.4-RELEASE X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dmitry Ganenko List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2006 11:33:58 -0000 ------------D4EAE116F414BE Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Introduction It is impossible to hold in check a tear of tender emotions while reading a press release of the Oracle Corporation: "REDWOOD SHORES, California, Moscow, November,10, 2005 - the Oracle Corporation announced the release of Oracle Database 10g Express Edition (Oracle Database XE),a free version of the world-wide known DBMS for developers. The Beta-version of Oracle Database XE can be loaded from the website of the Corporation. New edition of DBMS Oracle Database 10g enables software developers, DB administrators and all those using the Oracle technology for the first time to get a free basic version of the DBMS which allows starting developing and expansion of their own applications. Besides, this version is proposed free to independent software developers and equipment suppliers for free distribution and embedding into their own applications. "Oracle Database XE enables developers, DB administrators, independent software suppliers and students to study, create and develop their own applications on the basis of the most advanced DBMS for free", says Thomas Kyte, the Oracle vice- president. "Nobody has ever supposed such a thing - anybody is able to start his work with the best market solution." You see, the most advanced Oracle has come nearer to common people. But as usually it has been nearer to Windows and Linux users. All the best is for children! But why are we worse? So, students, developers, administrators, let us start! 1. Playing the role of kernel hackers First of all, we should patch kernel - just a little. Having tried to launch oracle for some days with the following actions: using ktrace - kdump; then (after having guessed to pay attention on ports and joyfully detected linux_kdump there) using the last one; rummaging in kernel sources; scratching the back of your head; murmuring quietly abusive words about Oracle Corporation programmers, FreeBSD developers, Linus Torvalds, Larry Ellison and, of course, Bill Gates (nobody knows why him exactly!); dreaming in nightmares about teenage Daemons with pitchforks which fight with Penguins in red caps and then, after a short reconciliation, crash windows throughout all the Silicone Valley - at last you are to recognize: the kernel should be unbent, it really should! The first patch corrects the error in the Linux emulator in the linux_time() function (or maybe it is not an error) File patch1 --- compat/linux/linux_misc.c.orig Fri Apr 1 01:17:42 2005 +++ compat/linux/linux_misc.c Wed Jun 21 11:14:05 2006 @@ -711,8 +711,9 @@ linux_times(struct thread *td, struct li tms.tms_cutime = CONVTCK(td->td_proc->p_stats->p_cru.ru_utime); tms.tms_cstime = CONVTCK(td->td_proc->p_stats->p_cru.ru_stime); - if ((error = copyout(&tms, args->buf, sizeof(tms)))) - return error; + if (args->buf != NULL) + if ((error = copyout(&tms, args->buf, sizeof(tms)))) + return error; microuptime(&tv); td->td_retval[0] = (int)CONVTCK(tv); The second patch is for linprocfs. Don't ask me why it should be done exactly this way. It was found experimentally and by peeping into SuSE Linux 9.2 (It works somehow there...) File patch2 --- compat/linprocfs/linprocfs.c.orig Fri Apr 1 01:27:16 2005 +++ compat/linprocfs/linprocfs.c Wed Jun 21 11:14:10 2006 @@ -515,7 +515,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS) sbuf_printf(sb, "%d", p->p_pid); #define PS_ADD(name, fmt, arg) sbuf_printf(sb, " " fmt, arg) PS_ADD("comm", "(%s)", p->p_comm); - PS_ADD("statr", "%c", '0'); /* XXX */ + PS_ADD("statr", "%c", 'S'); /* XXX */ PS_ADD("ppid", "%d", p->p_pptr ? p->p_pptr->p_pid : 0); PS_ADD("pgrp", "%d", p->p_pgid); PS_ADD("session", "%d", p->p_session->s_sid); @@ -535,7 +535,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS) PS_ADD("priority", "%d", 0); /* XXX */ PS_ADD("timeout", "%u", 0); /* XXX */ PS_ADD("itrealvalue", "%u", 0); /* XXX */ - PS_ADD("starttime", "%d", 0); /* XXX */ + PS_ADD("starttime", "%d", 1); /* XXX */ PS_ADD("vsize", "%ju", (uintmax_t)kp.ki_size); PS_ADD("rss", "%ju", P2K((uintmax_t)kp.ki_rssize)); PS_ADD("rlim", "%u", 0); /* XXX */ The third patch corrects a bug (or maybe a feature) in the pseudofs code (it is necessary for linprocfs). The case is, if you assemble linprocfs and try such a program, then the read function will read not 4 as it was asked but one point less, that is, as it is easily calculated, 3 bytes: File test.c #include #include #include #include main () { int fd, count; char buf[10]; fd = open("/compat/linux/proc/self/cmdline", O_RDONLY); count = read(fd, buf, 4); buf[4] = '\0'; printf("count = %d, buf = %s\n", count, buf); } I am not sure whether the third correction is absolutely right; moreover, I am not sure as to its place in the code. This question is to real kernel hackers. File patch3 --- fs/pseudofs/pseudofs_vnops.c.orig Mon Sep 6 22:38:01 2004 +++ fs/pseudofs/pseudofs_vnops.c Wed Jun 21 11:14:14 2006 @@ -530,7 +530,7 @@ pfs_read(struct vop_read_args *va) PRELE(proc); PFS_RETURN (EIO); } - sb = sbuf_new(sb, NULL, buflen, 0); + sb = sbuf_new(sb, NULL, buflen+1, 0); if (sb == NULL) { if (proc != NULL) PRELE(proc); We correct our kernel: # cp patch1 patch2 patch3 /usr/src/sys # patch < patch1 # patch < patch2 # patch < patch3 Then (it goes without saying)as it has always been done for Oracle launching not only in FreeBSD, but also on Linux itself, we add the following to the configuration of the core: options COMPAT_LINUX #it is as you would like it, you may load the module options SEMMAP=128 options SEMMNI=128 options SEMMNS=32000 options SEMOPM=100 options SEMMSL=250 options SHMMAXPGS=262144 options SHMMNI=4096 options SHMSEG=4096 options MAXDSIZ="(1024*1024*1024)" # as to this and what is below I am not sure options MAXSSIZ="(1024*1024*1024)" options DFLDSIZ="(1024*1024*1024)" So, we compile, install, reboot... and go on. 2. We install the right linux_base Though it is written in the Oracle10g Express Edition Installation instruction that the glibc version should be >=2.3.2, it seems to be naive to believe everything that is written. It is going to work with the version >=2.3.3. Anyhow, mine didn't start working. At binary launching something told me about a relocation error and mentioned some symbols GLIB_2.3.3 or something of the kind. That is why instead of linux_base-8 you should install linux_base-fc4 (or linux_base-suse-9.2). # cd /usr/ports/emulators/linux_base-fc4 # make # make install Then we find somewhere libaio-0.3.104-2.i386.rpm for FC4 and install it with the help of rpm # rpm --root=/compat/linux --ignoreos --ignorearch --nodeps -ivh libaio-0.3.104-2.i386.rpm You also should mount linux procfs # echo "linproc /compat/linux/proc linprocfs rw 0 0" >> /etc/fstab # mount /compat/linux/proc 3. We install Oracle10g Express Edition We take distributive Oracle XE for linux86 (oracle-xe-univ-10.2.0.1-1.0.i386.rpm) from otn.oracle.com. Of course, you may also take distributive for Win32, but anything written above or below will have nothing to do with it. Install it with rpm: # rpm --root=/compat/linux --ignoreos --ignorearch --noscripts --nodeps -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm It is installed in /compat/linux/usr/lib/oracle, but it is unlikely to work. You should replace it into /usr/lib/oracle with no variations. It is assembled by this path, this bright path is registered everywhere in scripts, so you have nothing to do but agree with it: # mv /compat/linux/usr/lib/oracle /usr/lib We launch the following script, answer two or three questions and go out to smoke. (If you are a non-smoker, you may have a cup of tea or coffee). Smoking should be fast, tea or coffee should be gulped because in some two minutes you will have Oracle10g Express Edition installed and working at your FreeBSD; moreover, you'll be able to use it any way, absolutely free, with your favorite operational system. File install.sh skipped (it is not interesting, and so long). You may found it and patches in the attached file. PS. This article in russian you may also read here http://wiki.bsdportal.ru/doc:oraclexe_on_freebsd With best regards Dmitry Ganenko ------------D4EAE116F414BE Content-Type: application/octet-stream; name="orainst.tar.gz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="orainst.tar.gz" H4sIAInGm0QAA+0bbVvbyDFfrV+xJ8hhA7Yl4xdqztxRcBpaB1zs9HJPyBlZWhsVW9JpJSC95r93 ZnclS5ZtIA+h97TeEGTvzvvOzM7uCtc3bIcF5VffsGlaVWvUavDkbf7JP+tatVqvNvYaev2Vput7 jeorUvuWQkUtZIHhE/LKd91gFdzdNaWTlxDoZZsr5x+e5oTe0xK7fnYemq6tmv+KpjfE/Fe0BgAC /F6tsveKaM8uyYL2fz7/G9+Vh7ZTZteKcn5xdNxpD96ev2u3yiHzyxN7KP2ifE/LhudF3zzftUIz KOtaqVLSyoz6t9SP8M9/PmtftARk1Nc7PWl9aCu9v3e6nfe91maClWD/28SbhEzp9M4usqMT5vhm MFHovef6AUkMz3UBm6ine9R/m6HU3MTuCKRzMuic/vni6OKXQRYadFcU02CUqJu6SmyHKOgoQUHJ UfPaJUWHqD3ssJ0xOefKkhMjMIaIomtj0r73fMoYaVt2YLsOOYUoMxyTlkolVcl5U9dpXXmMFN+T zaThyL8JHfvUIwgx2JwptnV5uAWDfKx4y59XSs4ekY8gIQKrpEVUlXw6UHLBNXWUHIHGQlJkcxyK JmCgpQnXSCWHpGzR27ITTiakcvi9/gCqnEUcLTvuxB2Tn1KmM11nZI/LzPRtL2BlzsQalmCOF7Ea 2dKi6onrUDDNwQFY2vXShnY97w9k6O+eYuknm8v1nmat7YJCZBND75kxpk1yhSZyjCklm9oV+Z3P w7+R/Bc1RgB0ygxTgZiwA6Ip/+10tG4v3KL1H38Zk8m3WP7F+t9Ytv5XKo16na//1cqeX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