Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes. #105

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Run the `prepare_iso.sh` script with two arguments: the path to an `Install OS X

For example:

`sudo prepare_iso/prepare_iso.sh -u admin -p password -i /path/to/image.jpg "/Applications/Install OS X Mountain Lion.app" out`
`sudo prepare_iso/prepare_iso.sh "/Applications/Install OS X Mountain Lion.app" out -u admin -p password -i /path/to/image.jpg`

Additionally, flags can be set to disable certain default configuration options.

Expand All @@ -76,7 +76,7 @@ The `prepare_iso.sh` script needs the `support` directory and its content. In ot

## Use with Packer

The path can now be added to your Packer template or provided as [user variables](http://www.packer.io/docs/templates/user-variables.html). The `packer` directory contains a template that can be used with the `vmware-iso` and `virtualbox-iso` builders. The checksum does not need to be added because the `iso_checksum_type` has been set to "none". The `veewee` directory contains a definition, though as mentioned above it is not currently being maintained.
The path can now be added to your Packer template or provided as [user variables](https://developer.hashicorp.com/packer/docs/templates/legacy_json_templates/user-variables). The `packer` directory contains a template that can be used with the `vmware-iso` and `virtualbox-iso` builders. The checksum needs to be added wih `iso_checksum` or set to "none". The `veewee` directory contains a definition, though as mentioned above it is not currently being maintained.

The Packer template adds some additional VM options required for OS X guests. Note that the paths given in the Packer template's `iso_url` builder key accepts file paths, both absolute and relative (to the current working directory).

Expand All @@ -85,7 +85,7 @@ Given the above output, we could run then run packer:
```sh
cd packer
packer build \
-var iso_url=../out/OSX_InstallESD_10.8.4_12E55.dmg \
-var 'iso_url=../out/OSX_InstallESD_10.8.4_12E55.dmg' \
template.json
```

Expand All @@ -96,12 +96,21 @@ If you modified the name or password of the admin account in the `prepare_iso` s
For example:

```
packer build -var 'iso_url=../out/OSX_InstallESD_10.9.5_13F34.dmg' \
-var 'username=admin' \
-var 'password=password' \
-var 'install_vagrant_keys=false' \
-var 'autologin=true' \
-var 'provisioning_delay=30' \
-only=vmware-iso \
template.json
=======
packer build \
-var iso_url=../out/OSX_InstallESD_10.8.4_12E55.dmg \
-var username=youruser \
-var password=yourpassword \
-var install_vagrant_keys=false \
template.json
-var iso_url=../out/OSX_InstallESD_10.8.4_12E55.dmg \
-var username=youruser \
-var password=yourpassword \
-var install_vagrant_keys=false \
template.json
```

### Building to a device with more space
Expand Down Expand Up @@ -138,43 +147,43 @@ By default, the packer template does not install the Chef or Puppet configuratio
To install the latest version of Chef:

```
packer build -var chef_version=latest template.json
packer build -var 'chef_version=latest' template.json
```

To install the last version of Puppet Agent:

```
packer build -var pupet_agent_version=latest template.json
packer build -var 'pupet_agent_version=latest' template.json
```

To install the last versions of the deprecated standalone Puppet, Facter and Hiera packages:

```
packer build -var puppet_version=latest facter_version=latest hiera_version=latest template.json
packer build -var 'puppet_version=latest' -var 'facter_version=latest' -var 'hiera_version=latest' template.json
```

## Xcode Command Line Tools

The Xcode CLI tools are installed by the packer template by default. To disable the installation, set the `install_xcode_cli_tools` variable to `false`:

```
packer build -var install_xcode_cli_tools=false template.json
packer build -var 'install_xcode_cli_tools=false' template.json
```

## System updates

Packer will instruct the system to download and install all available OS X updates, if you want to disable this default behaviour, use `update_system` variable:

```
packer build -var update_system=0 template.json
packer build -var 'update_system=0' template.json
```

## Provisioning delay

In some cases, it may be helpful to insert a delay into the beginning of the provisioning process. Adding a delay of about 30 seconds may help subsequent provisioning steps that install software from the internet complete successfully. By default, the delay is set to `0`, but you can change the delay by setting the `provisioning_delay` variable:

```
packer build -var provisioning_delay=30 template.json`
packer build -var 'provisioning_delay=30' template.json`
```

## VirtualBox support
Expand Down Expand Up @@ -236,8 +245,8 @@ Finally the virtualbox-ovf allows to use the previously generated exported virtu

```
packer build \
-var provisioning_delay=30 \
-var source_path=macOS_10.12.ovf \
-var 'provisioning_delay=30' \
-var 'source_path=macOS_10.12.ovf' \
template.json
```

Expand Down
8 changes: 4 additions & 4 deletions packer/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"boot_wait": "5s",
"disk_size": 40960,
"guest_os_type": "win-8",
"iso_checksum_type": "none",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_url": "{{user `iso_url`}}",
"output_directory": "{{user `output_directory`}}",
"shutdown_command": "echo '{{user `username`}}'|sudo -S shutdown -h now",
Expand All @@ -31,7 +31,7 @@
"boot_wait": "2s",
"disk_size": 40960,
"guest_os_type": "darwin12-64",
"iso_checksum_type": "none",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_url": "{{user `iso_url`}}",
"output_directory": "{{user `output_directory`}}",
"shutdown_command": "echo '{{user `username`}}'|sudo -S shutdown -h now",
Expand Down Expand Up @@ -61,7 +61,7 @@
"guest_additions_mode": "disable",
"guest_os_type": "MacOS1011_64",
"hard_drive_interface": "sata",
"iso_checksum_type": "none",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_interface": "sata",
"iso_url": "{{user `iso_url`}}",
"output_directory": "{{user `output_directory`}}",
Expand Down Expand Up @@ -172,4 +172,4 @@
"username": "vagrant",
"vagrant_box_directory": "{{env `PACKER_VAGRANT_BOX_DIR`}}"
}
}
}
4 changes: 2 additions & 2 deletions prepare_iso/support/generate_shadowhash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/php
#!/usr/bin/env php
<?php

#
Expand Down Expand Up @@ -70,4 +70,4 @@ $string = $NTLM . $sha1 . $cram_md5 . $sha1_salt . $recoverable;
echo $string;
exit(0);

?>
?>
2 changes: 2 additions & 0 deletions scripts/support/arc4random.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

'''py-arc4random

Basic python 2.7/3 implementation of OpenBSDs arc4random PRNG.
Expand Down
2 changes: 1 addition & 1 deletion scripts/support/generatehash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

import sys
import shadowhash
Expand Down
2 changes: 2 additions & 0 deletions scripts/support/pbkdf2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

# -*- coding: utf-8 -*-
"""
pbkdf2
Expand Down
2 changes: 2 additions & 0 deletions scripts/support/plistutils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

'''plist utility functions'''

from Foundation import NSPropertyListSerialization
Expand Down
2 changes: 2 additions & 0 deletions scripts/support/shadowhash.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

'''Functions for generating ShadowHashData'''

import hashlib
Expand Down