30 Commits

Author SHA1 Message Date
66c51bdb3e updates for catalina 2019-11-26 20:28:59 -08:00
1fb64cffc2 change mode on agent file 2019-11-26 19:56:02 -08:00
17949f32a7 update pmset command for destroying fv key 2019-10-31 06:13:02 -07:00
058311bc83 add wasabi wallet 2019-09-18 15:40:48 -07:00
2308c0ebcb add openscad to cask apps 2019-04-04 13:03:57 -07:00
8cb94dfacd add p7zip to homebrew packages 2019-04-03 08:19:42 -07:00
984d7158d6 add bwm-ng 2019-03-28 19:48:26 -07:00
17e00b978c add trash to homebrew, alias rm=trash in interactive shells 2019-03-27 21:33:47 -07:00
5d722e5f75 add httrack, handbrake, ableton-live-suite 2019-03-21 17:36:28 -07:00
2d81b3798c add vcv-rack to caskroom apps 2019-03-10 08:05:54 -07:00
22c0a7e208 updates 2018-11-05 06:05:52 -08:00
72dd27c3e4 update git-prompt theme, disable remote fetching 2018-10-25 06:28:39 -07:00
e6705c0da7 add neovim, add powerline fonts, cleanup package list formatting 2018-10-25 05:11:40 -07:00
97e2c31a47 fix slow bash startup from overuse of brew --prefix 2018-10-25 05:09:48 -07:00
dfd824a443 add homebrew paths in front of system paths 2018-10-25 04:37:39 -07:00
a709912a1b add par2 2018-09-27 12:37:45 -07:00
cf5b279efe remove ghc from packages 2018-09-25 16:47:26 -07:00
786c598a6c add syncthing-app to caskroom apps 2018-09-19 15:20:58 -07:00
69b1d41e81 Add files via upload 2018-09-19 10:20:49 -07:00
ddb96e5091 sort pkgs 2018-09-14 03:06:34 -07:00
124f456302 add asciinema 2018-09-14 03:03:54 -07:00
Jeffrey Paul
e973689f4b Update 100.install-caskroom-apps.sh 2018-09-11 06:19:54 -07:00
Jeffrey Paul
74bd49c9aa Update 100.install-caskroom-apps.sh 2018-09-11 06:10:54 -07:00
Jeffrey Paul
6329af09b3 add some yarn installed packages, add now 2018-09-11 02:09:53 -07:00
Jeffrey Paul
69062c4d6a add rust 2018-09-11 02:05:14 -07:00
Jeffrey Paul
1b027c125e Update 100.install-python-packages.sh 2018-09-11 02:04:39 -07:00
Jeffrey Paul
5a37aebdf4 Update 100.install-homebrew-apps.sh 2018-09-11 02:02:39 -07:00
Jeffrey Paul
c6f0d40867 Update 100.install-homebrew-apps.sh 2018-09-11 02:01:12 -07:00
Jeffrey Paul
df9e1a4430 Create 200.google-cloud-sdk.sh 2018-09-11 02:00:27 -07:00
Jeffrey Paul
32f0f414db add google-cloud-sdk 2018-09-11 01:59:07 -07:00
13 changed files with 180 additions and 227 deletions

152
README.md
View File

