Skip to content

Commit

Permalink
Support OpenIndiana and Solaris in the Vagrantfile
Browse files Browse the repository at this point in the history
  • Loading branch information
cstes authored Sep 16, 2021
1 parent 7060883 commit 97eed19
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#
# Copyright 2016 Adam Stevko. All rights reserved.
# Copyright 2017 Michal Nowak
# Copyright 2021 David Stes
#

Vagrant.configure("2") do |config|
Expand All @@ -39,7 +40,10 @@ Vagrant.configure("2") do |config|
host = RbConfig::CONFIG['host_os']

# Get memory size and CPU cores amount
if host =~ /darwin/
if host =~ /solaris/
mem = `/usr/sbin/prtconf|grep Memory|cut -f3 -d' '`.to_i * 1024 * 1024
cpus = `/usr/sbin/psrinfo|wc -l`.to_i
elsif host =~ /darwin/
# sysctl returns Bytes
mem = `sysctl -n hw.memsize`.to_i
cpus = `sysctl -n hw.ncpu`.to_i
Expand All @@ -51,6 +55,9 @@ Vagrant.configure("2") do |config|
# Windows code via https://github.com/rdsubhas/vagrant-faster
mem = `wmic computersystem Get TotalPhysicalMemory`.split[1].to_i
cpus = `echo %NUMBER_OF_PROCESSORS%`.to_i
else
puts "Unsupported operating system"
exit
end

# Give VM 1/4 system memory as well as CPU core count
Expand All @@ -60,6 +67,7 @@ Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", mem]
v.customize ["modifyvm", :id, "--cpus", cpus]

v.customize ["storagectl", :id, "--name", "SATA Controller", "--hostiocache", "on"]
# Enable following line, if oi-userland directory is on non-rotational
# drive (e.g. SSD). (This could be automated, but with all those storage
Expand Down

0 comments on commit 97eed19

Please sign in to comment.