Skip to content
Closed
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
24 changes: 24 additions & 0 deletions docs/updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,27 @@ gh workflow run promote.yml -R aurora-silicon/nixos-aurora --ref main
the production key made.
- Failed build attempts upload `failed-nix-<package>-attempt-N`, never `nix-<package>-closure`; the
collector takes the newest artifact of each name and skips one without a build record.

The kernel prepares the pinned, corrected bindgen at
`tools/aurora-bindgen/build/bin/bindgen` before configuration. Kbuild selects it
automatically, including out-of-tree builds. No `BINDGEN=` make argument or
export is required. Fedora and ALARM build and compile-test the generator from
the kernel's checked source manifest; Nix uses the matching patched derivation
and links its executable into that entry point. ALARM retains its exact
compiler-lint adapter there. Every emitted layout assertion remains mandatory.
Stock bindgen 0.73.2 loses alignment on empty C records such as
`sched_statistics` with `SCHEDSTATS=n`; enabling statistics is not the fix.

Cons3 also pins FAT's default codepage 437 and ASCII charset, with both
converters built into the kernel. Asahi's early dracut vendor-firmware hook
mounts the ESP without charset options; it must not depend on a charset module
missing from initramfs. XZ and Zstd firmware loading are enabled for compressed
distribution firmware files. The shared fragment carries these requirements.

The retained Apple-only policy bases also resolve the shared DAX requirements
with memory hotplug/hot-remove enabled and keep socket diagnostics and the
Apple HID core built in with their built-in consumers. They explicitly exclude
ACPI I2C HID and Qualcomm on-SoC QMI audio offload, which are internal
transports absent on Apple DT machines; ordinary OF HID and USB audio remain
enabled. Validation applies the ordered shared/common policy without ignoring
unmet requests. No display handoff or device admission gate is relaxed.
126 changes: 0 additions & 126 deletions kernel/asahi.config

This file was deleted.

12 changes: 12 additions & 0 deletions kernel/common.config
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,15 @@ CONFIG_SND_HDA_GENERIC=m
CONFIG_DRM_AMDGPU=m
CONFIG_DRM_RADEON=m
CONFIG_DRM_NOUVEAU=m

# Resolve shared requirements over retained Apple-only distribution bases.
# DAX device memory requires both hotplug and hot-remove support.
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTREMOVE=y
# Built-in socket diagnostics and Apple HID transport retain built-in parents.
CONFIG_INET_DIAG=y
CONFIG_SPI_HID_APPLE_CORE=y
# Apple DT machines use OF HID and ordinary USB audio, not ACPI HID or a
# Qualcomm on-SoC QMI audio-offload DSP. Keep those internal transports off.
# CONFIG_I2C_HID_ACPI is not set
# CONFIG_SND_USB_AUDIO_QMI is not set
8 changes: 0 additions & 8 deletions kernel/neo.config

This file was deleted.

