Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions tools/aurora-sep/assemble-m3-stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
'f240960cc84cfda6f73e188050ccadb9435e938f',
'd49021440d8ca02bbc8ecc17c19ce76c048b6236',
'6f63677751854d57bcfac172314957bc2197c05f',
'5ec1028c81526e1ed31db2b97e47edf8663e83cb')
'5ec1028c81526e1ed31db2b97e47edf8663e83cb',
'c46d7dcdb8712ea9aeb0ce47b439ffae76371e55')
# J615 native25 requires exact kernel, boot source and packaged binary bindings.
J615_NATIVE25_PAIR = {
'kernel': '9189760ca2222ba57d802d65ff3a0ebb2ca985ab',
Expand Down Expand Up @@ -68,6 +69,7 @@
J615_RELEASE16_NATIVE25_PAIR = dict(J615_RELEASE15_NATIVE25_PAIR, kernel='d49021440d8ca02bbc8ecc17c19ce76c048b6236')
J615_RELEASE18_NATIVE25_PAIR = dict(J615_RELEASE15_NATIVE25_PAIR, kernel='6f63677751854d57bcfac172314957bc2197c05f')
J615_RELEASE19_NATIVE25_PAIR = dict(J615_RELEASE15_NATIVE25_PAIR, kernel='5ec1028c81526e1ed31db2b97e47edf8663e83cb')
J615_RELEASE20_NATIVE25_PAIR = dict(J615_RELEASE15_NATIVE25_PAIR, kernel='c46d7dcdb8712ea9aeb0ce47b439ffae76371e55')
# Reserved firmware DART tables require the matched Neo ESP producer.
NEO_PREVIOUS_FW_ROOT_PAIR = {
'kernel': '9b96a8f6a29ceb3f645ed75e220a71c10e7d8e1f',
Expand Down Expand Up @@ -123,6 +125,7 @@
NEO_RELEASE16_LIVE_FW_ROOT_PAIR = dict(NEO_RELEASE15_LIVE_FW_ROOT_PAIR, kernel='d49021440d8ca02bbc8ecc17c19ce76c048b6236')
NEO_RELEASE18_LIVE_FW_ROOT_PAIR = dict(NEO_RELEASE15_LIVE_FW_ROOT_PAIR, kernel='6f63677751854d57bcfac172314957bc2197c05f')
NEO_RELEASE19_LIVE_FW_ROOT_PAIR = dict(NEO_RELEASE15_LIVE_FW_ROOT_PAIR, kernel='5ec1028c81526e1ed31db2b97e47edf8663e83cb')
NEO_RELEASE20_LIVE_FW_ROOT_PAIR = dict(NEO_RELEASE15_LIVE_FW_ROOT_PAIR, kernel='c46d7dcdb8712ea9aeb0ce47b439ffae76371e55')
STANDARD_M1N1_SOURCE = "d05ba17dfb771871d608225be42968bbb1e75a18"
PREVIOUS_STANDARD_M1N1_SOURCE = "31501778e863feb5d2afe77be3a1edc588c98119"
J615_LEGACY_M1N1_SOURCES = ("74ba6bea52d1f865d204bb3f8168705a148fd5c5",
Expand Down Expand Up @@ -173,6 +176,8 @@ def check_j615_native25(sources, binary_sha, mesa):
pair = J615_RELEASE18_NATIVE25_PAIR
if sources['kernel'] == J615_RELEASE19_NATIVE25_PAIR['kernel']:
pair = J615_RELEASE19_NATIVE25_PAIR
if sources['kernel'] == J615_RELEASE20_NATIVE25_PAIR['kernel']:
pair = J615_RELEASE20_NATIVE25_PAIR
if not isinstance(pair, dict) or set(pair) != {'kernel', 'm1n1', 'm1n1_bin_sha256'}:
raise ValueError('J615 native25 requires the recorded J615 boot/kernel pair (J615_NATIVE25_PAIR)')
if sources['kernel'] != pair['kernel']: raise ValueError('J615 native25 requires the matched J615 kernel')
Expand All @@ -191,7 +196,8 @@ def check_neo_firmware_tables(kernel, sources, binary_sha):
NEO_NIC_LIVE_FW_ROOT_PAIR, NEO_DISPLAY_READY_LIVE_FW_ROOT_PAIR,
NEO_RELEASE14_LIVE_FW_ROOT_PAIR,
NEO_RELEASE15_LIVE_FW_ROOT_PAIR, NEO_RELEASE16_LIVE_FW_ROOT_PAIR,
NEO_RELEASE18_LIVE_FW_ROOT_PAIR, NEO_RELEASE19_LIVE_FW_ROOT_PAIR) if kernel == p['kernel']]
NEO_RELEASE18_LIVE_FW_ROOT_PAIR, NEO_RELEASE19_LIVE_FW_ROOT_PAIR,
NEO_RELEASE20_LIVE_FW_ROOT_PAIR) if kernel == p['kernel']]
if not pairs:
return
if any(not re.fullmatch(r'[0-9a-f]{40}', p.get('m1n1') or '') for p in pairs):
Expand Down Expand Up @@ -295,7 +301,7 @@ def pro_data(manifest, directory):
return {}
if pro.get('profile') != 't6030-g15s-legacy-hal':
raise ValueError('Pro performance profile differs')
if manifest['source_commits']['kernel'] != '5ec1028c81526e1ed31db2b97e47edf8663e83cb':
if manifest['source_commits']['kernel'] != 'c46d7dcdb8712ea9aeb0ce47b439ffae76371e55':
raise ValueError('Pro performance kernel differs')
expected = {'native': ('mesa-m3-native-pro', 'opt/mesa-m3/native-pro', 'd616d0650d6fa80f72a750a0121442ab917ed6cf', b't6030-native-gl-legacy-hal\n'),
'vulkan': ('mesa-m3-pro-vulkan', 'opt/mesa-m3/pro-vulkan', 'b0f56952b7f06955b143fbfa90c07de4c5864964', b't6030-pro-vulkan-legacy-hal\n')}
Expand All @@ -304,7 +310,7 @@ def pro_data(manifest, directory):
kernel_path = directory / manifest['packages']['kernel']['file']
listing = subprocess.check_output(['bsdtar', '-tf', str(kernel_path)], text=True).splitlines()
markers = [name for name in listing if re.fullmatch(r'usr/lib/modules/[^/]+/aurora-m3pro-profile', name)]
if len(markers) != 1 or member(kernel_path, markers[0]) != b't6030-perf-v1\nsource=5ec1028c81526e1ed31db2b97e47edf8663e83cb\n':
if len(markers) != 1 or member(kernel_path, markers[0]) != b't6030-perf-v1\nsource=c46d7dcdb8712ea9aeb0ce47b439ffae76371e55\n':
raise ValueError('Pro kernel performance marker differs')
pins = {}
for role, (name, prefix, source, marker) in expected.items():
Expand Down
3 changes: 2 additions & 1 deletion tools/aurora-sep/pro/mesa-m3-pro-check
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ case "$kernel_profile" in
't6030-perf-v1
source=d49021440d8ca02bbc8ecc17c19ce76c048b6236'|'t6030-perf-v1
source=6f63677751854d57bcfac172314957bc2197c05f'|'t6030-perf-v1
source=5ec1028c81526e1ed31db2b97e47edf8663e83cb') ;;
source=5ec1028c81526e1ed31db2b97e47edf8663e83cb'|'t6030-perf-v1
source=c46d7dcdb8712ea9aeb0ce47b439ffae76371e55') ;;
*) exit 1 ;;
esac
[ "$(cat /opt/mesa-m3/native-pro/share/mesa-m3/profile 2>/dev/null)" = t6030-native-gl-legacy-hal ] || exit 1
Expand Down
4 changes: 2 additions & 2 deletions tools/aurora-sep/recipes/MESA-SOURCES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ are recorded in each release's `mesa-matched-stack.json`.
|---|---|---|---|---|
| `mesa-m3`, `/opt/mesa-m3` | M3 Pro fallback, M3 Air legacy profile | `m3/legacy` | `7ff89a4da387` | `mesa-m3/` |
| `mesa-m3`, `/opt/mesa-m3/25g83` | M3 Air on 26.6.2, OpenGL only | `m3/air-hal200` | `78908f4d18af` | `mesa-m3/` |
| `mesa-m3-native-pro`, `/opt/mesa-m3/native-pro` | M3 Pro desktop OpenGL | `fix/native-index-offset-integrated-20261013` | `d616d0650d6f` | `release19/native-pro/` |
| `mesa-m3-pro-vulkan`, `/opt/mesa-m3/pro-vulkan` | M3 Pro Vulkan | `review/aurora-mesa-foundation-20261012` | `b0f56952b7f0` | `release19/pro-vulkan/` |
| `mesa-m3-native-pro`, `/opt/mesa-m3/native-pro` | M3 Pro desktop OpenGL | `fix/native-index-offset-integrated-20261013` | `d616d0650d6f` | `release20/native-pro/` |
| `mesa-m3-pro-vulkan`, `/opt/mesa-m3/pro-vulkan` | M3 Pro Vulkan | `review/aurora-mesa-foundation-20261012` | `b0f56952b7f0` | `release20/pro-vulkan/` |
| `mesa-m3-g15c`, `/opt/mesa-m3-g15c` | M3 Max (T6031) test kit | `m3max/g15c` | `ff120e88cfc0` | `mesa-m3-g15c/` |

