blob: 6fa2c35c92c9a34bb93ad16389bb4b26f7c38b2e [file] [log] [blame] [view]
Andrew Gerrand5bc444d2014-12-10 11:35:11 +11001# Go on OpenBSD
2
Constantine A. Murenin1beb25b2015-02-25 20:26:18 +00003Go is available within the OpenBSD ports tree collection since OpenBSD 5.2. It is marked as i386- and amd64- only. See [`ports/lang/go`](http://ports.su/lang/go) for details.
Constantine A. Mureninc2964ab2015-02-25 20:04:31 +00004
5| **OpenBSD release** | **golang in ports** |
6|:--------------------|:--------------------|
Dimitri Sokolyuk6502da82015-10-19 17:15:00 +02007| 5.8 (Oct 18, 2015) | go-1.4.2 |
Jack Peirce67c88152015-05-07 20:20:37 -06008| 5.7 (May 1, 2015) | go-1.4.1 |
Constantine A. Murenin1beb25b2015-02-25 20:26:18 +00009| 5.6 (Nov 1, 2014) | go-1.3p0 |
10| 5.5 (May 1, 2014) | go-1.2p0 |
Constantine A. Murenin6d38e5e2015-02-25 20:14:34 +000011| 5.4 (Nov 1, 2013) | go-1.1.1 |
12| 5.3 (May 1, 2013) | go-1.0.3 |
13| 5.2 (Nov 1, 2012) | go-1.0.2 |
Constantine A. Mureninc2964ab2015-02-25 20:04:31 +000014
15## Building from source.
16
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110017Required:
18
Mikio Hara79689152015-01-16 13:22:07 +090019 * OpenBSD amd64, 386: 5.5 and above
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110020 * If you want to run go1.3 or 1.4 on OpenBSD 5.6, see http://golang.org/issue/9102
21
22| **Kernel version** | **Min. version** | **Max. version**|
Dave Day682cb022014-12-10 15:32:04 +110023|:-------------------|:-----------------|:----------------|
Mikio Harad337b6c2015-05-21 10:08:49 +090024| 5.7 | go1.4.1 | go1.5 |
Mikio Hara9216f902015-01-15 15:08:14 +090025| 5.6 | go1.4.1 | go1.5 |
Andrew Gerrand5bc444d2014-12-10 11:35:11 +110026| 5.5 | go1.3 | go1.5 |
27
28 * ulimits (` /etc/login.conf `)
29
30Edit the /etc/login.conf so that the staff class has the proper
31settings. The following is a working example of the staff class:
32```
33staff:\
34 :datasize-cur=infinity:\
35 :datasize-max=infinity:\
36 :datasize=infinity:\
37 :openfiles-cur=4096:\
38 :maxproc-max=512:\
39 :maxproc-cur=512:\
40 :ignorenologin:\
41 :requirehome@:\
42 :tc=default:
43```
44
45After editing the login.conf you'll need to rebuild the database with:
46```
47# cap_mkdb /etc/login.conf
48```
49
50```
51ulimit -n 512
52ulimit -p 512
53ulimit -d 2036792
54```
55
56Add the login class to the user you would like to have build go
57```
58# vipw
59```
60
61Look for the 5th element which is the login class, this is blank by
62users added by useradd. In the following example the user operator
63would be added to the staff class
64```
65## Before
66operator:*:2:5::0:0:System &:/operator:/sbin/nologin
67
68## After
69operator:*:2:5:staff:0:0:System &:/operator:/sbin/nologin
70```
71
72## Under KVM
73
74If under KVM on Lucid, you don't need to disable ` mpbios `, but the OpenBSD kernel spins at takes nearly 100% CPU if you don't. So, see:
75
76http://scie.nti.st/2009/10/4/running-openbsd-4-5-in-kvm-on-ubuntu-linux-9-04
77
78Nutshell:
79
80```
81# config -ef /bsd
82OpenBSD 4.5 (GENERIC) #2052: Sat Feb 28 14:55:24 MST 2009
83 deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
84Enter 'help' for information
85ukc> disable mpbios
86 54 mpbios0 disabled
87ukc> quit
88Saving modified kernel.
89#
Dave Day682cb022014-12-10 15:32:04 +110090```