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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5472297e42bb8639ae2b3836c413ad3c17d829e
4
- data.tar.gz: 45862365431afda4324062325adde12e34195736
3
+ metadata.gz: 4ee4d67b450ca74ecfba384c6402b6f2b74ff719
4
+ data.tar.gz: a84c7f8b3b00d42e6d344f1412af7002cbde2ddd
5
5
  SHA512:
6
- metadata.gz: 6962181df97dead1de07465530ef7cb912690aa8dbd75e1eac7f439e8fb00a8b94665eec0a77e333db735e86b177166e5afadb63d34a36dec77e502278aae299
7
- data.tar.gz: 6e905fd6a12e150821afb8eb80bc277b6f0e48cb6c2a121036919e1acf0c7aaabfe18f311b8ed8ae6265c73ad9c01af3d4d9c4307f674fc92b639ee7d7cb5821
6
+ metadata.gz: 9a31753aa8348fafbc0db1f49be3278e4f140a2eadf308ed31cae39ee9519714454db24e6771a06bc6c86e1ceaa44de22122b9f8930fb7b5484170e223cc2e71
7
+ data.tar.gz: 85ee7aabb5f3a9fa4cf6fd483a621da83c354be8486b67fe5b2c9b443e28d9d9612bac1672e41fa2d4144a7e9f50fbafabbaaa364f0cebff841a72ae386e965f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- macinbox (1.2.1)
4
+ macinbox (2.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # macinbox
2
2
 
3
- Puts macOS High Sierra in a Vagrant box.
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.13 High Sierra host operating system
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.13.5 High Sierra installer application](http://appstore.com/mac/macoshighsierra)
24
- * [Vagrant 2.1.1](https://www.vagrantup.com/)
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.2](http://www.vmware.com/products/fusion.html)
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.0](https://www.parallels.com/products/desktop/)
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: HFS+J)
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
- @install_info_plist = "#{@installer_app}/Contents/SharedSupport/InstallInfo.plist"
70
- raise Macinbox::Error.new("InstallInfo.plist not found in installer app bundle") unless File.exist? @install_info_plist
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'} #{@install_info_plist} ]
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
- cmd = %W[ installer -verboseR -dumplog -pkg #{@install_info_plist} -target #{@scratch_mountpoint} ]
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
@@ -10,11 +10,11 @@ module Macinbox
10
10
  :box_format => "vmware_fusion",
11
11
  :box_name => "macinbox",
12
12
  :disk_size => 64,
13
- :fstype => "HFS+J",
13
+ :fstype => "APFS",
14
14
  :memory_size => 2048,
15
15
  :cpu_count => 2,
16
16
  :short_name => "vagrant",
17
- :installer_path => "/Applications/Install macOS High Sierra.app",
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: HFS+J)') { |v| @options[:fstype] = v }
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 }
@@ -1,3 +1,3 @@
1
1
  module Macinbox
2
- VERSION = "1.2.1"
2
+ VERSION = "2.0.0"
3
3
  end
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: 1.2.1
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-05 00:00:00.000000000 Z
11
+ date: 2018-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler