Skip to content

Commit 29a15fa

Browse files
heschigopherbot
authored andcommitted
env/darwin/macstadium: rewrite setup notes
Generally clean up the notes: - Restructure them so there's less bouncing around between preferences and Terminal and stuff - include the stage0 script for non-VMs - Remove obsolete Xcode instructions - Convert to Markdown For golang/go#49149. Change-Id: I893ef85924fca552c8d179146f9db6b1b9b4912f Reviewed-on: https://go-review.googlesource.com/c/build/+/402737 Reviewed-by: Dmitri Shuralyov <[email protected]> Run-TryBot: Heschi Kreinick <[email protected]> Auto-Submit: Heschi Kreinick <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 6219a16 commit 29a15fa

File tree

4 files changed

+96
-68
lines changed

4 files changed

+96
-68
lines changed

env/darwin/macstadium/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ When a new version of macOS is released:
6767
* Clone the latest macOS version on vSphere and upgrade that version
6868
to the desired macOS version as per the [instructions](vmware-notes.md).
6969

70-
* If a completely new image is required, follow the [images setup notes](image-setup-notes.txt)
70+
* If a completely new image is required, follow the [images setup notes](../setup-notes.md)
7171
in order to add a new image.
7272

7373
## Debugging

env/darwin/macstadium/image-setup-notes.txt

Lines changed: 0 additions & 66 deletions
This file was deleted.

env/darwin/macstadium/vmware-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
* Create a new virtual machine stored in GGLGTM*, with the most recent
22
supported version of macOS as the guest OS. Configure it with 2 CPUs,
33
4 GB RAM, 60+ GiB of disk, and mount the installer ISO from ISO/OSX.
4-
* Setup OS X following image-setup-notes.txt.
4+
* Setup OS X following setup-notes.md.
55
* Shut it down.
66
* Clone to Virtual Machine (convention: "osx_amd64_11_0_frozen" for macOS
77
11.0")

env/darwin/setup-notes.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# For VMs only #
2+
3+
The Disk should be formatted with a case insensitive file system (default).
4+
5+
Install VMWare tools daemon.
6+
7+
- The UI is supposed to be able to do this automatically, but it's broken as of writing.
8+
- Instead, mount darwin.iso from ISO/VMWARE TOOLS and run the installer from there.
9+
- open security preferences and click "Allow" on blocked software install from VMware
10+
- reboot
11+
- make sure you can run and see:
12+
13+
$ /Library/Application Support/VMware Tools/vmware-tools-daemon --cmd "info-get guestinfo.name"
14+
No value found
15+
16+
# For all machine types
17+
18+
- Turn on the computer.
19+
- Click through setup, connect to wifi, etc.
20+
- Full name: Gopher Gopherson
21+
- Account name: gopher
22+
- Password: with an exclamation mark
23+
- Decline as much as possible.
24+
- Set time zone to NY.
25+
- Open a terminal.
26+
- `sudo visudo`
27+
28+
Change `%admin ALL=(ALL) ALL` to `%admin ALL=(ALL) NOPASSWD: ALL`.
29+
30+
- `sudo nvram boot-args="-v"`
31+
32+
- Install Go: download the latest tarball from go.dev/dl.
33+
34+
`tar -xf Downloads/go*.darwin-*.tar`
35+
36+
`mv go $HOME/goboot`
37+
38+
Create `$HOME/stage0.sh`.
39+
40+
**For VMs**
41+
```
42+
#!/bin/bash
43+
while true; do (curl -v http://172.17.20.2:8713/stage0/$(sw_vers -productVersion) | sh); sleep 5; done
44+
```
45+
**For physical machines**
46+
```
47+
#!/bin/bash
48+
49+
set -x
50+
51+
mkdir -p ~/go/bin;
52+
while true; do
53+
url="https://storage.googleapis.com/go-builder-data/buildlet.darwin-arm64"
54+
while ! curl -f -o ~/go/bin/buildlet "$url"; do
55+
echo
56+
echo "curl failed to fetch $url"
57+
echo "Sleeping before retrying..."
58+
sleep 2
59+
done
60+
chmod +x ~/go/bin/buildlet
61+
62+
mkdir -p /tmp/buildlet
63+
~/go/bin/buildlet --coordinator=farmer.golang.org --reverse-type host-darwin-arm64-XX_0 --halt=false --workdir=/tmp/buildlet;
64+
sleep 2;
65+
done
66+
```
67+
68+
`chmod +x $HOME/stage0.sh`
69+
70+
- Run Automator.
71+
- Create a new Application.
72+
- Add a "run shell script" item with the command:
73+
`open -a Terminal.app $HOME/stage0.sh`
74+
- Save it to the desktop as "run-builder".
75+
76+
In System Preferences:
77+
- Software Update > Advanced > disable checking for updates
78+
- Desktop & Screensaver > uncheck show screensaver
79+
- Energy Saver > never turn off display, don't automatically sleep, start up after power failure
80+
- Sharing > enable ssh (leave the default administrators setting)
81+
- Users & Groups > Gopher Gopherson > Login Items > add run-builder
82+
- Users & Groups > Login Options > auto-login Gopher Gopherson
83+
84+
Install XCode:
85+
- Download Xcode from the Apple Developer site:
86+
https://stackoverflow.com/questions/10335747/how-to-download-xcode-dmg-or-xip-file.
87+
https://developer.apple.com/support/xcode/ is a more authoritative list of versions.
88+
(You don't want to log in to your account on the machine, so don't use the App Store.)
89+
- Extract it and move the resulting Xcode folder to Applications
90+
- run xcode-select: `sudo xcode-select --switch /Applications/Xcode.app`
91+
- run `xcodebuild -version` and wait for Xcode to be verified, which will take a long time.
92+
- accept the license: `sudo xcodebuild -license accept`
93+
94+
Put a builder key in the usual spot.

0 commit comments

Comments
 (0)