chore(scripts): remove free disk space checks

The checks guarded a local development disk floor and do not belong in
the shared scripts. The scratch image capacity check in
prepare-air-nir-diagnostic.py is kept because it validates a mounted
image, not the host disk.
This commit is contained in:
bluseliu50 committed 2026-10-19 19:24:32 +08:00
1 parent 7eefa56c29
commit 4e61886d7d
24 files changed
+3 -47

No files matched your search

@@ -31,8 +31,6 @@ def main():
parser.add_argument('--linker',default='ld.lld')
args=parser.parse_args()
out=args.output.resolve(); out.mkdir(parents=True,exist_ok=True)
if shutil.disk_usage(out).free < 5*1024**3+512*1024**2:
raise SystemExit('Keep 5 GiB free plus fixture headroom')
source=Path(__file__).resolve().parent
production=source.parent/'NativeUfs.cpp'
extracted='\n'.join(extract(production.read_text(),name) for name in
-4
View File
@@ -43,8 +43,6 @@ def sha(path):
return hashlib.sha256(path.read_bytes()).hexdigest()
if shutil.disk_usage(ROOT).free < 27 * 1024**3:
raise SystemExit('Require 7 GiB free to preserve the 5-GiB floor')
if run([LLVM, '--version']).stdout.strip() != '23.1.3':
raise SystemExit('This frontend is qualified only with LLVM 23.1.3')
llvm_bin = Path(run([LLVM, '--bindir']).stdout.strip())
@@ -276,7 +274,5 @@ report = dict(llvm_version='23.1.3', llvm_config_sha256=sha(LLVM), executable_sh
metal_pipeline_linked=False, complete_library_support=False,
test_oracle_air_fma_semantics='Explicit fused-FMA interpretation; AIR implementation equivalence remains unqualified')
(OUT / 'report.json').write_text(json.dumps(report, indent=2) + '\n')
if shutil.disk_usage(ROOT).free < 5 * 1024**3:
raise RuntimeError('Disk floor violated')
print('PASS: 240 originals classified, 15 refusal controls; 22 original shaders compiled with verified vertex/resource/fragment outputs and center-perspective inputs + real roundtrip')
print('No GPU execution, complete AIR library support, native iOS compiler or Metal/UI claim')
+1 -2
View File
@@ -20,14 +20,13 @@ def run(cmd,log,timeout):
process=subprocess.Popen([str(v) for v in cmd],stdout=f,stderr=subprocess.STDOUT,env=env)
start=time.monotonic()
while process.poll() is None:
if shutil.disk_usage(ROOT).free<5*1024**3 or time.monotonic()-start>timeout:
if time.monotonic()-start>timeout:
process.terminate()
try:process.wait(timeout=10)
except subprocess.TimeoutExpired:process.kill();process.wait()
raise SystemExit('Native compiler stopped at disk/time bound; see '+log)
time.sleep(1)
if process.returncode:raise SystemExit('Native compiler failed; see '+log)
if shutil.disk_usage(ROOT).free<28*1024**3:raise SystemExit('Require 28 GiB free before native compiler build')
pins=json.loads((ROOT/'scripts/data/adreno-compiler-inputs.json').read_text())
if read(['git','-C',SOURCE,'rev-parse','HEAD'])!=pins['mesa']['commit']:raise SystemExit('Pinned Mesa source differs')
for patch in pins['patches']:
+1 -2
View File
@@ -2,7 +2,6 @@
from pathlib import Path
import os,subprocess,json,shutil
root=Path.cwd()
assert shutil.disk_usage(root).free>=5.2*1024**3
names='SOURCE_CORECRYPTO14 SOURCE_PTHREAD ARM_DT_PLATFORM ARMCPU NATIVE_UFS NATIVE_AES NATIVE_VIRTIO_BLOCK NATIVE_RAM_BLOCK TRUST_CACHE_RUNTIME SOURCE_MOCKFS NATIVE_CS_HASH_CACHE VERIFIED_ROOT_PROBE OWNER_ROOT_AUDIT OWNER_ROOT_TRUST SHENG_PMGR OWNER_CACHE_MOUNT OWNER_CACHE_STARTUP OWNER_BOOT_MANIFEST OWNER_DATA_MOUNT OWNER_UNION_SYSTEMOS DT_PANIC_REGION ZONE_PGZ_ALIGNMENT_PROBE NATIVE_ARCH_TIMER NATIVE_PAN BOOT_PROGRESS NATIVE_LEGACY_DISPLAY NATIVE_ADRENO'.split()
updates={'XNU_'+n:'1' for n in names}
updates.update(XNU_CRYPTO_BOOTSTRAP='prelinked',XNU_OWNER_DATA_VOLUME_UUID='18AB5557-DC2D-469B-8758-855E60F5B0DF',
@@ -13,5 +12,5 @@ updates.update(XNU_CRYPTO_BOOTSTRAP='prelinked',XNU_OWNER_DATA_VOLUME_UUID='18AB
env=dict(os.environ);env.update(updates)
with (root/'build/cpu-desktop/kernel-build.log').open('w') as f:
result=subprocess.run(['bash','scripts/build-xnu-4k-baseline.sh'],env=env,stdout=f,stderr=subprocess.STDOUT,timeout=900)
print('kernel build exit',result.returncode,'free GiB',round(shutil.disk_usage(root).free/1024**3,2))
print('kernel build exit',result.returncode)
if result.returncode:raise SystemExit('KERNEL BUILD FAILED: see build/cpu-desktop/kernel-build.log')
+1 -2
View File
@@ -21,7 +21,7 @@ def run(cmd,log,timeout):
process=subprocess.Popen([str(v) for v in cmd],stdout=f,stderr=subprocess.STDOUT)
start=time.monotonic()
while process.poll() is None:
if shutil.disk_usage(ROOT).free<5*1024**3 or time.monotonic()-start>timeout:
if time.monotonic()-start>timeout:
process.terminate()
try:process.wait(timeout=10)
except subprocess.TimeoutExpired:process.kill();process.wait()
@@ -29,7 +29,6 @@ def run(cmd,log,timeout):
time.sleep(1)
if process.returncode:raise SystemExit('Native dependency build failed; see '+log)
if shutil.disk_usage(ROOT).free<28*1024**3:raise SystemExit('Require 28 GiB free before native dependency build')
if not (SOURCE/'.git').exists():
run(['git','clone','--filter=blob:none','--depth','1','--single-branch','--branch','llvmorg-23.1.3',
'--sparse','https://github.com/llvm/llvm-project.git',SOURCE],'fetch.log',120)
-2
View File
@@ -23,8 +23,6 @@ def main():
args = parser.parse_args()
source, output = args.translator_source.resolve(), args.output.resolve()
(output / 'build-report.json').unlink(missing_ok=True)
if shutil.disk_usage(ROOT).free < 7 * 1024**3:
raise SystemExit('Preserve the 5 GiB floor and 2 GiB build allowance')
revision = subprocess.check_output(['git', '-C', str(source), 'rev-parse', 'HEAD'], text=True).strip()
if revision != PIN:
raise SystemExit('Translator revision differs from the qualified source pin')
-2
View File
@@ -17,8 +17,6 @@ SOURCE = ROOT / '.cache/gpu-reference/metal2vulkan'
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--target', choices=['ios', 'host'], default='ios')
args = parser.parse_args()
if shutil.disk_usage(ROOT).free < 7 * 1024**3:
raise SystemExit('Preserve the 5 GiB floor and 2 GiB build allowance')
if subprocess.check_output(['git', '-C', str(SOURCE), 'rev-parse', 'HEAD'], text=True).strip() != PIN:
raise SystemExit('Translator revision differs from the qualified source pin')
if subprocess.check_output(['git', '-C', str(SOURCE), 'diff', 'HEAD', '--'], text=True):
-2
View File
@@ -16,8 +16,6 @@ source = ROOT / '.cache/firmware/target-volumes/044-76040-038.dmg'
volume = ROOT / '.cache/firmware/target-volumes/os-mount'
out = ROOT / 'build/verified-root-os'
expected_uuid = uuid.UUID('04769D26-2CA0-4825-B443-E2E5F88300F2')
if shutil.disk_usage(ROOT).free < 5 * 1024**3 + 256 * 1024**2:
raise SystemExit('Preserve the 5 GiB free-space floor before producing hash metadata')
if not source.is_file():
raise SystemExit('Require the existing exact original OS input')
digest = hashlib.sha256()
-2
View File
@@ -26,8 +26,6 @@ def read(cmd):
return subprocess.check_output([str(c) for c in cmd], text=True).strip()
if shutil.disk_usage(ROOT).free < 8 * 1024**3:
sys.exit('Require 8 GiB free before the Turnip build to preserve the 5-GiB floor')
pins = json.loads((ROOT / 'scripts/data/adreno-compiler-inputs.json').read_text())
if read(['git', '-C', SOURCE, 'rev-parse', 'HEAD']) != pins['mesa']['commit']:
sys.exit('Pinned Mesa source differs')
-5
View File
@@ -2,11 +2,6 @@
set -euo pipefail
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
cd "$ROOT"
python3 - <<'PY'
import shutil
if shutil.disk_usage('.').free < 5 * 1024**3:
raise SystemExit('Less than 5 GiB free; refuse to start a kernel build')
PY
if [ ! -d refer/xnu/.git ]; then
git clone --depth 1 --branch xnu-10063.141.1 https://github.com/apple-oss-distributions/xnu.git refer/xnu
fi
-1
View File
@@ -28,7 +28,6 @@ out = args.output.resolve()
out.mkdir(parents=True, exist_ok=True)
(out/'report.json').unlink(missing_ok=True)
assert platform.system() == 'Darwin' and platform.machine() == 'arm64', 'Darwin ARM64 host required for the actual argument ABI'
assert shutil.disk_usage(ROOT).free >= 5 * 1024**3, 'Disk floor'
def run(cmd, **kw):
@@ -74,7 +74,6 @@ def main():
require('PASS:' in (BASE/'trust-refusal.log').read_text(), 'Missing changed-cache refusal')
require(all(r['refused'] and r['stale_report_removed'] for r in load(BASE/'package-refusals.json')),
'Package refusal failed')
require(shutil.disk_usage(ROOT).free>=5*1024**3, 'Free space below floor')
extended=load(BASE/'original-trust-180/gdb-stop.json')
require(extended['kernel_sha256']==release['candidate_sha256'] and
extended['trust_cache_bundle_sha256']==TRUST, 'Wrong extended observation')
-1
View File
@@ -153,7 +153,6 @@ def main():
log_pass('publication/renderer.log', 'draws all 28 expected lines')
gates.append('single-screen diagnostic capacity and actual ARM64 renderer')
require(shutil.disk_usage(ROOT).free >= 5*1024**3, 'Free space below user floor')
report = dict(scope='Offline prerequisites for the frozen UFS diagnostic boot only',
offline_preparation_complete=True, required_offline_items_remaining=[],
device_action_authorized=False, user_hold_active=True, hardware_success=False,
-1
View File
@@ -98,7 +98,6 @@ def main():
changes[0]['key'] == 'random-seed' and
len(bytes.fromhex(changes[0]['old'])) == len(bytes.fromhex(changes[0]['new'])) == 64,
'Unexpected ADT difference')
require(shutil.disk_usage(ROOT).free >= 5*1024**3, 'Free space below 5 GiB')
result = dict(offline_preparation_complete=True, required_offline_items_remaining=[],
release_sha256=sha(BASE/'release.json'), checker_sha256=sha(Path(__file__)),
native_ufs_commit=release['native_ufs_commit'], image_sha256=release['image_sha256'],
-2
View File
@@ -29,8 +29,6 @@ with zipfile.ZipFile(args.ipsw) as archive:
destination = out / Path(member).name
if destination.exists():
raise SystemExit(f'Input already exists; inspect its saved hash before replacing: {destination.name}')
if shutil.disk_usage(out).free - entry.file_size < 25 * 1024 ** 3:
raise SystemExit('Extraction would leave less than 5 GiB free')
temporary = destination.with_suffix('.partial')
digest = hashlib.sha256()
count = 0
-2
View File
@@ -32,8 +32,6 @@ def inspect(path, extract=False, output=Path('.cache/firmware')):
for kind in ('KernelCache', 'DeviceTree', 'RestoreRamDisk', 'OS')}
needed = sum(archive.getinfo(names[k]).file_size
for k in ('KernelCache', 'DeviceTree'))
if extract and shutil.disk_usage('.').free - needed < 5 * 1024**3:
raise OSError('Extraction would leave less than 5 GiB free')
for kind, name in names.items():
entry = {'member': name, 'size': archive.getinfo(name).file_size}
if kind in ('KernelCache', 'DeviceTree'):
-2
View File
@@ -57,8 +57,6 @@ if not SEED.exists():
raise SystemExit(f'Missing Data seed: {SEED}')
if args.output.exists():
raise SystemExit(f'Refuse to overwrite the existing fixture: {args.output}')
if shutil.disk_usage(ROOT).free < 5 * 1024**3 + SEED.stat().st_size:
raise SystemExit('Preserve 5 GiB free')
args.output.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(SEED, args.output)
mount = args.output.parent / (args.output.stem + '-mount')
-2
View File
@@ -18,8 +18,6 @@ fixture = args.output.resolve()
image = fixture / 'owner-data-32.cdr'
if image.exists():
raise SystemExit('Refuse to overwrite an existing Data seed')
if shutil.disk_usage(ROOT).free < 5 * 1024**3 + 32 * 1024**2:
raise SystemExit('Preserve 5 GiB free')
source = ROOT / '.cache/firmware/target-volumes/os-mount'
if hashlib.sha256((source / 'sbin/launchd').read_bytes()).hexdigest() != '8cec9a3c44a443b08e977ccc5d577850316ad428c575dc01f09b018dbd5b6a25':
raise SystemExit('Require the unchanged supplied original OS mount')
-1
View File
@@ -6,7 +6,6 @@ ROOT=Path(__file__).resolve().parents[1]
p=argparse.ArgumentParser(description=__doc__);p.add_argument('--missing-base',action='store_true');p.add_argument('--default-off',action='store_true');a=p.parse_args()
if a.missing_base and a.default_off:p.error('Select one independent control')
if subprocess.run(['pgrep','-f','qemu-system-aarch64'],capture_output=True).returncode==0:raise SystemExit('Another QEMU is running')
if shutil.disk_usage(ROOT).free<5*1024**3+256*1024**2:raise SystemExit('Preserve 5 GiB free')
base=ROOT/'build/native-prelink/native-owner-accelerator-abi-candidate';fixture=ROOT/'build'/('darwinboot-owner-hvf-accelerator-abi'+('-missing-base' if a.missing_base else '-default-off' if a.default_off else ''))
if (fixture/'gdb-stop.json').exists():raise SystemExit('Preserve the existing observation before another run')
build=json.loads((ROOT/'build/native-offline-accelerator/build-report.json').read_text())
-2
View File
@@ -111,8 +111,6 @@ def main():
output = args.output.resolve()
if output.exists():
raise SystemExit('Use a fresh output directory; never reuse an earlier success report')
if shutil.disk_usage(ROOT).free < 6 * 1024**3:
raise SystemExit('Preserve 5 GiB free plus the bounded output allowance')
build = json.loads((args.compiler_build / 'build-report.json').read_text())
binary = Path(build['binary'])
if build['translator_revision'] != SOURCE_PIN or sha(binary) != build['binary_sha256'] or \
-1
View File
@@ -6,7 +6,6 @@ ROOT=Path(__file__).resolve().parents[1]
p=argparse.ArgumentParser(description=__doc__);p.add_argument('--missing-base',action='store_true');p.add_argument('--default-off',action='store_true');a=p.parse_args()
if a.missing_base and a.default_off:p.error('Select one independent control')
if subprocess.run(['pgrep','-f','qemu-system-aarch64'],capture_output=True).returncode==0:raise SystemExit('Another QEMU is running')
if shutil.disk_usage(ROOT).free<5*1024**3+256*1024**2:raise SystemExit('Preserve 5 GiB free')
base=ROOT/'build/native-prelink/native-owner-original-client-abi-candidate';fixture=ROOT/'build'/('darwinboot-owner-hvf-original-client-abi'+('-missing-base' if a.missing_base else '-default-off' if a.default_off else ''))
if (fixture/'gdb-stop.json').exists():raise SystemExit('Preserve the existing observation before another run')
build=json.loads((ROOT/'build/native-offline-accelerator/build-report.json').read_text())
-1
View File
@@ -7,7 +7,6 @@ p=argparse.ArgumentParser(description=__doc__);p.add_argument('--missing-base',a
if sum((a.missing_base,a.default_off,a.start,a.client_factory,a.descriptor_refusal,a.descriptor_provision,a.descriptor_provision_attached,a.descriptor_provision_attached_only))>1:p.error('Select one independent lifecycle, start, client factory, refusal or descriptor-provision observation')
if not 0<=a.client_type<=0xffffffff or a.client_type!=1 and not (a.client_factory or a.descriptor_refusal or a.descriptor_provision or a.descriptor_provision_attached or a.descriptor_provision_attached_only):p.error('Actual uint32 open type requires the client-factory instrument')
if subprocess.run(['pgrep','-f','qemu-system-aarch64'],capture_output=True).returncode==0:raise SystemExit('Another QEMU is running')
if shutil.disk_usage(ROOT).free<5*1024**3+256*1024**2:raise SystemExit('Preserve 5 GiB free')
base=a.candidate_base.resolve();fixture=ROOT/'build'/(('darwinboot-owner-hvf-original-descriptor-provision-attached-only-'+hex(a.client_type) if a.descriptor_provision_attached_only else 'darwinboot-owner-hvf-original-descriptor-provision-attached-'+hex(a.client_type) if a.descriptor_provision_attached else 'darwinboot-owner-hvf-original-descriptor-provision-'+hex(a.client_type) if a.descriptor_provision else 'darwinboot-owner-hvf-original-client-descriptor-refusal-'+hex(a.client_type) if a.descriptor_refusal else 'darwinboot-owner-hvf-original-client-factory-'+hex(a.client_type) if a.client_factory else 'darwinboot-owner-hvf-original-provider-start' if a.start else 'darwinboot-owner-hvf-original-provider-abi')+('-missing-base' if a.missing_base else '-default-off' if a.default_off else ''))
if (fixture/'gdb-stop.json').exists():raise SystemExit('Preserve the existing observation before another run')
build=json.loads((ROOT/'build/native-original-provider/build-report.json').read_text())
-1
View File
@@ -6,7 +6,6 @@ ROOT=Path(__file__).resolve().parents[1]
p=argparse.ArgumentParser(description=__doc__);a=p.parse_args()
def sha(path):return hashlib.sha256(path.read_bytes()).hexdigest()
if subprocess.run(['pgrep','-f','qemu-system-aarch64'],capture_output=True).returncode==0:raise SystemExit('Another QEMU is running')
if shutil.disk_usage(ROOT).free<5*1024**3+256*1024**2:raise SystemExit('Preserve 5 GiB free before allocating this fixture')
kind='offline-sandbox-extension';out=ROOT/'build'/kind
fixture=ROOT/'build'/('darwinboot-owner-hvf-'+kind)
if (fixture/'gdb-stop.json').exists():raise SystemExit('Preserve the existing observation before another run')
-4
View File
@@ -265,8 +265,6 @@ if args.capture_scratch_data:
parser.error('Scratch Data capture requires exact native pointers and a bounded ESP input')
if (fixture / 'scratch-data-snapshot.apfs').exists():
parser.error('Preserve the existing scratch Data snapshot before another capture')
if shutil.disk_usage(fixture).free < 5 * 1024**3 + expected:
parser.error('Preserve 5 GiB free before exporting Data')
data_capture = base_symbol, size_symbol, expected
block_input = None
if args.missing_virtio_device and not (args.virtio_block_image or args.virtio_udif_image):
@@ -1678,8 +1676,6 @@ with (fixture / 'gdb-stderr.log').open('w') as errors:
base, size = data_word(base_symbol), data_word(size_symbol)
if size != expected or base & 4095 or not 0xfffffff000000000 <= base < (1 << 64) - size:
raise ValueError('Actual native Data range differs from the bounded input')
if shutil.disk_usage(fixture).free < 5 * 1024**3 + size:
raise ValueError('Preserve 5 GiB free before exporting Data')
destination = fixture / 'scratch-data-snapshot.apfs'
digest = hashlib.sha256()
with destination.open('xb') as output: