Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.

Commit 30f016b

Browse files
techmoreclaude
andauthored
Aurora wip5: J314S install record, working staging script, Touch ID guard-off plan (#704)
wip5 boots on the J314S. Records how: the initramfs must be the working Arch mkinitcpio image retargeted with prepare-trial-initrd.py (mkinitramfs ignores cryptdevice= and died before the passphrase prompt on the first try). Adds stage-wip5.sh doing exactly that, the graphical-unlock (splash) note, and touchid-guard-off.sh: verified dd backup of the xART container and Apple NVMe namespaces, then a separate xart_guard=0 entry. TOUCH-ID-STATE.md points at it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 57a3c88 commit 30f016b

4 files changed

Lines changed: 178 additions & 0 deletions

File tree

‎mseries/aurora-sep/TOUCH-ID-STATE.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
One page of where each layer stands, with the evidence. Update it when something changes; details live in
44
[XART-GUARD.md](XART-GUARD.md) and [UPSTREAM-MAP.md](UPSTREAM-MAP.md).
55

6+
## Update 2026-10-29: wip5
7+
8+
On `7.2.11-elementary-aurora72-wip5` (guard 1) the enclave matches the enrolled finger (fprintd: `#0: right-index-finger`), but
9+
the host refuses the kind-4 rewrite after the match, so `fprintd-verify` fails every time. The owner chose to test the guard off
10+
with a backup first: [../aurora/unified72/wip5/README.md](../aurora/unified72/wip5/README.md) (xART backup + separate
11+
`elementary-aurora72-wip5-xartguard-off-trial` entry; then check macOS Touch ID). Results go there and here.
12+
613
## Machine
714

815
MacBook Pro 14" (M1 Pro, 2021), `apple,j314s` / `apple,t6000`, `asahi,os-fw-version` 13.5,
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Aurora 7.2 wip5 on the J314S (M1 Pro 14"): install record, 2026-10-29
2+
3+
This page lets the laptop be rebuilt without this session's notes. wip5 is unified72 revision 7: omacom/linux-aurora
4+
`2f725546` (7.2.11) with patches 0001–0005 (PR #698), built in CI run 40866985442. The package is
5+
`linux-image-elementary-aurora72-wip5_7.2.11+elementary.aurora72.wip5-1_arm64.deb`, sha256 `658746f5…ace62` (CI `SHA256SUMS`).
6+
7+
## Result
8+
9+
- **Boots** (first good boot 2026-10-29 10:58 EDT). Working: internal panel, external DP monitor, GPU (asahi), Wi-Fi, the six
10+
tas2764 speaker amps (they log "Failed to parse devicetree" on the first probe and bind on the retry), cs42l84, SEP driver.
11+
- No new kernel errors against wip4, apart from three `apple-dcp … Failed to get dp-phy: -517` probe deferrals.
12+
- Not yet checked by the owner: dock replug, suspend and resume.
13+
- wip4 stays the GRUB default. wip5 is the entry `elementary-aurora72-wip5-trial`.
14+
15+
## How to install it (the way that works)
16+
17+
```bash
18+
sudo bash mseries/aurora/unified72/wip5/stage-wip5.sh ~/.cache/mseries-kernel/wip5/linux-image-elementary-aurora72-wip5_7.2.11+elementary.aurora72.wip5-1_arm64.deb
19+
sudo grub-reboot elementary-aurora72-wip5-trial && sudo reboot
20+
```
21+
22+
`stage-wip5.sh` installs the package, copies `vmlinuz`, and builds the initramfs by **retargeting the working wip4 one**
23+
with `mseries/aurora/prepare-trial-initrd.py`, then audits it with `audit-trial-initrd.py`. The audit checks that the early
24+
archive and every non-module entry are unchanged and that all 91 modules match the package. Last, it copies the wip4 GRUB
25+
entry as a TRIAL entry.
26+
27+
**Why not mkinitramfs:** the J314S boots an Arch mkinitcpio initramfs. The kernel line carries `cryptdevice=`, and the image's
28+
hooks are `base asahi udev … encrypt`, with plymouth. initramfs-tools ignores `cryptdevice=`. The first wip5 staging
29+
used `mkinitramfs` and died before the passphrase prompt on every boot, leaving no journal. mkinitcpio itself is not
30+
installed on this machine, so retargeting is the only path.
31+
32+
## Graphical unlock screen
33+
34+
The initramfs already has plymouth with the elementary theme, and the `encrypt` hook asks through `plymouth ask-for-password`.
35+
The trial entries boot with `loglevel=7` and no `splash`, so the prompt is plain text with no cue. To get the graphical prompt
36+
on the wip5 entry only:
37+
38+
```bash
39+
sudo cp /boot/grub/custom.cfg /boot/grub/custom.cfg.before-splash && sudo sed -i '/linux \/vmlinuz-aurora72-wip5 /s/loglevel=7/quiet splash loglevel=3/' /boot/grub/custom.cfg
40+
```
41+
42+
## Touch ID on wip5
43+
44+
On wip5 with the default guard (`xart_guard` 1), the enclave **matches** the enrolled finger. fprintd lists
45+
`#0: right-index-finger`. The host then fails the verify: the kernel logs `xART guard: refused to rewrite a kind-4 record this
46+
Linux install did not create`, then `post-match identity-bag snapshot failed`. That is the documented cold-boot M1 behaviour
47+
([../../../aurora-sep/XART-GUARD.md](../../../aurora-sep/XART-GUARD.md)). The maintainers' reference M1 Pro runs `xart_guard=0` daily.
48+
49+
Owner decision, 2026-10-29: try it with a backup first. `touchid-guard-off.sh` does both steps:
50+
51+
1. A byte-exact, read-only `dd` of `nvme0n1p1` (iBootSystemContainer, where xART lives), `nvme0n2` and `nvme0n3`, each
52+
verified against the device. They go to `/var/lib/mseries-kernel-tests/xart-backup-<UTC>/` (root only, with `SHA256SUMS` and
53+
`layout.txt`). **These images are this Mac's enclave state. Never commit them.** Keep a second copy off the machine (for
54+
example a root-only directory on the SER8). Otherwise a wiped laptop loses the only way to restore them.
55+
2. A separate GRUB entry, `elementary-aurora72-wip5-xartguard-off-trial`, the wip5 entry plus `apple_sep.xart_guard=0`. The
56+
normal wip5 entry keeps the guard on. Nothing is armed. Undo: copy `custom.cfg.before` back from the backup directory.
57+
58+
Test order: boot the guard-off entry once, run `fprintd-verify` (enrol again only if it fails), then boot macOS and check that
59+
macOS Touch ID still works. Write the results here and in [TOUCH-ID-STATE.md](../../../aurora-sep/TOUCH-ID-STATE.md).
60+
61+
**Restoring xART is a last resort.** Writing `nvme0n1p1` back with `dd` replaces the whole Apple boot container. Do it only if
62+
macOS Touch ID or boot breaks *and* the steps the maintainers suggest have failed. Do it from this Linux install or from
63+
recovery, never while macOS is running, and only with the image from the same Mac.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/usr/bin/env bash
2+
# Stage an Aurora 7.2 unified72 kernel (wip5 by default) on the J314S beside the working one, as a
3+
# non-default TRIAL GRUB entry. The persistent default and the shared boot.bin are not touched.
4+
#
5+
# The J314S boots an Arch mkinitcpio initramfs (cryptdevice= and the encrypt + plymouth hooks).
6+
# Never build the new initramfs with initramfs-tools/mkinitramfs: it ignores cryptdevice= and the
7+
# kernel dies before the passphrase prompt (wip5 first try, 2026-10-29). Instead retarget the working
8+
# initramfs with prepare-trial-initrd.py and audit it, which is what this script does.
9+
#
10+
# sudo bash stage-wip5.sh /path/to/linux-image-elementary-aurora72-wip5_*.deb
11+
# Optional: WORKING=7.2.11-elementary-aurora72-wip4 NEW=7.2.11-elementary-aurora72-wip5 SLUG=aurora72-wip5
12+
set -euo pipefail
13+
[[ $EUID -eq 0 ]] || { echo 'run with sudo' >&2; exit 1; }
14+
deb=${1:?usage: stage-wip5.sh <package.deb>}
15+
here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
16+
aurora=$(cd -- "$here/../.." && pwd) # mseries/aurora
17+
WORKING=${WORKING:-7.2.11-elementary-aurora72-wip4}
18+
NEW=${NEW:-7.2.11-elementary-aurora72-wip5}
19+
SLUG=${SLUG:-aurora72-wip5}
20+
WORKING_SLUG=${WORKING_SLUG:-${WORKING#*elementary-}}
21+
cfg=/boot/grub/custom.cfg
22+
23+
ts=$(date -u +%Y%m%dT%H%M%SZ)
24+
backup=/var/lib/mseries-kernel-tests/staging/$ts-$SLUG
25+
mkdir -p "$backup"; chmod 700 "$backup"
26+
cp -a "$cfg" /boot/grub/grubenv "$backup/"
27+
28+
dpkg -i "$deb"
29+
depmod -a "$NEW"
30+
install -m 0755 "/usr/lib/modules/$NEW/vmlinuz" "/boot/vmlinuz-$SLUG"
31+
32+
# Retarget the working Arch initramfs: same early archive, hooks and unlock userspace, new modules.
33+
work=$backup/initrd
34+
mkdir -m 700 "$work"
35+
python3 "$aurora/prepare-trial-initrd.py" --baseline "/boot/initrd.img-$WORKING" --module-root /usr \
36+
--old-version "$WORKING" --new-version "$NEW" --output "$work/initrd.img-$NEW" --report "$work/module-preparation.json"
37+
python3 - "$aurora/audit-trial-initrd.py" "/boot/initrd.img-$WORKING" "$work/initrd.img-$NEW" "/usr/lib/modules/$NEW" <<'PY'
38+
import importlib.util, sys
39+
from pathlib import Path
40+
s = importlib.util.spec_from_file_location('audit', sys.argv[1]); a = importlib.util.module_from_spec(s); s.loader.exec_module(a)
41+
r = a.audit(Path(sys.argv[2]).read_bytes(), Path(sys.argv[3]).read_bytes(), Path(sys.argv[4]))
42+
for k in ('early_prefix_unchanged', 'nonmodule_entries_unchanged', 'module_bytes_match_candidate_tree', 'dependency_files_present'):
43+
assert r[k] is True, k
44+
print('initramfs audit passed:', r['verified_module_count'], 'modules')
45+
PY
46+
install -m 0755 "$work/initrd.img-$NEW" "/boot/initrd.img-$NEW"
47+
48+
if ! grep -q "elementary-$SLUG-trial" "$cfg"; then
49+
python3 - "$cfg" "$WORKING_SLUG" "$SLUG" "$WORKING" "$NEW" <<'PY'
50+
import re, sys
51+
p, ws, ns, wv, nv = sys.argv[1:]
52+
t = open(p).read()
53+
m = re.search(r"menuentry '[^']*' --id elementary-" + re.escape(ws) + r"-trial \{.*?\n\}\n", t, re.S)
54+
assert m, 'working trial entry not found'
55+
e = re.sub(r"menuentry '[^']*'", f"menuentry 'elementary OS - TRIAL: Aurora 7.2 {ns.split('-')[-1]}'", m.group(0), count=1)
56+
e = e.replace(f"elementary-{ws}-trial", f"elementary-{ns}-trial").replace(f"/vmlinuz-{ws}", f"/vmlinuz-{ns}").replace(f"initrd.img-{wv}", f"initrd.img-{nv}")
57+
assert ws not in e
58+
open(p, 'w').write(t[:m.end()] + "\n" + e + t[m.end():])
59+
PY
60+
fi
61+
grub-script-check "$cfg"
62+
echo "Staged $NEW (backup $backup). Default unchanged. Boot it once with:"
63+
echo " sudo grub-reboot elementary-$SLUG-trial && sudo reboot"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
# 1) Byte-exact, read-only backup of the Apple boot container (xART lives there) and the two small
3+
# Apple NVMe namespaces. 2) Add a separate wip5 boot entry with apple_sep.xart_guard=0.
4+
# The normal wip5 entry keeps the guard on; wip4 stays the default. Nothing is armed.
5+
# Run: sudo bash ~/.cache/mseries-kernel/wip5/touchid-guard-off.sh
6+
set -euo pipefail
7+
[[ $EUID -eq 0 ]] || { echo 'run with sudo' >&2; exit 1; }
8+
cfg=/boot/grub/custom.cfg
9+
ts=$(date -u +%Y%m%dT%H%M%SZ)
10+
dir=/var/lib/mseries-kernel-tests/xart-backup-$ts
11+
mkdir -p "$dir"; chmod 700 "$dir"
12+
13+
# Step 1: backup. Read-only dd; abort before touching anything if any copy fails to verify.
14+
for dev in nvme0n1p1 nvme0n2 nvme0n3; do
15+
[[ -b /dev/$dev ]] || { echo "missing /dev/$dev" >&2; exit 1; }
16+
dd if=/dev/$dev of="$dir/$dev.img" bs=4M iflag=direct status=none
17+
a=$(sha256sum < "$dir/$dev.img" | cut -c1-64); b=$(sha256sum < /dev/$dev | cut -c1-64)
18+
[[ $a == "$b" ]] || { echo "backup of $dev does not match the device" >&2; exit 1; }
19+
echo "$a $dev.img" >> "$dir/SHA256SUMS"
20+
done
21+
lsblk -o NAME,SIZE,PARTLABEL,PARTUUID /dev/nvme0n1 /dev/nvme0n2 /dev/nvme0n3 > "$dir/layout.txt"
22+
chmod 600 "$dir"/*
23+
echo "backup verified: $dir"; cat "$dir/SHA256SUMS"
24+
25+
# Step 2: guard-off boot entry, copied from the wip5 trial entry.
26+
cp -a "$cfg" "$dir/custom.cfg.before"
27+
if ! grep -q 'elementary-aurora72-wip5-xartguard-off-trial' "$cfg"; then
28+
python3 - "$cfg" <<'PY'
29+
import re, sys
30+
p = sys.argv[1]; t = open(p).read()
31+
m = re.search(r"menuentry '[^']*' --id elementary-aurora72-wip5-trial \{.*?\n\}\n", t, re.S)
32+
assert m, 'wip5 trial entry not found'
33+
e = m.group(0)
34+
e = re.sub(r"menuentry '[^']*'", "menuentry 'elementary OS - TRIAL: Aurora 7.2 wip5, Touch ID (xART guard off)'", e, count=1)
35+
e = e.replace("--id elementary-aurora72-wip5-trial", "--id elementary-aurora72-wip5-xartguard-off-trial")
36+
e, n = re.subn(r"(\n\s*linux /vmlinuz-aurora72-wip5 [^\n]*)", r"\1 apple_sep.xart_guard=0", e, count=1)
37+
assert n == 1
38+
open(p, 'w').write(t[:m.end()] + "\n" + e + t[m.end():])
39+
PY
40+
fi
41+
grub-script-check "$cfg"
42+
echo
43+
echo "Done. To boot the Touch ID entry once:"
44+
echo " sudo grub-reboot elementary-aurora72-wip5-xartguard-off-trial && sudo reboot"
45+
echo "To undo the entry: sudo cp $dir/custom.cfg.before $cfg"

0 commit comments

Comments
 (0)