Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 1 | # Go on OpenBSD |
| 2 | |
Constantine A. Murenin | 1beb25b | 2015-02-25 20:26:18 +0000 | [diff] [blame] | 3 | Go 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. Murenin | c2964ab | 2015-02-25 20:04:31 +0000 | [diff] [blame] | 4 | |
| 5 | | **OpenBSD release** | **golang in ports** | |
| 6 | |:--------------------|:--------------------| |
Dimitri Sokolyuk | 6502da8 | 2015-10-19 17:15:00 +0200 | [diff] [blame^] | 7 | | 5.8 (Oct 18, 2015) | go-1.4.2 | |
Jack Peirce | 67c8815 | 2015-05-07 20:20:37 -0600 | [diff] [blame] | 8 | | 5.7 (May 1, 2015) | go-1.4.1 | |
Constantine A. Murenin | 1beb25b | 2015-02-25 20:26:18 +0000 | [diff] [blame] | 9 | | 5.6 (Nov 1, 2014) | go-1.3p0 | |
| 10 | | 5.5 (May 1, 2014) | go-1.2p0 | |
Constantine A. Murenin | 6d38e5e | 2015-02-25 20:14:34 +0000 | [diff] [blame] | 11 | | 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. Murenin | c2964ab | 2015-02-25 20:04:31 +0000 | [diff] [blame] | 14 | |
| 15 | ## Building from source. |
| 16 | |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 17 | Required: |
| 18 | |
Mikio Hara | 7968915 | 2015-01-16 13:22:07 +0900 | [diff] [blame] | 19 | * OpenBSD amd64, 386: 5.5 and above |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 20 | * 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 Day | 682cb02 | 2014-12-10 15:32:04 +1100 | [diff] [blame] | 23 | |:-------------------|:-----------------|:----------------| |
Mikio Hara | d337b6c | 2015-05-21 10:08:49 +0900 | [diff] [blame] | 24 | | 5.7 | go1.4.1 | go1.5 | |
Mikio Hara | 9216f90 | 2015-01-15 15:08:14 +0900 | [diff] [blame] | 25 | | 5.6 | go1.4.1 | go1.5 | |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 26 | | 5.5 | go1.3 | go1.5 | |
| 27 | |
| 28 | * ulimits (` /etc/login.conf `) |
| 29 | |
| 30 | Edit the /etc/login.conf so that the staff class has the proper |
| 31 | settings. The following is a working example of the staff class: |
| 32 | ``` |
| 33 | staff:\ |
| 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 | |
| 45 | After editing the login.conf you'll need to rebuild the database with: |
| 46 | ``` |
| 47 | # cap_mkdb /etc/login.conf |
| 48 | ``` |
| 49 | |
| 50 | ``` |
| 51 | ulimit -n 512 |
| 52 | ulimit -p 512 |
| 53 | ulimit -d 2036792 |
| 54 | ``` |
| 55 | |
| 56 | Add the login class to the user you would like to have build go |
| 57 | ``` |
| 58 | # vipw |
| 59 | ``` |
| 60 | |
| 61 | Look for the 5th element which is the login class, this is blank by |
| 62 | users added by useradd. In the following example the user operator |
| 63 | would be added to the staff class |
| 64 | ``` |
| 65 | ## Before |
| 66 | operator:*:2:5::0:0:System &:/operator:/sbin/nologin |
| 67 | |
| 68 | ## After |
| 69 | operator:*:2:5:staff:0:0:System &:/operator:/sbin/nologin |
| 70 | ``` |
| 71 | |
| 72 | ## Under KVM |
| 73 | |
| 74 | If 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 | |
| 76 | http://scie.nti.st/2009/10/4/running-openbsd-4-5-in-kvm-on-ubuntu-linux-9-04 |
| 77 | |
| 78 | Nutshell: |
| 79 | |
| 80 | ``` |
| 81 | # config -ef /bsd |
| 82 | OpenBSD 4.5 (GENERIC) #2052: Sat Feb 28 14:55:24 MST 2009 |
| 83 | deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC |
| 84 | Enter 'help' for information |
| 85 | ukc> disable mpbios |
| 86 | 54 mpbios0 disabled |
| 87 | ukc> quit |
| 88 | Saving modified kernel. |
| 89 | # |
Dave Day | 682cb02 | 2014-12-10 15:32:04 +1100 | [diff] [blame] | 90 | ``` |