`mesa-m3` builds two trees into one package: the legacy tree and the HAL200 tree. The
Expand Down
11 changes: 11 additions & 0 deletions tools/aurora-sep/recipes/release20/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Release 20 package recipes

**Kernel** (`kernel/`): the release 19 recipe and config, built from `c46d7dcdb8712ea9aeb0ce47b439ffae76371e55` (#136). The recipe config file is unchanged. The package build runs `olddefconfig`, which changes 16 symbols against release 19: user4k is compiled in (`ARM64_USER4K_EXPERIMENTAL=y` and the symbols it selects, including `PAGE_EXTENSION`) but stays off unless the kernel is booted with `user4k=on`; the five separate Neo graphics symbols are gone because the Neo uses the shared drivers; `DRM_GEM_DMA_HELPER` becomes a module; two new options stay off. The T6030 performance marker names this source.

**Native OpenGL for the M3 Pro** (`native-pro/`): source `d616d0650d6fa80f72a750a0121442ab917ed6cf` and its source archive are unchanged from release 19. Package release 10 changes only `mesa-m3-pro-check`, which now admits the release 16, 18, 19 and 20 kernels by their exact markers. It then requires the exact T6030 runtime identity, as before.

This remains experimental native OpenGL support, without a full conformance claim.

**Vulkan for the M3 Pro** (`pro-vulkan/`): the separate Honeykrisp package keeps the release 16 binaries and compression settings.

**Other Macs:** M1/M2 and the Air HAL200 profiles keep their existing selection. The Neo keeps its selection rules, but its Mesa doesn't match this kernel's GPU interface, so a Neo session uses software rendering until a Neo Mesa built for this kernel ships.
240 changes: 240 additions & 0 deletions tools/aurora-sep/recipes/release20/kernel/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
# AArch64 Apple Silicon kernel and headers, with separate T8140 and M3 GPU profiles.
_auroraver=7.1.12
_aurorarel=2
pkgrel=20261017.20

_commit=c46d7dcdb8712ea9aeb0ce47b439ffae76371e55

# GPU-profile bootloaders are admitted separately by the installer.
_m1n1_version=1.6.1

pkgbase=linux-aurora
_srcname=aurora-linux-${_commit}
_kernelname=${pkgbase#linux}
_desc="AArch64 Apple Silicon (Aurora kernel)"
pkgdesc=$_desc
pkgver="${_auroraver}.aurora${_aurorarel}"
arch=('aarch64')
url="https://github.com/omacom/linux-aurora"
license=('GPL2')

_makedeps=(
base-devel bc dtc kmod libelf pahole cpio perl rustup rust-bindgen tar xz xmlto python clang22 llvm22 lld22
)
options=('!strip')
source=(
"aurora-linux-${_commit}.tar.gz"
config # the main kernel config file
rust-toolchain.toml
linux-aurora-phram.conf # modprobe.d: no phram at boot
)
sha256sums=('493ed9fb4a9e245fd59a92a2396d3c968516be932749b8059757a29380652509'
'c811698c5242d42850bef6669f29cd7b485e997d3ac1a423e2d3cbbb3fdc19b8'
'2a95563bb9f5b216cc3c170a17e9471448bc63a7084bdd67df23d074939b366c'
'e2d0c0171e3a8fa04e9fc20d59101b84db544994fb710662b8830680a3d081d6')

# Kbuild takes ARCH literally and knows arm64, not aarch64.
export ARCH=arm64
export LLVM=1
export PATH="/usr/lib/llvm22/bin:$PATH"
export LIBCLANG_PATH=/usr/lib/llvm22/lib
export MAKEFLAGS=-j4
export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

prepare() {
sudo pacman -Sy --noconfirm --needed archlinuxarm-keyring
sudo pacman -Su --noconfirm --needed "${_makedeps[@]}"
for tool in clang ld.lld llvm-ar; do
[[ -x /usr/lib/llvm22/bin/$tool ]] || return 1
done
[[ $(clang --version) == *"clang version 22.1.8"* ]] || return 1
[[ $(ld.lld --version) == *"22.1.8"* ]] || return 1
rustup toolchain install 1.93.1 --profile minimal --component rust-src
rustup target add aarch64-unknown-linux-gnu --toolchain 1.93.1
cd $_srcname

echo "Setting version..."
echo "-$_aurorarel-$pkgrel-sep" > localversion.10-pkgrel

local src
for src in "${source[@]}"; do
src="${src%%::*}"
src="${src##*/}"
[[ $src = *.patch ]] || continue
echo "Applying patch $src..."
patch -Np1 < "../$src"
done

echo "Pinning the Rust toolchain..."
cp ../rust-toolchain.toml .
[[ $(rustc --version) == "rustc 1.93.1 "* ]] || return 1
clang --version
rustc --version
bindgen --version

echo "Creating build directories..."
mkdir -p build/base

echo "Setting config (base)..."
cp ../config build/base/.config
make olddefconfig prepare O=$PWD/build/base
diff -u ../config build/base/.config || :
make -s kernelrelease O=$PWD/build/base > build/base/version

echo "Prepared $pkgbase version $(<build/base/version)"
}

build() {
cd $_srcname
echo "Building base..."
make all O=$PWD/build/base -j4 W=1
}

_package_kernel() {
pkgdesc="The $pkgdesc kernel and modules"
depends=(coreutils kmod initramfs $2 "m1n1>=$_m1n1_version")
optdepends=('crda: to set the correct wireless channels of your country'
'linux-firmware: firmware images needed for some devices')
# No generic linux provide: on a shared aarch64 repository it would compete
# with linux-aarch64 for any dependency on linux.
provides=(WIREGUARD-MODULE linux-asahi=${pkgver})
conflicts=(linux-asahi)

local kernver="$(<$O/version)"
local modulesdir="$pkgdir/usr/lib/modules/$kernver"

echo "Installing boot image..."
# systemd expects to find the kernel here to allow hibernation
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
install -Dm644 "$O"/arch/arm64/boot/Image "$modulesdir/vmlinuz"

# Used by mkinitcpio to name the kernel
echo "$1" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"

printf "t6030-perf-v1\nsource=%s\n" "$_commit" | install -Dm644 /dev/stdin "$modulesdir/aurora-m3pro-profile"

echo "Installing modules..."
make O="$O" INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 modules_install

echo "Installing device trees..."
install -Dt "$modulesdir/dtbs" "$O"/arch/arm64/boot/dts/apple/*.dtb

echo "Installing the phram blacklist..."
install -Dm644 "$srcdir/linux-aurora-phram.conf" "$pkgdir/usr/lib/modprobe.d/linux-aurora-phram.conf"

# remove build and source links
rm -f "$modulesdir"/{source,build}
}

_package() {
cd $_srcname
export O="$PWD/build/base"
_package_kernel "$pkgbase"
}

_package-headers() {
pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel"
depends=(pahole)
provides=(linux-asahi-headers=${pkgver})
conflicts=(linux-asahi-headers)

KARCH=arm64

cd $_srcname
O=build/base
local builddir="$pkgdir/usr/lib/modules/$(<${O}/version)/build"

echo "Installing build files..."
install -Dt "$builddir" -m644 $O/.config Makefile $O/Module.symvers $O/System.map \
localversion.* $O/version $O/vmlinux
install -Dt "$builddir/kernel" -m644 kernel/Makefile
cp -t "$builddir" -a scripts $O/scripts

# required when STACK_VALIDATION is enabled
#install -Dt "$builddir/tools/objtool" tools/objtool/objtool

# required when DEBUG_INFO_BTF_MODULES is enabled
install -Dt "$builddir/tools/bpf/resolve_btfids" $O/tools/bpf/resolve_btfids/resolve_btfids

echo "Installing headers..."
cp -t "$builddir" -a include $O/include

install -Dt "${builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile
install -Dt "${builddir}/arch/${KARCH}/kernel" -m644 $O/arch/${KARCH}/kernel/asm-offsets.s
cp -t "${builddir}/arch/${KARCH}" -a arch/${KARCH}/include $O/arch/${KARCH}/include

install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h

# https://bugs.archlinux.org/task/13146
install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h

# https://bugs.archlinux.org/task/20402
install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h

# https://bugs.archlinux.org/task/71392
install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h

echo "Installing KConfig files..."
find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;

echo "Installing unstripped VDSO..."
make O="$O" INSTALL_MOD_PATH="$pkgdir/usr" vdso_install link=

echo "Removing unneeded architectures..."
local arch
for arch in "$builddir"/arch/*/; do
[[ $arch = */${KARCH}/ ]] && continue
echo "Removing $(basename "$arch")"
rm -r "$arch"
done

echo "Removing documentation..."
rm -r "$builddir/Documentation"

echo "Removing broken symlinks..."
find -L "$builddir" -type l -printf 'Removing %P\n' -delete

echo "Removing loose objects..."
find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete

echo "Removing cmd files..."
find "$builddir" -type f -name '*.cmd' -printf 'Removing %P\n' -delete

echo "Stripping build tools..."
local file
while read -rd '' file; do
case "$(file --no-sandbox -bi "$file")" in
application/x-sharedlib\;*) # Libraries (.so)
strip -v $STRIP_SHARED "$file" ;;
application/x-archive\;*) # Libraries (.a)
strip -v $STRIP_STATIC "$file" ;;
application/x-executable\;*) # Binaries
strip -v $STRIP_BINARIES "$file" ;;
application/x-pie-executable\;*) # Relocatable binaries
strip -v $STRIP_SHARED "$file" ;;
esac
done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)

echo "Stripping vmlinux..."
strip -v $STRIP_STATIC "$builddir/vmlinux"

echo "Adding symlink..."
mkdir -p "$pkgdir/usr/src"
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"

}

pkgname=("$pkgbase" "$pkgbase-headers")
for _p in "${pkgname[@]}"; do
eval "package_$_p() {
$(declare -f "_package${_p#$pkgbase}")
_package${_p#$pkgbase}
}"
done

# vim:set ts=8 sts=2 sw=2 et:
Loading