@@ -1,151 +1,15 @@
# osximage
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.
New deal for Catalina: Imaging is dead. Install a fresh install
manually, then do the following.
# HOWTO: Creating the NBI
# Manual Steps
## Prerequisites
Open System Preferences.
Per AutoDMG, you have to be on the same OS as you're building. To build a 10.12 image, the build system must be running Sierra.
* Sharing > Set Hostname
* Install the following to /Applications:
* `Xcode.app`
* pkg offline non-app-store version available [here](https://developer.apple.com/download/more/)] (requires appleId but does not developer membership)
* `Install macOS Sierra.app`
* [free download via App Store](https://itunes.apple.com/us/app/macos-sierra/id1127487414)
* `AutoDMG.app`
* [GitHub Download](https://github.com/MagerValp/AutoDMG/releases)
Open a terminal and run the following:
* create `~/Documents/packages.10.12`
* 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)
## My `packages.10.12`
https://ipfs.io/ipfs/QmTvcpFitKXsNTLdVRWk6PHvFWUfddZH47umm1xZvJApts/packages.10.12
```
48516a7b6e5286cc44ab30ff3c5aa171e0888519 200.BrotherPrinterDrivers.pkg
ebf0abac1483fd6de9262e92b047dcc80ceabeab 200.CanonPrinterDrivers.pkg
b8442185bfa0e182b84a7f6f5f298deb04d81a74 200.EPSONPrinterDrivers.pkg
2cd5d3bfc434226125d068bb09e90cbb2157a7ba 200.FujiXeroxPrinterDrivers.pkg
f44f5769579f3be7a771f54690de221e04f496cf 200.HewlettPackardPrinterDrivers.pkg
9c303c08e76aaef2fc9d1599aeea9ff15e8bce2b 200.InfoPrintPrinterDrivers.pkg
c45d3616f5995846313b9afc159ca6793b00ed08 200.LanierPrinterDrivers.pkg
9bcdb8492b00b0d7079dde23e1db4ac8da4fe0c0 200.LexmarkPrinterDrivers.pkg
c6218afb33b68fe6fab803d5b327e4f628857039 200.RicohPrinterDrivers.pkg
1ef9a998e680df23ca0cf8ba1426ed7673a2c37a 200.SamsungPrinterDrivers.pkg
df267df6198781d3fae736112a66a4a150c46b67 200.SavinPrinterDrivers.pkg
59b0306fe33693a73dc709641262f0ed2d63285a 200.XeroxPrinterDrivers.pkg
b77920f32f36f3229611ea0e10c01f2dad157ceb 20161003.EnhancedDictation.pkg
```
## Build Image
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, 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.
e.g. USB disk named "Untitled":
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia \
--volume /Volumes/Untitled \
--applicationpath "/Applications/Install macOS High Sierra.app"
## Copy image to USB
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.** ⚠️⚠️
`diskutil partitionDisk /dev/disk0 1 GPT jhfs+ root R`
### Write OS NBI to disk0
`asr restore --source file:///Volumes/Image\ Volume/nbi.dmg --target /Volumes/root --erase`
# HOWTO: Using the Custom Image
## 1/5 Initial Password
* The password for the `admin` user is `admin`. Log in as admin.
## 2/5 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/5 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/5 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.
## 5/5 Finally, Systemwide Security Software
* Little Snitch
* Little Flocker
## 6/5 Optional Manual Configs
* Enable pretty native OS notifications for Chrome: `chrome://flags/#enable-native-notifications`
* Re-enable Location Services
# 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/)
* `sudo xcodebuild -license accept`
* `bash <(curl -s https://github.com/sneak/osximage/FIXME)`

View File

@@ -1,2 +1,2 @@
export PATH+=":$HOME/Library/Homebrew/bin"
export PATH+=":$HOME/Library/Homebrew/sbin"
export PATH="$HOME/Library/Homebrew/sbin:$PATH"
export PATH="$HOME/Library/Homebrew/bin:$PATH"

View File

@@ -1,5 +1,8 @@
if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
GIT_PROMPT_THEME=Default
BGPPREFIX="$HOME/Library/Homebrew/opt/bash-git-prompt"
if [ -f "$BGPPREFIX/share/gitprompt.sh" ]; then
GIT_PROMPT_THEME=Plague_Doctor
GIT_PROMPT_ONLY_IN_REPO=1
source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh"
GIT_PROMPT_FETCH_REMOTE_STATUS=0
source "$BGPPREFIX/share/gitprompt.sh"
fi

View File

@@ -0,0 +1,4 @@
if [[ -e "$HOME/Library/Homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk" ]]; then
source "$HOME/Library/Homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc"
source "$HOME/Library/Homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc"
fi

View File

@@ -0,0 +1 @@
alias ls="ls -G"

View File

View File

@@ -1,6 +1,5 @@
#!/bin/bash
# set up paths and whatnot
source $HOME/.profile
@@ -12,25 +11,64 @@ fi
# install caskroom
brew tap caskroom/cask
# no google-drive-file-stream because it requires admin privs and installs to /Applications systemwide
CASKS="
atom
deluge
disk-inventory-x
google-chrome
iterm2
keepassx
keybase
lastpass
little-snitch
sketch
slack
spotify
sublime-text
torbrowser
vlc
xscreensaver
1password
1password-cli
ableton-live-suite
anki
atom
dashlane
deluge
disk-inventory-x
expandrive
google-chrome
google-cloud-sdk
handbrake
iterm2
keepassx
keybase
lastpass
little-snitch
minikube
openscad
sketch
slack
spotify
sublime-text
syncthing-app
tor-browser
vcv-rack
vlc
wasabi-wallet
xscreensaver
"
for CASK in $CASKS ; do
brew cask install $CASK
done
brew tap caskroom/fonts
FONTS="
font-anonymice-powerline
font-consolas-for-powerline
font-dejavu-sans-mono-for-powerline
font-droid-sans-mono-for-powerline
font-fira-mono-for-powerline
font-inconsolata-dz-for-powerline
font-inconsolata-for-powerline
font-inconsolata-g-for-powerline
font-liberation-mono-for-powerline
font-menlo-for-powerline
font-meslo-for-powerline
font-monofur-for-powerline
font-noto-mono-for-powerline
font-roboto-mono-for-powerline
font-source-code-pro-for-powerline
font-ubuntu-mono-derivative-powerline
"
for FONT in $FONTS ; do
brew cask install $FONT
done

View File

@@ -4,67 +4,75 @@
source $HOME/.profile
HOMEBREW_PKGS="
autoconf
automake
bash-completion
bash-git-prompt
bonnie++
byobu
cmake
coreutils
curl
daemontools
docker
docker-compose
docker-machine
duplicity
ffmpeg
fish
flac
geoip
ghc
gist
git
gnupg
gnupg2
go
gpg-agent
graphviz
httpie
homebrew/dupes/rsync
irssi
jq
lame
mobile-shell
mtr
mutt
nmap
node
pbzip2
pgpdump
pinentry-mac
protobuf
pv
pwgen
python3
socat
sox
speedtest_cli
syncthing
tcptraceroute
terraform
tor
torsocks
unrar
unzip
vimpager
watch
wget
whatmask
asciinema
autoconf
automake
bash-completion
bash-git-prompt
bonnie++
bwm-ng
byobu
cmake
corelocationcli
coreutils
curl
daemontools
docker
docker-compose
docker-machine
duplicity
ffmpeg
fish
flac
geoip
gist
git
gnupg
gnupg2
go
gpg-agent
graphviz
heroku
homebrew/dupes/rsync
httpie
httrack
irssi
jq
kubernetes-cli
lame
mosh
mtr
mutt
neovim
nmap
node
offlineimap
p7zip
par2
pbzip2
pgpdump
pinentry-mac
postgres
protobuf
pv
pwgen
python3
rust
socat
sox
speedtest_cli
syncthing
tcptraceroute
terraform
tor
torsocks
trash
unrar
unzip
vimpager
watch
wget
whatmask
"
for PKG in $HOMEBREW_PKGS ; do

View File

@@ -1,6 +1,8 @@
PYTHON_PKGS="
awscli
awsebcli
pipenv
powerline-shell
virtualenv
"

View File

@@ -13,3 +13,11 @@ for PKG in $NPM_PKGS ; do
# installed npm, i.e. in ~/Library/Homebrew, not actually systemwide
npm install -g $PKG
done
YARN_PKGS="
now
"
for PKG in $YARN_PKGS ; do
yarn global add $PKG
done

View File

@@ -6,10 +6,8 @@ sudo xcodebuild -license accept
# enable fde
sudo fdesetup enable
# disable hibernate
# SIP prevents this rm, sadly
#sudo rm -f /private/var/vm/sleepimage
sudo pmset -a hibernatemode 0
# destroy fv key on all standby events:
sudo pmset -a destroyfvkeyonstandby 1
# enable application firewall
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 1

27
install.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
function run_install {
sudo pmset -g
sudo pmset -a disablesleep 1
REPO="https://github.com/sneak/osximage.git"
DEST="$TMPDIR/osximage"
if [[ ! -d "$DEST" ]]; then
git clone "$REPO" "$DEST"
fi
rsync -avP "$DEST/custompkg/root/etc/skel/" "$HOME/"
# run modular setup scripts
for FN in $HOME/Library/user-setup/*.sh ; do
echo "new-user-setup: starting $(basename $FN)..."
bash "$FN" 2>&1 | tee -a $HOME/Library/Logs/user-setup.log
rm "$FN"
echo "new-user-setup: removed $(basename $FN)..."
done
sudo pmset -a disablesleep 0
}
run_install