Opened 4 months ago

Last modified 3 months ago

#2774 new enhancement

Compatibility for OpenBSD

Reported by: nickel Owned by:
Priority: minor Milestone: undecided
Component: installer Version: 0.9.47
Keywords: Cc: idk, mikalv
Parent Tickets: Sensitive: no

Description

Currently the installer doesn't work for OpenBSD, wrapper used for starting up is incompatible. Hence a separate tanukiwrapper (3.5.43) package has to be compiled and installed. This has been tested on x86_64 cpu, would probably work for x86 but I don't have a cpu with that instruction set, or could I just test on x86_64?

We could approach this from the wrapper which is vital then to jbigi and jcpuid which are just optimizations. Let me know, how to help

Subtickets

Attachments (2)

tanukiwrapper.tar.gz (4.1 KB) - added by nickel 4 months ago.
Tanukiwrapper-3.5.43
diff (873 bytes) - added by nickel 4 months ago.
postinstall.sh patch

Download all attachments as: .zip

Change History (10)

comment:1 Changed 4 months ago by zzz

please provide:

  • build instructions for the wrapper on openbsd, if there's anything special required
  • patch to installer/resources/postinstall.sh

Changed 4 months ago by nickel

Attachment: tanukiwrapper.tar.gz added

Tanukiwrapper-3.5.43

comment:2 Changed 4 months ago by nickel

Wrapper is still not part of the repository, so you need to
build from source on OpenBSD using the ports system

Install the ports system as root:
# usermod -G wsrc 'exampleuser'
# cd /usr
# mkdir -p ports
# chgrp wsrc ports
# chmod 775 ports
# cvs -qd anoncvs@…:/cvs checkout -P ports

Instructions to install wrapper as user(attachment):
$ cd /usr/ports
$ mkdir -p mystuff/java
$ cd mystuff/java
$ tar zxf <tanukiwrapper.tar.gz>
$ cd tanukiwrapper
$ make install

Based on your cpu, the ports system will choose to build
32 or 64 bit, or else give explicit value in BITS within
the Makefile, see line 29.

MODJAVA_BUILD_ARGS= -Dbits=${BITS}

Give me a little while for the postinstall.sh, I've installed
i2p using the port system itself, so the script never comes
into picture. I'll test and come up with diff.

comment:3 Changed 4 months ago by nickel

diff as required

--- installer/resources/postinstall.sh.orig
+++ installer/resources/postinstall.sh
@@ -82,7 +82,17 @@ case $HOST_OS in
         wrapperpath="./lib/wrapper/solaris"
         cp ${wrapperpath}/libwrapper.so ./lib/
         ;;
-    netbsd|openbsd|kfreebsd)
+    openbsd )
+        if [ ! `echo $OS_ARCH | grep amd64` ]; then
+            wrapperpath="./lib/wrapper/openbsd"
+        else
+            wrapperpath="./lib/wrapper/openbsd64"
+            # the 32bit libwrapper.so will be needed if a 32 bit jvm is used
+            cp ./lib/wrapper/openbsd/libwrapper.so ./lib/libwrapper-openbsd-x86-32.so
+        fi
+        cp ${wrapperpath}/libwrapper.so ./lib/
+        ;;
+    netbsd|kfreebsd)
         # FIXME
         # This isn't displayed when installing, but if we fall back to the "*)"
         # choice, no cleanup happens and users are advised to copy the wrapper
Last edited 4 months ago by zzz (previous) (diff)

Changed 4 months ago by nickel

Attachment: diff added

postinstall.sh patch

comment:4 Changed 4 months ago by zzz

Cc: idk mikalv added

Thanks for the contribution.

We don't know much about the ports system. Mikalv was working on it for i2pd last year; that work appears to be stalled, see http://openbsd-archive.7691.n7.nabble.com/new-net-i2pd-2-25-0-td368026.html for the info. I believe he was going to do java i2p after that, but doesn't look like it's going to happen.

If you would like to get it into ports as a 'downstream' package, you should do that, I don't think we have the time or knowledge to support it.

What we can do, if we can find the time, is to build the wrapper following your instructions, and apply and test the postinstall.sh patch, and check it all in as a one-time project, so we have support in the standard installer.

cc'ing idk mikalv

comment:5 Changed 4 months ago by zzz

I checked our jbigi and jcpuid java code, we do have support in the code to load openbsd libs if present, so we'd just have to build and test the libs and check them in to be bundled in the installer.

I don't know if freebsd ports is anything like openbsd ports, but we've had a downstream freebsd port for many many years, perhaps there's something to be learned from it: https://svnweb.freebsd.org/ports/head/security/i2p/

comment:6 Changed 4 months ago by nickel

My intention wasn't to divert towards building an i2p "port", since it is already done. It lies among the ports mailing list right now, and would probably be committed to the repo. Since there exist already support downstream, the only next step was to push the support upstream. All the jbigi, jcpuid optimizations and plugins have already been tested. I believe only work required will be to include the compiled files and then configure and test the installer.

I think Mikal Villa has really let go of the i2pd port since it has been committed, he's probably busy and pushing new ports and updates through the mailing list is sluggish due to the small number of OpenBSD devs.

comment:7 Changed 4 months ago by zzz

OK, good, we're on the same page.

I didn't know that the i2pd port of mikal's got accepted, but I found it here: https://openports.se/net/i2pd
When the java i2p port gets accepted, please let us know.

Our preference is to find or setup our own openbsd build and test platform so we can do the support ourselves, but that may take some time.

comment:8 Changed 3 months ago by zzz

Reported complete by OP https://openports.se/net/i2p
No immediate need for us to apply the patch in comment 3 and the wrapper/jbigi binaries, as we expect users to install via ports.

Note: See TracTickets for help on using tickets.