Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lima-vm
GitHub Repository: lima-vm/lima
Path: blob/master/hack/fix-qemu-signature.sh
1637 views
1
#!/bin/sh
2
3
# SPDX-FileCopyrightText: Copyright The Lima Authors
4
# SPDX-License-Identifier: Apache-2.0
5
6
# This script fixes the signature of QEMU binary with the "com.apple.security.hypervisor" entitlement.
7
#
8
# A workaround for "QEMU (homebrew) is broken on Intel: `[hostagent] Driver stopped due to error: "signal: abort trap"` ..."
9
#
10
# https://github.com/lima-vm/lima/issues/1742
11
# https://github.com/Homebrew/homebrew-core/issues/140244
12
13
set -eux
14
15
cat >entitlements.xml <<EOF
16
<?xml version="1.0" encoding="UTF-8"?>
17
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
18
<plist version="1.0">
19
<dict>
20
<key>com.apple.security.hypervisor</key>
21
<true/>
22
</dict>
23
</plist>
24
EOF
25
26
codesign --sign - --entitlements entitlements.xml --force "$(which qemu-system-"$(uname -m | sed -e s/arm64/aarch64/)")"
27
28
rm -f entitlements.xml
29
30