Skip to content
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
10 changes: 10 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- Will wait for the network to be available before installing (optional, can be disabled if desired)
- Can specify amount of seconds to retry network (optional
- Can specify whether your first boot package requires a reboot or not
- Can specify to shutdown after installation
- Can codesign package

Run with ``--help`` for the full list of options.

Expand Down Expand Up @@ -76,6 +78,14 @@ If you would like to invoke either a reboot or shutdown, set one of the values t

You can now specify a "LaunchDaemonIdentifier". This will allow you to override the default value of "com.grahamgilbert.first-boot-pkg"

## Code Signing Packages

To code sign a package, use the --sign. If you are using a plist, you will need to pass the argument when building.

```bash
sudo ./first-boot-pkg --plist /Users/grahamgilbert/Desktop/first-boot-config.plist --sign "3rd Party Mac Developer Installer: Example Company (XXXXXX1XXX)"
```

## Credits

The original inspiration for this script came from Rich Trouton's [First Boot Package Install](https://github.com/rtrouton/First-Boot-Package-Install).
Expand Down
12 changes: 12 additions & 0 deletions first-boot-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ default_noreboot = False
default_noshutdown = True
default_retry_count = 10
default_sleep_count = 10
default_sign = 'None'
now = localtime()
default_version = "%04d.%02d.%02d" % (now.tm_year, now.tm_mon, now.tm_mday)
pkgbuild = "/usr/bin/pkgbuild"
Expand Down Expand Up @@ -87,6 +88,11 @@ def main():
default=default_sleep_count,
help=("Amount of seconds to sleep when looking for network. "
"Defaults to %s. ")% default_sleep_count)

o.add_option("--sign",
default=default_sign,
help=("Sign the resulting package with the specified identity. "
"Defaults to %s. ")% default_sign)

o.add_option("--plist",
help=("Optional. Path to an XML plist file containing "
Expand Down Expand Up @@ -313,6 +319,12 @@ def main():
"--package", output_pkg,
dist_output
]

# Taken from make-profile-pkg
if opts.sign:
# Use slice assignment to insert an additional option before the final argument
cmd[-1:] = ["--sign", opts.sign, dist_output]

subprocess.call(cmd)

try:
Expand Down