@@ -38,80 +38,5 @@ echo 'servo ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/servo
38
38
find /Users/servo/Library/Saved\ Application\ State/com.apple.Terminal.savedState -depth +0 -delete || mkdir /Users/servo/Library/Saved\ Application\ State/com.apple.Terminal.savedState
39
39
chflags uchg /Users/servo/Library/Saved\ Application\ State/com.apple.Terminal.savedState
40
40
41
- # Install Xcode CLT (Command Line Tools) non-interactively
42
- # <https://github.com/actions/runner-images/blob/3d5f09a90fd475a3531b0ef57325aa7e27b24595/images/macos/scripts/build/install-xcode-clt.sh>
43
- if ! xcode-select -p; then (
44
- mkdir -p xcode
45
- cd xcode
46
- mkdir -p utils
47
- touch utils/utils.sh
48
- curl -LO https://raw.githubusercontent.com/actions/runner-images/3d5f09a90fd475a3531b0ef57325aa7e27b24595/images/macos/scripts/build/install-xcode-clt.sh
49
- chmod +x install-xcode-clt.sh
50
- ./install-xcode-clt.sh
51
- ); fi
52
-
53
- # Install Homebrew
54
- if ! [ -e /usr/local/bin/brew ]; then (
55
- mkdir -p homebrew
56
- cd homebrew
57
- sudo -iu servo curl -LO https://raw.githubusercontent.com/Homebrew/install/9a01f1f361cc66159c31624df04b6772d26b7f98/install.sh
58
- sudo -iu servo chmod +x install.sh
59
- sudo -iu servo NONINTERACTIVE=1 ./install.sh
60
- ); fi
61
-
62
- # Compile and install ntfs-3g
63
- if ! [ -e /usr/local/sbin/mkntfs ]; then (
64
- mkdir -p ntfs
65
- cd ntfs
66
-
67
- # <https://github.com/tuxera/ntfs-3g/issues/130>
68
- sudo -iu servo brew install autoconf automake m4 libtool pkg-config libgcrypt macfuse
69
-
70
- curl -LO https://github.com/tuxera/ntfs-3g/archive/refs/tags/2022.10.3.tar.gz
71
- rm -Rf ntfs-3g-2022.10.3
72
- tar xf 2022.10.3.tar.gz
73
- cd ntfs-3g-2022.10.3
74
- # error: required file './ltmain.sh' not found
75
- autoreconf -fi || autoreconf -fi
76
- # <https://github.com/tuxera/ntfs-3g/issues/5>
77
- # <https://gist.github.com/six519/9f04837f119103d4ff45542a5b5d4222>
78
- LDFLAGS=" -L/usr/local/lib -lintl" ./configure --exec-prefix=/usr/local
79
- make -j
80
- make install
81
- ); fi
82
-
83
- # Convert /Volumes/a from exFAT to NTFS
84
- # First disable Spotlight so we can unmount (per `lsof +f -- /Volumes/a`)
85
- # <https://apple.stackexchange.com/a/444826>
86
- mdutil -d /Volumes/a || :
87
- # Check if mounted, but not by checking for existence of the mount point
88
- if mount | grep -q ' on /Volumes/a ' ; then
89
- umount /Volumes/a
90
- fi
91
- /usr/local/sbin/mkntfs --quick --label a /dev/disk2s2
92
-
93
- # Write out a boot script that mounts /Volumes/a and runs /Volumes/a/init.sh
94
- cat > /Users/servo/boot.sh << 'END '
95
- #!/usr/bin/env zsh
96
- set -eu
97
- # Unmount the volume first, in case it was mounted with the built-in read-only NTFS driver
98
- if mount | grep -q ' on /Volumes/a '; then
99
- sudo umount /Volumes/a
100
- fi
101
- sudo mkdir -p /Volumes/a
102
- # Mount the volume as servo:staff to avoid permission errors
103
- sudo ntfs-3g -o uid=501,gid=20 /dev/disk2s2 /Volumes/a
104
- if [ -e /Volumes/a/init/init.sh ]; then
105
- /Volumes/a/init/init.sh
106
- else
107
- echo /Volumes/a/init/init.sh does not exist
108
- fi
109
- END
110
- chmod +x /Users/servo/boot.sh
111
-
112
- # <https://github.com/actions/runner-images/issues/4731>
113
- kextload /Library/Filesystems/macfuse.fs/Contents/Extensions/$macos_version /macfuse.kext || :
114
-
115
- echo
116
- echo
117
- echo ' See the README for next steps'
41
+ # Shut down the clean image guest
42
+ shutdown -h now
0 commit comments