Skip to content

Commit 1f1c79f

Browse files
committed
macos13: back out NTFS-related changes (#30)
1 parent 7e8406f commit 1f1c79f

File tree

4 files changed

+13
-82
lines changed

4 files changed

+13
-82
lines changed

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ To prepare a server for macOS 13 guests, build a clean image:
211211
- Click the plus, type the password above, type `/System/Applications/Utilities/Terminal.app`, press **Enter** twice, press **Cmd**+**Q**
212212
- Press **Cmd**+**Space**, type `terminal`, press **Enter**
213213
- Type `curl https://ci0.servo.org/static/macos13.sh | sudo sh`, press **Enter**, type the password above, press **Enter**
214-
- When prompted: quit Terminal, click **Open System Settings**, click **Allow**, type the password above, press **Enter**, press **Cmd**+**Q**
215-
- Shut down the guest: `virsh shutdown servo-macos13.clean`
216214
- When the guest shuts down, take another snapshot: `zfs snapshot tank/base/servo-macos13.clean@automated`
217215
- Enable per-snapshot block devices for the zvol: `zfs set snapdev=visible tank/base/servo-macos13.clean`
218216

macos13/init.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,16 @@ osascript -e 'tell application "Terminal"' -e 'activate' -e 'set the bounds of t
1212
sudo pmset sleep 0
1313
sudo pmset displaysleep 0
1414

15-
# Fix brew error “The following directories are not writable by your user: /usr/local/share/man/man8”
16-
sudo chown -R servo /usr/local/share/man/man8
15+
# Install Xcode CLT (Command Line Tools) non-interactively
16+
# <https://github.com/actions/runner-images/blob/3d5f09a90fd475a3531b0ef57325aa7e27b24595/images/macos/scripts/build/install-xcode-clt.sh>
17+
sudo -i mkdir -p /var/root/utils
18+
sudo -i touch /var/root/utils/utils.sh
19+
sudo -i /Volumes/a/init/install-xcode-clt.sh
20+
21+
# Install Homebrew
22+
if ! [ -e /usr/local/bin/brew ]; then
23+
NONINTERACTIVE=1 /Volumes/a/init/install-homebrew.sh
24+
fi
1725

1826
# Install gtar(1)
1927
brew install gnu-tar

static/macos13.sh

+2-77
Original file line numberDiff line numberDiff line change
@@ -38,80 +38,5 @@ echo 'servo ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/servo
3838
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
3939
chflags uchg /Users/servo/Library/Saved\ Application\ State/com.apple.Terminal.savedState
4040

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

static/macos13/org.servo.ci.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<string>-Wa</string><!-- wait, application -->
2121
<string>/System/Applications/Utilities/Terminal.app</string>
2222
<!-- In practice, this actually runs as servo, not root -->
23-
<string>/Users/servo/boot.sh</string>
23+
<string>/Volumes/a/init/init.sh</string>
2424
</array>
2525
</dict>
2626
</plist>

0 commit comments

Comments
 (0)