Skip to content

Commit 97eed19

Browse files
authored
Support OpenIndiana and Solaris in the Vagrantfile
1 parent 7060883 commit 97eed19

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Vagrantfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#
1414
# Copyright 2016 Adam Stevko. All rights reserved.
1515
# Copyright 2017 Michal Nowak
16+
# Copyright 2021 David Stes
1617
#
1718

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

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

5663
# Give VM 1/4 system memory as well as CPU core count
@@ -60,6 +67,7 @@ Vagrant.configure("2") do |config|
6067
config.vm.provider "virtualbox" do |v|
6168
v.customize ["modifyvm", :id, "--memory", mem]
6269
v.customize ["modifyvm", :id, "--cpus", cpus]
70+
6371
v.customize ["storagectl", :id, "--name", "SATA Controller", "--hostiocache", "on"]
6472
# Enable following line, if oi-userland directory is on non-rotational
6573
# drive (e.g. SSD). (This could be automated, but with all those storage

0 commit comments

Comments
 (0)