Skip to content

Commit

Permalink
Add Solaris 11.3.
Browse files Browse the repository at this point in the history
Add solaris113.sh provisioning script and recipe/Solaris113.txt with
detailed instructions how to build the .box (cannot upload it due to
licensing reasons, and existing boxes are not worth the hassles -
with the Oracle-provided .ova building a new .box takes 30 minutes)

Signed-off-by: Gert Doering <gert@greenie.muc.de>
  • Loading branch information
cron2 authored and mattock committed Nov 13, 2017
1 parent 4f6b5bc commit ab4b80d
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Vagrantfile
Expand Up @@ -53,8 +53,9 @@ Vagrant.configure("2") do |config|
end

config.vm.define "solaris-113" do |box|
box.vm.box = "plaurin/solaris-11_3"
box.vm.box_version = "1"
# we use a local box for licensing reasons, see recipes/Solaris113.txt
box.vm.box = "solaris113-v1.box"
#box.vm.box_version = "1"
box.vm.hostname = "solaris113.local"
box.vm.network "private_network", ip: "192.168.48.105"
box.vm.provision "shell", path: "solaris-113.sh"
Expand Down
83 changes: 83 additions & 0 deletions recipes/Solaris113.txt
@@ -0,0 +1,83 @@
Build a (non-shared) Vagrant Box for Solaris 11.3
-----------------------------------------------

- download the "Oracle Solaris 11.3 VM Template for Oracle VM VirtualBox"
from

http://www.oracle.com/technetwork/server-storage/solaris11/downloads/vm-templates-2245495.html
(free license, but only for "developing and testing your software")

-> sol-11_3-vbox.ova, about 1.8 Gbytes

- import the ova into VirtualBox

- work the installation menu (hostname, interface, timezone, language, ...)
- root password (vagrant)
- "create a user account" (vagrant/vagrant1)
["must contain one special character"]

- machine will work a while, reboot, then come up with a gui login

- vagrant has sudo rights, but no "no password" ->

sudo bash
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >>sudoers

- install the "known insecure" key for vagrant

$ cd
$ mkdir .ssh
$ wget --no-check-certificate -O .ssh/authorized_keys \
https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub

- no packages yet (nothing, no cc, auto*, git)

$ sudo pkg install gcc autoconf automake libtool git

non-existing: lzo2 lz4 mbedtls fping

- get 3rd party packages:

https://www.opencsw.org/package/fping/
https://www.opencsw.org/packages/CSWliblzo-dev [??]

$ sudo pkgadd -d http://get.opencsw.org/now
$ sudo /opt/csw/bin/pkgutil -U
$ sudo /opt/csw/bin/pkgutil -y -i liblzo_dev fping

(/opt/csw/include/lzo, /opt/csw/lib/liblzo2*)

- base system updates

$ sudo pkg install entire

(do not ask...)


- still missing at this point:
- lz4 (use bundled)
- mbedtls (compile on demand)
- tun/tap driver!

- shutdown -> pass to vagrant

sudo init 0


- export as vagrant box

vagrant package --base sol-11_3-vbox --output solaris113-v1.box
(15+ minutes, the vdisk needs about 2.3Gbyte of space)

-rw-r--r-- 1 gert users 2236915305 Nov 12 16:45 solaris113-v1.box

- possibly clean up $HOME/.vagrant.d/tmp/vagrant-package-<time>-<rnd>
afterwards, as vagrat is a bit sloppy about this... and leaves 2+G
behind here...


- if you need to redo this, and have run "vagrant up solaris-113"
in the mean time, clear the cached copy of the last vagrant run from
$HOME/.vagrant.d/boxes/<name_in_Vagrantfile>
(otherwise it will just ignore your new .box file)

44 changes: 44 additions & 0 deletions solaris-113.sh
@@ -0,0 +1,44 @@
#!/bin/sh

#!/bin/sh

echo "Preparing OpenVPN build environment"

# make sure tap driver is loaded (tun automatically is)
# (3rd party package)
echo "Checking for tun/tap driver..."

if [ -f /usr/kernel/drv/amd64/tun -a -f /usr/kernel/drv/amd64/tap ]
then
echo " ... tun/tap driver already there, good"
else
echo " ... fetching/building/installing tun/tap driver..."
cd /tmp
wget -O kaizawa-tuntap.tar.gz https://github.com/kaizawa/tuntap/tarball/master
tar xvfz kaizawa-tuntap.tar.gz
if [ -d kaizawa-tuntap-* ] ; then
cd kaizawa-tuntap-*
./configure && make && sudo make install
else
echo "ERROR: tun driver retrieval/extraction failed?"
ls -lrt
exit 1
fi
fi


# CSW package puts lzo into /opt/csw/{include,lib} where our configure
# will not find it -> make symlinks
echo "creating lzo2 convenience symlinks..."
cd /usr/include && ln -s /opt/csw/include/lzo .
cd /usr/lib && ln -s /opt/csw/lib/liblzo2.* .

# we have no mbedtls yet, so if you want, add mbedtls fetch/build
# instructions here...
#
# same thing for mbedtls...
#echo "creating mbedTLS convenience symlinks..."
#cd /usr/include && ln -s ../local/include/mbedtls .
#cd /usr/lib && ln -s ../local/lib/libmbed* .

exit 0

0 comments on commit ab4b80d

Please sign in to comment.