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
2 changes: 1 addition & 1 deletion cli
Submodule cli updated 45 files
+3 −2 NOTICE
+5 −5 pyproject.toml
+90 −0 src/orchard_cli/apple/device.py
+2 −1 src/orchard_cli/apple/ipsw.py
+83 −0 src/orchard_cli/apple/kernelcache.py
+0 −0 src/orchard_cli/apple/smartio.py
+396 −0 src/orchard_cli/apple/z2fw.py
+24 −36 src/orchard_cli/build.py
+5 −4 src/orchard_cli/command.py
+10 −2 src/orchard_cli/contracts.py
+29 −21 src/orchard_cli/devices.py
+87 −0 src/orchard_cli/firmware.py
+0 −1 src/orchard_cli/j71b/__init__.py
+0 −78 src/orchard_cli/j71b/adapter.py
+0 −11 src/orchard_cli/j71b/config.py
+0 −53 src/orchard_cli/j71b/inputs.py
+0 −19 src/orchard_cli/j71b/mixin.py
+0 −90 src/orchard_cli/j71b/prepare.py
+0 −234 src/orchard_cli/j71b/touch.py
+29 −9 src/orchard_cli/kernel.py
+2 −5 src/orchard_cli/launch.py
+5 −0 src/orchard_cli/manifests.py
+3 −1 src/orchard_cli/ram.py
+178 −0 src/orchard_cli/recipe.py
+31 −3 src/orchard_cli/releases.py
+26 −5 src/orchard_cli/service.py
+0 −83 src/orchard_cli/staging.py
+53 −0 tests/hardware_layout.py
+41 −45 tests/test_adapter_contract.py
+12 −8 tests/test_binary_codecs.py
+9 −6 tests/test_build_config.py
+47 −19 tests/test_host_workflow.py
+7 −5 tests/test_kernel_sdk.py
+3 −3 tests/test_launch.py
+40 −0 tests/test_launcher_selection.py
+1 −1 tests/test_manifests.py
+9 −7 tests/test_package_boundaries.py
+3 −1 tests/test_ram.py
+81 −0 tests/test_recipe.py
+4 −2 tests/test_runtime.py
+27 −59 tests/test_shared_build_cache.py
+6 −8 tests/test_sources.py
+0 −42 tests/test_staging.py
+257 −0 tests/test_z2fw.py
+4 −2 tests/typecheck_adapter.py
2 changes: 1 addition & 1 deletion hardware
6 changes: 2 additions & 4 deletions image/j71b/image_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def ready(*, ssh_revoked=False):


def validate_root(root, release):
for helper in ('usr/lib/systemd/systemd', 'usr/libexec/j71b-check-platform',
'usr/libexec/j71b-charge-lease', 'usr/libexec/omarchy-diagnostics'):
for helper in ('usr/lib/systemd/systemd', 'usr/libexec/omarchy-diagnostics'):
if not os.access(root / helper, os.X_OK):
raise ValueError('Missing executable: ' + helper)
root_release = json.loads((root / 'etc/orchard/release.json').read_text())
Expand All @@ -46,8 +45,7 @@ def validate_root(root, release):


def validate_handoff(root):
for helper in ('usr/lib/systemd/systemd', 'usr/libexec/j71b-check-platform',
'usr/libexec/j71b-charge-lease', 'usr/libexec/omarchy-diagnostics'):
for helper in ('usr/lib/systemd/systemd', 'usr/libexec/omarchy-diagnostics'):
if not os.access(root / helper, os.X_OK):
raise ValueError('Handoff executable missing: ' + helper)