7 changes: 4 additions & 3 deletions kernel/provenance.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"kernel_commit": "311471f73e9919764bfb24acfe7eeb7c5230795a",
"config_source": "Integration shared asahi.config merged over the retained Fedora-resolved baseline and common/Neo requirements; native Nix olddefconfig resolves current Kconfig and compiler probes.",
"kernel_commit": "26f2474183fcb287e0f7e8e180c53ed639b6a353",
"config_source": "Retained Fedora-resolved policy baseline; the pinned kernel asahi.config and common requirements are merged at build time before native olddefconfig and validation.",
"rpm_sha256": "36ba552ea706c5d35d626f0e08a3702b7f2e0401aeb20e09ed138418f40b5383",
"config_sha256": "55497f2e29d0659804883aeeed8244c5a2dfd8ba3827e0616b976656c5c5469d",
"baseline_kernel_commit": "e0fa50d863ee7747de0af16525dfd974cdd826f8",
"upstream_fragment_sha256": "5f77ce72cbe96e94fc6857bd7caf7d9875a80e51d74481d0129fc4e03cec8e5c"
"upstream_fragment_sha256": "5f77ce72cbe96e94fc6857bd7caf7d9875a80e51d74481d0129fc4e03cec8e5c",
"shared_fragment_source": "arch/arm64/configs/asahi.config at kernel_commit; baseline fragment hash retained below as historical provenance"
}
10 changes: 6 additions & 4 deletions kernel/validate-config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Reject requested capabilities that Kconfig silently dropped."""
"""Reject dropped capabilities after applying ordered fragment overrides."""
from pathlib import Path
import sys

Expand All @@ -15,16 +15,18 @@ def values(path):
return result


def validate(fragment, resolved):
def validate(fragment, resolved, *overrides):
requested, actual = values(fragment), values(resolved)
for override in overrides:
requested.update(values(override))
missing = [f'{name}: wanted {value}, got {actual.get(name, "absent")}'
for name, value in requested.items() if actual.get(name) != value]
for name, value in requested.items() if actual.get(name, 'n') != value]
if missing:
raise ValueError('Kernel capabilities disabled by Kconfig:\n' + '\n'.join(missing))


if __name__ == '__main__':
try:
validate(*sys.argv[1:])
validate(sys.argv[1], sys.argv[-1], *sys.argv[2:-1])
except (ValueError, OSError) as error:
sys.exit(str(error))
22 changes: 18 additions & 4 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,27 @@ in {
}).overrideAttrs (old: {
env = old.env // { RUSTC_BOOTSTRAP = "1"; };
nativeBuildInputs = old.nativeBuildInputs ++ [ final.binutils kernelLLVM.lld ];
# Refresh compiler capability probes using the same resolved hardware
# configuration as Fedora. Validate the shared fragments afterwards.
# Prepare the source-tree entry point before any Rust availability probe.
postPatch = (old.postPatch or "") + ''
mkdir -p tools/aurora-bindgen/build/bin
ln -s ${final.aurora-bindgen}/bin/bindgen tools/aurora-bindgen/build/bin/bindgen
'';
# Refresh compiler probes, then apply hardware defaults from the same
# pinned source that is built. Distro requirements override them in order.
configurePhase = final.lib.replaceStrings
[ "ln -sv" " oldconfig" ] [ "cp -v" " olddefconfig" ] old.configurePhase;
postConfigure = ''
python3 ${stableFile ./kernel/validate-config.py} ${stableFile ./kernel/common.config} "$buildRoot/.config"
python3 ${stableFile ./kernel/validate-config.py} ${stableFile ./kernel/neo.config} "$buildRoot/.config"
sourcePath="$sourceRoot"
case "$sourcePath" in
/*) ;;
*) sourcePath="$NIX_BUILD_TOP/$sourcePath" ;;
esac
sharedFragment="$sourcePath/arch/arm64/configs/asahi.config"
bash "$sourcePath/scripts/kconfig/merge_config.sh" -m -O "$buildRoot" \
"$buildRoot/.config" "$sharedFragment" ${stableFile ./kernel/common.config}
make "''${makeFlags[@]}" olddefconfig
python3 ${stableFile ./kernel/validate-config.py} "$sharedFragment" \
${stableFile ./kernel/common.config} "$buildRoot/.config"
grep -qx 'CONFIG_RUST=y' "$buildRoot/.config"
grep -qx 'CONFIG_ARM64_16K_PAGES=y' "$buildRoot/.config"
make "''${makeFlags[@]}" rustavailable
Expand Down
22 changes: 11 additions & 11 deletions sources.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"kernel-aurora": {
"repository": "https://github.com/aurora-silicon/linux",
"commit": "311471f73e9919764bfb24acfe7eeb7c5230795a",
"commit": "26f2474183fcb287e0f7e8e180c53ed639b6a353",
"version": "7.3.0",
"source_url": "https://codeload.github.com/aurora-silicon/linux/tar.gz/311471f73e9919764bfb24acfe7eeb7c5230795a",
"archive_root": "linux-311471f73e9919764bfb24acfe7eeb7c5230795a",
"sha256": "05505a4962f13ab831717db6a90dcbfb01193f0d2f6dcf73e1da3b213b0d1832",
"nix_hash": "sha256-BVBaSWLxOrgxcX22qQ3L+wEZPw0vbc9z4do7ITsNGDI="
"source_url": "https://codeload.github.com/aurora-silicon/linux/tar.gz/26f2474183fcb287e0f7e8e180c53ed639b6a353",
"archive_root": "linux-26f2474183fcb287e0f7e8e180c53ed639b6a353",
"sha256": "5516214432b23f39a3f0e79278454d76a846dc9c8131168f8dff22e78ad166ad",
"nix_hash": "sha256-VRYhRDKyPzmj8OeSeEVNdqhG3JyBMRaPjf8i54rRZq0="
},
"aura": {
"repository": "https://github.com/aurora-silicon/aura",
Expand Down Expand Up @@ -91,12 +91,12 @@
},
"aurora-firstboot": {
"repository": "https://github.com/aurora-silicon/aurora-platform",
"commit": "9132f0b820fbd56ece1a9d1402a37ba94197d4cf",
"version": "0.1.10",
"source_url": "https://codeload.github.com/aurora-silicon/aurora-platform/tar.gz/9132f0b820fbd56ece1a9d1402a37ba94197d4cf",
"archive_root": "aurora-platform-9132f0b820fbd56ece1a9d1402a37ba94197d4cf",
"sha256": "7ca6f50aa30b4b976427ddf4a40ae4d6a7966fc39f2a4e67ff81ae506b12b6f3",
"nix_hash": "sha256-fKb1CqMLS5dkJ930pArk1qeWb8OfKk5n/4GuUGsStvM="
"commit": "9132f0b820fbd56ece1a9d1402a37ba94197d4cf",
"version": "0.1.10",
"source_url": "https://codeload.github.com/aurora-silicon/aurora-platform/tar.gz/9132f0b820fbd56ece1a9d1402a37ba94197d4cf",
"archive_root": "aurora-platform-9132f0b820fbd56ece1a9d1402a37ba94197d4cf",
"sha256": "7ca6f50aa30b4b976427ddf4a40ae4d6a7966fc39f2a4e67ff81ae506b12b6f3",
"nix_hash": "sha256-fKb1CqMLS5dkJ930pArk1qeWb8OfKk5n/4GuUGsStvM="
},
"avd-fw": {
"repository": "https://github.com/aurora-silicon/avd-fw",
Expand Down
34 changes: 34 additions & 0 deletions tests/test_kernel_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python3
"""Exercise shared hardware validation with a distro built-in override."""
from pathlib import Path
import subprocess
import sys
import tempfile
import unittest

VALIDATOR = Path(__file__).resolve().parents[1] / "kernel/validate-config.py"


class KernelRequirements(unittest.TestCase):
def check_requirements(self, resolved):
with tempfile.TemporaryDirectory() as temporary:
root = Path(temporary)
(root / "shared").write_text("CONFIG_SPI_HID_APPLE_OF=m\nCONFIG_APPLE_SEP=m\n# CONFIG_TRUSTED_KEYS_TPM is not set\n")
(root / "common").write_text("CONFIG_SPI_HID_APPLE_OF=y\n")
(root / "resolved").write_text(resolved)
return subprocess.run([sys.executable, str(VALIDATOR), str(root / "shared"),
str(root / "common"), str(root / "resolved")],
capture_output=True, text=True)

def test_common_built_in_requirement_overrides_shared_module(self):
result = self.check_requirements("CONFIG_SPI_HID_APPLE_OF=y\nCONFIG_APPLE_SEP=m\n")
self.assertEqual(result.returncode, 0, result.stderr)

def test_dropped_shared_driver_is_still_rejected(self):
result = self.check_requirements("CONFIG_SPI_HID_APPLE_OF=y\n# CONFIG_APPLE_SEP is not set\n")
self.assertNotEqual(result.returncode, 0)
self.assertIn("CONFIG_APPLE_SEP", result.stderr)


if __name__ == "__main__":
unittest.main()
4 changes: 2 additions & 2 deletions tests/test_stage2.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def device_tree(compatible):


def stage2(boards=('j274', 'j700'), options=b'', aura=b'AURA-STAGE2-BINARY'):
return aura + b''.join(device_tree(f'apple,{board}') for board in boards) + gzip.compress(b'u-boot') + options
return aura + b''.join(device_tree(f'apple,{board}') for board in boards) + gzip.compress(b'u-boot', mtime=0) + options


class CheckStage2Tests(unittest.TestCase):
Expand All @@ -65,7 +65,7 @@ def test_deviations_are_refused(self):
aura = b'AURA-STAGE2-BINARY'
bad = {
'other aura': (stage2(aura=b'OTHER-AURA-BINARY!'), ['j700']),
'no device trees': (aura + gzip.compress(b'u-boot'), []),
'no device trees': (aura + gzip.compress(b'u-boot', mtime=0), []),
'no MacBook Neo': (stage2(boards=('j274',)), ['j700']),
'U-Boot not gzip': (aura + device_tree('apple,j700') + b'raw u-boot', []),
'trailing garbage': (stage2(options=b'\x00\x01binary'), []),
Expand Down
Loading