xnu-qemu-arm64-git
LOW
maintainer Grakul
0 votes
scanned 2026-10-25 21:43:05.033624
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Eugene Flanagin <eflanagin@pm.me>
2
#
3
# Credits:
4
# xnu-qemu-arm64 (iOS 12.1 XNU on QEMU, iPhone 6s Plus n66): Aleph Security
5
# (Jonathan Afek and contributors),
6
# https://github.com/alephsecurity/xnu-qemu-arm64 (GPL-2.0)
7
# QEMU: the QEMU project, https://www.qemu.org
8
# Linux-host patch, launchers and packaging:
9
# https://github.com/eugenesflanagin-spec/ios-emu-linux (patch GPL-2.0-or-later, scripts MIT)
10
# No Apple firmware is included or downloaded by this package.
11
12
pkgname=xnu-qemu-arm64-git
13
_pkgname=xnu-qemu-arm64
14
pkgver=4.2.0.r73552.g2694993
15
pkgrel=1
16
pkgdesc="Aleph Security's QEMU fork that boots the iOS 12.1 XNU kernel (iPhone 6s Plus) to a root shell, with Linux-host fixes"
17
arch=('x86_64')
18
url="https://github.com/alephsecurity/xnu-qemu-arm64"
19
license=('GPL-2.0-only' 'MIT')
20
depends=('bash' 'glibc' 'glib2' 'gtk3' 'cairo' 'gdk-pixbuf2' 'libx11' 'pixman'
21
'dtc' 'zlib' 'libgcc' 'libstdc++' 'libatomic')
22
makedepends=('git' 'gcc' 'python' 'pkgconf' 'flex' 'bison')
23
optdepends=('hfsprogs: repair hfs.sec before each boot (fsck.hfsplus)'
24
'sshpass: password login for xnu-qemu-ios-ssh'
25
'openssh: SSH into the guest with xnu-qemu-ios-ssh')
26
provides=("$_pkgname")
27
conflicts=("$_pkgname")
28
options=('!lto' '!debug')
29
# Docs and the tcp-tunnel source come from this release of ios-emu-linux
30
_extras_tag=v1.0
31
source=("$_pkgname::git+https://github.com/alephsecurity/xnu-qemu-arm64.git"
32
"keycodemapdb::git+https://gitlab.com/qemu-project/keycodemapdb.git"
33
"berkeley-softfloat-3::git+https://gitlab.com/qemu-project/berkeley-softfloat-3.git"
34
"berkeley-testfloat-3::git+https://gitlab.com/qemu-project/berkeley-testfloat-3.git"
35
"ios-emu-linux::git+https://github.com/eugenesflanagin-spec/ios-emu-linux.git#tag=$_extras_tag"
36
'0001-n66-32bpp-xnu-ramfb-linux-host-guest-services.patch'
37
'xnu-qemu-ios'
38
'xnu-qemu-ios-console'
39
'xnu-qemu-ios-ssh'
40
'xnu-qemu-ios.desktop'
41
'README.Arch')
42
sha256sums=('SKIP'
43
'SKIP'
44
'SKIP'
45
'SKIP'
46
'SKIP'
47
'c17621c9c91f0d278535884020e18b27bad5b7fbce54b4c137cdfd7aba72d1d5'
48
'93fdf9b81e3e893fc017014885cd067ec38d2b26ee6e6891c8b400768d9bc143'
49
'd9ecba4bc413506306752aabe279669759a974adba6d9d2087c4405b26fa0a65'
50
'e124ad16de3d1faf921f13d5d828019ea8201c3b44c6ca207cb11543dbed5832'
51
'0b9763adc3b01dd7c026cfedcde060304368d4cbe1ef0cf761a86ad968e3ebb1'
52
'cc0d161f17480c2bbc64b81b0137aba4ec0b3a63a459e62afbc2b924703ac6f0')
53
54
pkgver() {
55
cd "$_pkgname"
56
printf "%s.r%s.g%s" "$(cat VERSION)" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
57
}
58
59
prepare() {
60
cd "$_pkgname"
61
# configure insists on these submodules when .git exists; point them at local clones
62
git submodule init ui/keycodemapdb tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3
63
git config submodule.ui/keycodemapdb.url "$srcdir/keycodemapdb"
64
git config submodule.tests/fp/berkeley-softfloat-3.url "$srcdir/berkeley-softfloat-3"
65
git config submodule.tests/fp/berkeley-testfloat-3.url "$srcdir/berkeley-testfloat-3"
66
git -c protocol.file.allow=always submodule update \
67
ui/keycodemapdb tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3
68
69
# 32bpp xnu-ramfb (correct colours) + Linux-host guest-services ABI fixes
70
# (Darwin<->Linux sockaddr/fcntl/errno translation) so Aleph's tcp-tunnel works.
71
patch -Np1 -i "$srcdir/0001-n66-32bpp-xnu-ramfb-linux-host-guest-services.patch"
72
}
73
74
build() {
75
# This 2019/2020 tree only builds cleanly with GCC (not clang/AOCC).
76
export CC=gcc CXX=g++ HOST_CC=gcc
77
# keep Homebrew/Linuxbrew libraries out of the link
78
PATH="$(printf '%s' "$PATH" | tr ':' '\n' | grep -v linuxbrew | paste -sd:)"
79
export PATH
80
# QEMU 4.2 sets its own _FORTIFY_SOURCE level
81
CFLAGS="${CFLAGS/-Wp,-D_FORTIFY_SOURCE=3/}"
82
CPPFLAGS="${CPPFLAGS/-D_FORTIFY_SOURCE=3/}"
83
LDFLAGS+=" -Wl,-z,relro,-z,now -Wl,--as-needed"
84
export CFLAGS CPPFLAGS LDFLAGS
85
86
mkdir -p build
87
cd build
88
"../$_pkgname/configure" \
89
--prefix="/opt/$_pkgname" \
90
--target-list=aarch64-softmmu \
91
--cc=gcc --cxx=g++ --host-cc=gcc \
92
--python=/usr/bin/python3 \
93
--extra-cflags="$CFLAGS" \
94
--extra-ldflags="$LDFLAGS" \
95
--enable-gtk \
96
--audio-drv-list= \
97
--disable-werror --disable-docs --disable-tools --disable-guest-agent \
98
--disable-capstone --disable-slirp --disable-pie \
99
--disable-vnc --disable-spice --disable-smartcard --disable-libusb --disable-usb-redir \
100
--disable-sdl --disable-opengl --disable-virglrenderer --disable-vte \
101
--disable-gnutls --disable-gcrypt --disable-nettle --disable-auth-pam \
102
--disable-curl --disable-libssh --disable-libnfs --disable-libiscsi \
103
--disable-glusterfs --disable-rbd --disable-xen --disable-bluez \
104
--disable-linux-aio --disable-libpmem --disable-rdma --disable-vde \
105
--disable-seccomp --disable-brlapi --disable-lzo --disable-snappy --disable-bzip2 \
106
--disable-lzfse --disable-numa --disable-libxml2 --disable-cap-ng --disable-mpath \
107
--disable-tpm --disable-vhost-user --disable-curses --disable-virtfs
108
make
109
}
110
111
package() {
112
cd build
113
make DESTDIR="$pkgdir" install
114
115
# Only the iPhone machine is needed: drop the generic QEMU helpers, menu entry/icons
116
# and the prebuilt firmware blobs for other machines (none are used by n66).
117
local _opt="$pkgdir/opt/$_pkgname"
118
find "$_opt/bin" -mindepth 1 ! -name qemu-system-aarch64 -delete
119
rm -rf "$_opt/libexec" "$_opt/include" "$_opt/share/applications" "$_opt/share/icons" "$_opt/share/qemu/firmware"
120
find "$_opt/share/qemu" -maxdepth 1 -type f ! -name trace-events-all -delete
121
122
cd "$srcdir"
123
install -Dm755 xnu-qemu-ios xnu-qemu-ios-console xnu-qemu-ios-ssh -t "$pkgdir/usr/bin/"
124
install -Dm644 xnu-qemu-ios.desktop "$pkgdir/usr/share/applications/xnu-qemu-ios.desktop"
125
126
# docs: Linux notes for the guide + the SDK-free tcp-tunnel cross-build (source only)
127
local _doc="$pkgdir/usr/share/doc/$pkgname"
128
install -Dm644 README.Arch "$_doc/README.Arch"
129
install -Dm644 ios-emu-linux/ios12-xnu-qemu/README.md "$_doc/README.md"
130
install -Dm644 "$srcdir/$_pkgname/README.md" "$_doc/README.upstream.md"
131
install -Dm644 0001-n66-32bpp-xnu-ramfb-linux-host-guest-services.patch -t "$_doc/patches/"
132
cp -r --no-preserve=ownership ios-emu-linux/ios12-xnu-qemu/tunnel-linux "$_doc/"
133
chmod -R u=rwX,go=rX "$_doc/tunnel-linux"
134
chmod 755 "$_doc/tunnel-linux/build.sh"
135
136
install -Dm644 "$srcdir/$_pkgname/COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING"
137
install -Dm644 "$srcdir/$_pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
138
install -Dm644 ios-emu-linux/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE.MIT"
139
}
140
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-25 21:43:05 | Low | 1 |