Expand Down
4 changes: 2 additions & 2 deletions release/j71b/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def audit(manifest):
names, ancestors, directories = set(), set(), set()
desktop = public = privileges = cursor = bluetooth = labwc = None
recipe = json.loads(firmware_path('j71b').read_text())
private = {item['destination'] for item in recipe['files'] + recipe['generated']}
private = {item['destination'] for item in recipe['outputs']}
with subprocess.Popen(['zstd', '-d', '-q', '-c', str(paths['root'])], stdout=subprocess.PIPE) as decoder:
with tarfile.open(fileobj=decoder.stdout, mode='r|') as archive:
for member in archive:
Expand Down Expand Up @@ -141,7 +141,7 @@ def audit(manifest):
verify_labwc(labwc, hashes, modes, owners, groups)
if 'home/tablet/.local/share/omarchy-ipad/shell/bluetooth-pairing/shell.qml' not in desktop:
raise ValueError('Pairing UI is absent from desktop integrity manifest')
for name in ('j71b-check-platform', 'j71b-charge-lease', 'omarchy-diagnostics', 'omarchy-desktop-ready', 'omarchy-wtype', 'omarchy-screen-toggle', 'omarchy-bluetooth-pair'):
for name in ('omarchy-diagnostics', 'omarchy-desktop-ready', 'omarchy-wtype', 'omarchy-screen-toggle', 'omarchy-bluetooth-pair'):
if modes.get('usr/libexec/' + name) != 0o755:
raise ValueError('Required helper is not executable: ' + name)
if links.get('lib') != (True, 'usr/lib') or owners.get('home/tablet') != 1000 or sizes.get('etc/machine-id') != 0:
Expand Down
4 changes: 2 additions & 2 deletions release/j71b/public_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def add_parents(name):
member = tarfile.TarInfo(name)
member.mode, member.size = mode, len(data)
add(member, data)
for unit in ('j71b-charge.service', 'omarchy-diagnostics.service'):
for unit in ('omarchy-diagnostics.service',):
member = tarfile.TarInfo('etc/systemd/system/multi-user.target.wants/' + unit)
member.type, member.linkname, member.mode = tarfile.SYMTYPE, '/usr/lib/systemd/system/' + unit, 0o777
if member.name not in seen:
Expand All @@ -231,7 +231,7 @@ def add_parents(name):
if compressor.wait():
raise ValueError('Public root compression failed')
required = {'lib', 'usr/lib/systemd/systemd', 'etc/group', 'etc/gshadow', qml_path,
'arch-ipad-ui-manifest.json', 'usr/libexec/j71b-check-platform', 'usr/libexec/omarchy-diagnostics'}
'arch-ipad-ui-manifest.json', 'usr/libexec/omarchy-diagnostics'}
if not required <= seen or not privileges.keys() <= seen or not replacements.keys() <= seen:
raise ValueError('Incomplete public root or privileged package metadata')
receipt = {'schema': 1, 'kind': 'rootfs', 'profile': 'j71b', 'release': release,
Expand Down
2 changes: 1 addition & 1 deletion release/j71b/recovery_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def audit_runtime(image, root_spec, release):
part = next(row for row in receipt['components'] if row['name'] == 'initramfs')
hashes, modes, records = {}, {}, {}
firmware = json.loads(firmware_path('j71b').read_text())
private = {row['destination'] for row in firmware['files'] + firmware['generated']}
private = {row['destination'] for row in firmware['outputs']}
names = set()
with image.open('rb') as raw:
raw.seek(part['offset'])
Expand Down
2 changes: 1 addition & 1 deletion release/manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def write(output, version, root):
document = ('schema = 1\nkind = "orchard.install"\ndistro = "omarchy-a"\n'
'name = "Omarchy A"\nversion = ' + json.dumps(version) + '\n'
'device = "j71b"\nboot_method = "checkm8-pongo"\n'
'min_orchard = "0.1.10"\nprotocol = 1\n\n'
'min_orchard = "0.1.11"\nprotocol = 1\n\n'
'[install]\ndefault_root = "/omarchy"\n')
for role, name in (('root', 'rootfs.tar.zst'), ('boot', 'recovery.bin'), ('pongo', 'pongo.bin')):
item = receipt(output / name)
Expand Down
2 changes: 1 addition & 1 deletion requirements-build.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Install the local wheel until public package distribution is published.
orchard-hardware>=0.1.10,<0.2
orchard-hardware>=0.1.11,<0.2

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions system/j71b/overlay/usr/lib/systemd/system/j71b-charge.service

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions tests/test_device_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def exercise(self, *, corrupt=False, existing=True, unexpected_link=False, bad_s
('etc/omarchy/package-privileges.json', 'file', json.dumps(privileges).encode()),
('lib', 'symlink', 'usr/lib'),
('usr/lib/systemd/systemd', 'file', b'executable'),
('usr/libexec/j71b-check-platform', 'file', b'executable'),
('usr/libexec/j71b-charge-lease', 'file', b'executable'),
('usr/libexec/omarchy-diagnostics', 'file', b'executable'),
('etc/orchard/release.json', 'file', b'{"release":"1.0"}'),
])
Expand Down
6 changes: 3 additions & 3 deletions tests/test_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_static_diagnostics_authenticates_with_stock_arch_nss(self):
result = subprocess.run(['podman', 'run', '--rm', '--network', 'none', '--cap-add', 'NET_ADMIN',
'--userns', 'keep-id:uid=0,gid=0', '-v', str(tools) + ':/probe:ro',
'-v', str(staged) + ':/runtime:ro',
'-v', str(HARDWARE / 'boot/initramfs/j71b/recovery') + ':/recipe:ro',
'-v', str(HARDWARE / 'boot/initramfs/recovery') + ':/recipe:ro',
image, 'sh', '-c', script], capture_output=True, text=True, timeout=30)
self.assertEqual(result.returncode, 0, result.stderr)

