aboutsummaryrefslogtreecommitdiff
path: root/scripts/entitlement.sh
diff options
context:
space:
mode:
authorAlexander Graf <agraf@csgraf.de>2021-01-20 23:44:34 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-01-29 10:47:28 +0000
commit8a74ce618b647e71ac703b5fe5dba3a2329a4d76 (patch)
treef5621e6c1032730f28748dbe7bd6b7e652e4ca57 /scripts/entitlement.sh
parent32063086a731aaeb76e1a81623953f8a17fcdb6f (diff)
hvf: Add hypervisor entitlement to output binaries
In macOS 11, QEMU only gets access to Hypervisor.framework if it has the respective entitlement. Add an entitlement template and automatically self sign and apply the entitlement in the build. Signed-off-by: Alexander Graf <agraf@csgraf.de> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Tested-by: Roman Bolshakov <r.bolshakov@yadro.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/entitlement.sh')
-rwxr-xr-xscripts/entitlement.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh
new file mode 100755
index 0000000000..c540fa6435
--- /dev/null
+++ b/scripts/entitlement.sh
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+#
+# Helper script for the build process to apply entitlements
+
+SRC="$1"
+DST="$2"
+ENTITLEMENT="$3"
+
+trap 'rm "$DST.tmp"' exit
+cp -af "$SRC" "$DST.tmp"
+codesign --entitlements "$ENTITLEMENT" --force -s - "$DST.tmp"
+mv "$DST.tmp" "$DST"
+trap '' exit