This is a repo for building an NBI (never-booted image) of an OS X (pron: oh ess **ten**) root partition, which can be easily and quickly (<10m) imaged onto a Mac with the `asr` utility readily available on OSX boot media.
* put in all those apple printer driver `pkg`s you can download
* the "enhanced dictation" offline speech recognition 800mb `pkg` that system preferences will download if you ask it
* run [this](https://gist.github.com/sneak/958df7165ce5b9e4dd4c89da5764a8e1) while it's downloading to find the temp file, then hardlink it to `whatever.pkg`
* any other packages you want preinstalled on the root but not:
* Virtualbox (won't work unless installed from inside the running OS for some reason)
Finally, just run `make` in the cloned repo to build the NBI. You will need to enter your sudo password up front, **but don't go get coffee yet**... AutoDMG will ask for it again about 30-60 seconds later. *Then* go and kill an hour.
The OSX Installer .app, AutoDMG, CreateUserPkg, and Xcode (for `make`) will all be included in the built image, so if you're *using* the image so built it will have everything you need to make further images later.
If you aren't installing any extra packages, edit the `Makefile` to remove the `~/packages.10.12/*.pkg` part.
It writes the image as it's building to /tmp (to leverage fast internal SSD in case your `osximage` clone is on removable media) then moves it to the repo directory in the last step.
# HOWTO: Imaging A Mac
## Before You Begin
Get all data to be saved *off* of target system. Recommended: install Google Drive and log in to your Google account and put everything to be saved in there. Wait for sync (upload) to complete.
## Create bootable USB media
* Install OS installer .app bundle to /Applications
* Insert USB3 media. 64GB or larger to store OS installer and image.
Copy the never-booted disk image (nbi) ending with `.dmg` to the root of the newly-imaged bootable USB disk, alongside the installer `.app` the `createinstallmedia` tool placed on the disk.
## Image Mac
* Insert the bootable USB drive into the machine to be imaged and boot holding the Option key on a wired keyboard. (Alt on a PC keyboard.)
* Select `Terminal` from the `Utilities` menu.
* Run the following commands:
### Repartition and Reformat disk0
⚠️⚠️ **This will delete all data on the internal disk. Proceed with caution.** ⚠️⚠️
* The password for the `admin` user is `admin`. Log in as admin.
## 2/4 Create User Accounts
The example user in this document is John P Smith, username `jps`. Replace the name and username with your own.
* Create an administrator user account for yourself.
* Username: `jpsadmin`
* Real Name: `John Smith (admin)`
* Create a second non-administrator local user account for daily job tasks.
* Username: `jps`
* Real Name: `John Smith`
* Create a third non-administrator local user account `personal` for personal use.
## 3/4 Set Up Systemwide Configuration
* Log out of `admin` and into `jpsadmin`.
* Delete the `admin` user in `System Preferences > Users & Groups`. Choose to delete the user's home folder.
* Open `System Preferences > Sharing` and set the machine hostname.
* Connect machine to network (potentially entering wifi password).
* Open a terminal and run `new-system-setup`. Enter the `jpsadmin` password when initially prompted.
* When prompted to "Enter the user name:", enter your normal username (e.g. `jps`)
* This is for FileVault (FDE) to enable the specified user from the encrypted disk.
* Wait for the script to finish, then enter `sudo reboot`.
## 4/4 Set Up User-specific Configuration
* Log in with your normal user. (e.g. `jps`)
* You may log in to your personal iCloud account/Apple ID, however, **make sure you disable iCloud Drive as soon as you log in**.
* Uncheck `Store files from Documents and Desktop in iCloud Drive` when prompted!
* Disable iCloud Drive and Mail in `System Preferences > iCloud` if you logged in to iCloud.
* Open a terminal, and run `new-user-setup`.
* This will take a while, as it will be downloading and installing a full set of apps.
* Log out, and log back in again with the same user so that changed preferences will take effect.
* Log in to Google Drive (already installed under ~/Applications) with your Google Apps account.
* Avoid installing any additional software to the machine unless strictly necessary. Prefer web applications and built-in apps.
* Do not install third-party software to `/Applications` except via the App Store.
# Credits
*`DefaultDesktop.jpg`
* rotated version of [space](http://simpledesktops.com/browse/desktops/2012/feb/19/space-2/) by [Nané](http://www.smplz.com/)
* other desktops
* a whole bunch of 5120px wide (5K Retina iMac res) images from [InterfaceLIFT](https://interfacelift.com/wallpaper/downloads/date/wide_16:9/5120x2880/)