macinbox 1.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +8 -7
- data/lib/macinbox/actions/create_image_from_installer.rb +22 -10
- data/lib/macinbox/cli/options.rb +3 -3
- data/lib/macinbox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ee4d67b450ca74ecfba384c6402b6f2b74ff719
|
4
|
+
data.tar.gz: a84c7f8b3b00d42e6d344f1412af7002cbde2ddd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a31753aa8348fafbc0db1f49be3278e4f140a2eadf308ed31cae39ee9519714454db24e6771a06bc6c86e1ceaa44de22122b9f8930fb7b5484170e223cc2e71
|
7
|
+
data.tar.gz: 85ee7aabb5f3a9fa4cf6fd483a621da83c354be8486b67fe5b2c9b443e28d9d9612bac1672e41fa2d4144a7e9f50fbafabbaaa364f0cebff841a72ae386e965f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# macinbox
|
2
2
|
|
3
|
-
Puts macOS
|
3
|
+
Puts macOS Mojave in a Vagrant box.
|
4
4
|
|
5
5
|
<p align=center>
|
6
6
|
<img src="https://raw.githubusercontent.com/bacongravy/macinbox/demo/demo.gif">
|
@@ -11,7 +11,7 @@ Supports creating boxes in either the 'vmware_fusion' or 'parallels' formats.
|
|
11
11
|
|
12
12
|
## System Requirements
|
13
13
|
|
14
|
-
* macOS 10.
|
14
|
+
* macOS 10.14 Mojave host operating system
|
15
15
|
* At least 8 GB RAM (16 GB recommended)
|
16
16
|
* At least 2 cores (4 recommended)
|
17
17
|
* At least 100 GB of available disk space
|
@@ -20,17 +20,17 @@ Supports creating boxes in either the 'vmware_fusion' or 'parallels' formats.
|
|
20
20
|
|
21
21
|
The following software is required. Versions other than those mentioned may work, but these are the latest versions tested:
|
22
22
|
|
23
|
-
* [macOS 10.
|
24
|
-
* [Vagrant 2.1.
|
23
|
+
* [macOS 10.14 Mojave installer application](http://appstore.com/mac/macosmojave)
|
24
|
+
* [Vagrant 2.1.5](https://www.vagrantup.com/)
|
25
25
|
|
26
26
|
To create and boot a box in the 'vmware_fusion' format you must also have:
|
27
27
|
|
28
|
-
* [VMware Fusion Pro 10.1.
|
28
|
+
* [VMware Fusion Pro 10.1.3](http://www.vmware.com/products/fusion.html)
|
29
29
|
* [Vagrant VMware Fusion Provider 5.0.4](https://www.vagrantup.com/vmware/)
|
30
30
|
|
31
31
|
To create and boot a box in the 'parallels' format you must also have:
|
32
32
|
|
33
|
-
* [Parallels Desktop 13 for Mac Pro Edition 13.3.
|
33
|
+
* [Parallels Desktop 13 for Mac Pro Edition 13.3.2](https://www.parallels.com/products/desktop/)
|
34
34
|
* [Vagrant Parallels Provider 1.7.8](https://parallels.github.io/vagrant-parallels/)
|
35
35
|
|
36
36
|
## Installation
|
@@ -66,7 +66,7 @@ Usage: macinbox [options]
|
|
66
66
|
|
67
67
|
-n, --name NAME Name of the box (default: macinbox)
|
68
68
|
-d, --disk SIZE Size (GB) of the disk (default: 64)
|
69
|
-
-t, --fstype TYPE Type for disk format (default:
|
69
|
+
-t, --fstype TYPE Type for disk format (default: APFS)
|
70
70
|
-m, --memory SIZE Size (MB) of the memory (default: 2048)
|
71
71
|
-c, --cpu COUNT Number of virtual cores (default: 2)
|
72
72
|
-s, --short NAME Short name of the user (default: vagrant)
|
@@ -107,6 +107,7 @@ By default `macinbox` will create a Vagrant box in the 'vmware_fusion' format wi
|
|
107
107
|
|
108
108
|
This tool performs the following actions:
|
109
109
|
|
110
|
+
1. Wraps the installer app in a disk image
|
110
111
|
1. Creates a new blank disk image
|
111
112
|
1. Installs macOS
|
112
113
|
1. Installs the VMware or Parallels tools
|
@@ -41,6 +41,7 @@ module Macinbox
|
|
41
41
|
def run
|
42
42
|
create_temp_dir
|
43
43
|
check_macos_versions
|
44
|
+
create_wrapper_image
|
44
45
|
create_scratch_image
|
45
46
|
install_macos
|
46
47
|
create_rc_vagrant
|
@@ -66,10 +67,10 @@ module Macinbox
|
|
66
67
|
|
67
68
|
def check_macos_versions
|
68
69
|
Logger.info "Checking macOS versions..." do
|
69
|
-
|
70
|
-
raise Macinbox::Error.new("InstallInfo.plist not found in installer app bundle") unless File.exist?
|
70
|
+
install_info_plist = "#{@installer_app}/Contents/SharedSupport/InstallInfo.plist"
|
71
|
+
raise Macinbox::Error.new("InstallInfo.plist not found in installer app bundle") unless File.exist? install_info_plist
|
71
72
|
|
72
|
-
installer_os_version = Task.backtick %W[ /usr/libexec/PlistBuddy -c #{'Print :System\ Image\ Info:version'} #{
|
73
|
+
installer_os_version = Task.backtick %W[ /usr/libexec/PlistBuddy -c #{'Print :System\ Image\ Info:version'} #{install_info_plist} ]
|
73
74
|
installer_os_version_components = installer_os_version.split(".") rescue [0, 0, 0]
|
74
75
|
installer_os_version_major = installer_os_version_components[0]
|
75
76
|
installer_os_version_minor = installer_os_version_components[1]
|
@@ -81,16 +82,25 @@ module Macinbox
|
|
81
82
|
host_os_version_minor = host_os_version_components[1]
|
82
83
|
Logger.info "Host macOS version detected: #{host_os_version}" if @debug
|
83
84
|
|
84
|
-
if installer_os_version_major != "10" || installer_os_version_minor != "13"
|
85
|
-
raise Macinbox::Error.new("installer OS version must be 10.13, not #{installer_os_version}")
|
86
|
-
end
|
87
|
-
|
88
85
|
if installer_os_version_major != host_os_version_major || installer_os_version_minor != host_os_version_minor
|
89
86
|
raise Macinbox::Error.new("host OS version (#{host_os_version}) and installer OS version (#{installer_os_version}) do not match")
|
90
87
|
end
|
91
88
|
end
|
92
89
|
end
|
93
90
|
|
91
|
+
def create_wrapper_image
|
92
|
+
Logger.info "Creating and attaching wrapper disk image..." do
|
93
|
+
@collector.on_cleanup do
|
94
|
+
%x( hdiutil detach -quiet -force #{@wrapper_mountpoint.shellescape} > /dev/null 2>&1 ) if @wrapper_mountpoint
|
95
|
+
end
|
96
|
+
@wrapper_mountpoint = "/Volumes/#{File.basename @installer_app, ".app"}"
|
97
|
+
@wrapper_image = "#{@temp_dir}/wrapper.dmg"
|
98
|
+
quiet_flag = @debug ? [] : %W[ -quiet ]
|
99
|
+
Task.run %W[ hdiutil create -srcfolder #{@installer_app} #{@wrapper_image} ] + quiet_flag
|
100
|
+
Task.run %W[ hdiutil attach #{@wrapper_image} -nobrowse ] + quiet_flag
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
94
104
|
def create_scratch_image
|
95
105
|
Logger.info "Creating and attaching a new blank disk image..." do
|
96
106
|
@collector.on_cleanup do
|
@@ -108,7 +118,9 @@ module Macinbox
|
|
108
118
|
def install_macos
|
109
119
|
Logger.info "Installing macOS..." do
|
110
120
|
activity = Logger.prefix + "installer"
|
111
|
-
|
121
|
+
install_info_plist = "#{@wrapper_mountpoint}/#{File.basename @installer_app}/Contents/SharedSupport/InstallInfo.plist"
|
122
|
+
Task.run %W[ touch #{@scratch_mountpoint}/.macinbox ]
|
123
|
+
cmd = %W[ installer -verboseR -dumplog -pkg #{install_info_plist} -target #{@scratch_mountpoint} ]
|
112
124
|
opts = @debug ? {} : { :err => [:child, :out] }
|
113
125
|
Task.run_with_progress activity, cmd, opts do |line|
|
114
126
|
/^installer:%(.*)$/.match(line)[1].to_f rescue nil
|
@@ -121,14 +133,14 @@ module Macinbox
|
|
121
133
|
@scratch_rc_vagrant = "#{@scratch_mountpoint}/private/etc/rc.vagrant"
|
122
134
|
File.write scratch_rc_installer_cleanup, <<~EOF
|
123
135
|
#!/bin/sh
|
124
|
-
rm /etc/rc.installer_cleanup
|
136
|
+
rm -f /etc/rc.installer_cleanup
|
125
137
|
/etc/rc.vagrant &
|
126
138
|
exit 0
|
127
139
|
EOF
|
128
140
|
FileUtils.chmod 0755, scratch_rc_installer_cleanup
|
129
141
|
File.write @scratch_rc_vagrant, <<~EOF
|
130
142
|
#!/bin/sh
|
131
|
-
rm /etc/rc.vagrant
|
143
|
+
rm -f /etc/rc.vagrant
|
132
144
|
EOF
|
133
145
|
FileUtils.chmod 0755, @scratch_rc_vagrant
|
134
146
|
end
|
data/lib/macinbox/cli/options.rb
CHANGED
@@ -10,11 +10,11 @@ module Macinbox
|
|
10
10
|
:box_format => "vmware_fusion",
|
11
11
|
:box_name => "macinbox",
|
12
12
|
:disk_size => 64,
|
13
|
-
:fstype => "
|
13
|
+
:fstype => "APFS",
|
14
14
|
:memory_size => 2048,
|
15
15
|
:cpu_count => 2,
|
16
16
|
:short_name => "vagrant",
|
17
|
-
:installer_path => "/Applications/Install macOS
|
17
|
+
:installer_path => "/Applications/Install macOS Mojave.app",
|
18
18
|
:vmware_path => "/Applications/VMware Fusion.app",
|
19
19
|
:parallels_path => "/Applications/Parallels Desktop.app",
|
20
20
|
:vmware_tools => true,
|
@@ -37,7 +37,7 @@ module Macinbox
|
|
37
37
|
o.separator ''
|
38
38
|
o.on('-n', '--name NAME', 'Name of the box (default: macinbox)') { |v| @options[:box_name] = v }
|
39
39
|
o.on('-d', '--disk SIZE', 'Size (GB) of the disk (default: 64)') { |v| @options[:disk_size] = v }
|
40
|
-
o.on('-t', '--fstype TYPE', 'Type of FS on the disk (default:
|
40
|
+
o.on('-t', '--fstype TYPE', 'Type of FS on the disk (default: APFS)') { |v| @options[:fstype] = v }
|
41
41
|
o.on('-m', '--memory SIZE', 'Size (MB) of the memory (default: 2048)') { |v| @options[:memory_size] = v }
|
42
42
|
o.on('-c', '--cpu COUNT', 'Number of virtual cores (default: 2)') { |v| @options[:cpu_count] = v }
|
43
43
|
o.on('-s', '--short NAME', 'Short name of the user (default: vagrant)') { |v| @options[:short_name] = v }
|
data/lib/macinbox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macinbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Kramer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|