Expand Down Expand Up @@ -235,7 +235,7 @@ def test_public_producer_bakes_parent_directories_and_desktop_updates(self):
patch.object(public_root, 'bluetooth_files', return_value={}), \
patch.object(public_root, 'labwc_files', return_value={}), \
patch.object(public_root, 'runtime_files', return_value=('test', {
'usr/libexec/j71b-check-platform': (b'platform', 0o755)})):
'usr/bin/orchard-device': (b'device', 0o755)})):
result = public_root.build(base, receipt, root, dropbear, root / 'release', 'test', root / 'cursor-tools')
raw = subprocess.check_output(['zstd', '-dq', '-c', str(root / 'release/rootfs.tar.zst')])
with tarfile.open(fileobj=io.BytesIO(raw)) as bundle:
Expand Down Expand Up @@ -340,7 +340,7 @@ def test_recovery_adt_endpoint_owns_size_and_exact_binary_selection(self):
table.write_text('dev: size erasesize name\nmtd3: 00000004 00000001 "adt"\n')
(root / 'mtd3').write_bytes(b'\x00\xff\r\n')
env = {**os.environ, 'ADT_MTD_TABLE': str(table), 'ADT_MTD_DEV': str(root)}
endpoint = HARDWARE / 'boot/initramfs/j71b/recovery/capture-adt'
endpoint = HARDWARE / 'boot/initramfs/recovery/capture-adt'
size = subprocess.check_output(['sh', str(endpoint), '--size'], env=env)
self.assertEqual(int(size.strip(), 16), 4)
self.assertEqual(subprocess.check_output(['sh', str(endpoint)], env=env), b'\x00\xff\r\n')
Expand Down
4 changes: 2 additions & 2 deletions tests/test_manifests_and_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_single_target_manifest_and_index_pin_exact_bytes(self):
self.assertEqual(doc['device'], 'j71b')
self.assertEqual(doc['install']['default_root'], '/omarchy')
self.assertEqual(doc['root']['sha256'], hashlib.sha256(b'rootfs.tar.zst').hexdigest())
self.assertEqual(doc['min_orchard'], '0.1.10')
self.assertEqual(doc['min_orchard'], '0.1.11')
self.assertEqual(manifests.read_release(path)['assets']['recovery'], doc['boot'])
with self.assertRaises(FileExistsError):
manifests.write(output, 'test-1', root)
Expand Down Expand Up @@ -101,7 +101,7 @@ def test_actual_recovery_root_lock_and_public_hashes_are_checked(self):

def test_public_recovery_cannot_contain_firmware_or_session_credentials(self):
recipe = json.loads(firmware_path('j71b').read_text())
for name in (recipe['files'][0]['destination'], 'run/recovery/ssh_host_ed25519_key'):
for name in (recipe['outputs'][0]['destination'], 'run/recovery/ssh_host_ed25519_key'):
with self.subTest(name=name), self.assertRaises(ValueError):
self.exercise(private_file=name)

Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading