"""Build a subtractive OpenDisc 07.10 copy with the ready pycdlib writer. SPDX-License-Identifier: GPL-2.0-or-later SVITS modifications, 22 October 2026. No upstream endorsement. Run with .venv/bin/python. Each invocation preserves a separate evidence run. The original ISO, original installers, source and notices are never overwritten. """ from pathlib import Path from datetime import datetime, timezone from html.parser import HTMLParser from urllib.parse import unquote, urlsplit import base64 import hashlib import io import json import re import shutil import tarfile import pycdlib ROOT = Path(__file__).resolve().parents[1] EVIDENCE = ROOT / 'docs/research/virtual-media-2026-10-21/opendisc0710-cleaned-2026-10-22' ORIGINAL = Path('/tmp/svits-opendisc-original-20261021/OpenDisc-07.10.iso') ORIGINAL_SHA = '48fb81954f8e861cccb238d642d74d3b9ffed14b619ea00981e5f9604327f04c' SOURCE_7ZIP = Path('/tmp/svits-opendisc0710-cleaned-20261022/run_2026-10-22T22-25-08.444Z/7zip442-source') SOURCE_7ZIP_SHA = '37873abcc6edbfabab2507146f89087ae35c167653817f58cf72c95f04ae9fd2' EXPECTED_ORIGINAL = { '/programs/7zip/setup.exe': 'd950e6b9a1feab64bf9004355d43b58c90a396a1a54374341eba33592b3e5ee6', '/programs/tightvnc/setup.exe': 'be792b2f7013317c5aad3fe2ee7f46edc43077c015960e37dc576f004ef01d6e', '/coverart/cover-front.png': '530dd92aeb607715a028d87f291d7d20d7262f84ccb45683fd9ff3413aef7f0b', '/coverart/cover-back.png': 'db628fdcd0ea2ca481abc3643510eb40fb1b9ba41e3e34af03d5536ff8de0ce6', '/coverart/disc-label.png': '44461485f15b95a5590fd23f75ecfd217e88543afdae50f25571448a510dbcf8', } TITLE = 'OpenDisc 07.10 - cleaned Windows copy r1' def sha(path): digest = hashlib.sha256() with path.open('rb') as stream: for block in iter(lambda: stream.read(1024 * 1024), b''): digest.update(block) return digest.hexdigest() def write_json(path, value): path.parent.mkdir(parents=True, exist_ok=True) path.write_text(json.dumps(value, indent=2, ensure_ascii=False) + '\n', encoding='utf8') def verified_copy(source, target, expected): if sha(source) != expected: raise ValueError('Source identity mismatch: ' + str(source)) target.parent.mkdir(parents=True, exist_ok=True) if target.exists(): raise ValueError('Refusing to overwrite: ' + str(target)) shutil.copy2(source, target) def windows_text(path, body): path.parent.mkdir(parents=True, exist_ok=True) path.write_bytes(body.replace('\r\n', '\n').replace('\n', '\r\n').encode('ascii')) def removal_reason(path): if path.startswith('/programs/notepad2/'): return 'Removed in this revision: exact EXE imports MSVCR70.DLL, absent from original installer; not a redistribution prohibition.' if path.startswith('/programs/truecrypt/'): return 'Removed entire component: additional defence/indemnity conditions not accepted for this derivative.' if path.startswith('/programs/'): return 'Removed entire component in this revision: exact nested source/runtime/data mapping not closed; no general prohibition is asserted.' if path.startswith('/bin/') or path in ['/start.exe', '/start.ini', '/start.bmp', '/autorun.inf']: return 'Removed original compiled launcher/autorun; exact Gecko/helper source mapping not closed. Replaced by a plain local HTML menu.' return 'Removed original supplementary/menu content outside the retained reviewed subset; original remains archived separately.' def menu(): return ''' OpenDisc 07.10 - cleaned Windows copy r1

OpenDisc 07.10

Cleaned Windows copy r1 - two retained applications.
Modified by SVITS, 22 October 2026. This is not an official OpenDisc release.

The retained installers are unchanged bytes from the original 2007 disc. The other 37 applications and the original compiled launcher were removed. This does not declare other free software prohibited. Read the changes.

7-Zip 4.42

File archiver. The original package supports Windows 2000.

Open original 7-Zip installer

Corresponding source
License and copyright · unRAR terms

TightVNC 1.3.9

Remote desktop viewer and server. Choose the installer components you want; no server is enabled by this menu.

Open original TightVNC installer

Corresponding source
License and copyright · External build SDK note

Unchanged historical OpenDisc cover

Sources, notices and provenance

Full matching source archives, build instructions and original notices are on this disc; no source download is needed. This software is based in part on the work of the Independent JPEG Group.

All notices and modification summary · Every removed original file · Retained byte identities · Source archive identities

The historical artwork is preserved unchanged, with its original publisher print/use permission. Its old application list describes the original release, not this reduced copy. Use the separate modified-copy label with it. No endorsement by OpenDisc or the application authors is claimed.

If AutoRun is disabled, open README.HTM from the CD in My Computer. Windows may ask before opening an installer. This menu contains no scripts or remote resources. Software is supplied under its original licenses, without warranty. SVITS menu/build modifications: GPL-2.0-or-later.

''' def main(): stamp = datetime.now(timezone.utc).strftime('%Y-%m-%dT%H-%M-%S.%fZ') work = Path('/tmp/svits-opendisc0710-cleaned-20261022') / ('iso_run_' + stamp) tree = work / 'tree' proof_dir = EVIDENCE / ('build_' + stamp) tree.mkdir(parents=True) proof_dir.mkdir(parents=True) if sha(ORIGINAL) != ORIGINAL_SHA: raise ValueError('Unmodified original ISO identity mismatch') original = pycdlib.PyCdlib() original.open(str(ORIGINAL)) retained, deleted = [], [] original_count = 0 for directory, _, names in original.walk(joliet_path='/'): for name in names: path = directory.rstrip('/') + '/' + name original_count += 1 if path in EXPECTED_ORIGINAL: target = tree / path.lstrip('/') target.parent.mkdir(parents=True, exist_ok=True) original.get_file_from_iso(str(target), joliet_path=path) if sha(target) != EXPECTED_ORIGINAL[path]: raise ValueError('Original retained file identity mismatch: ' + path) retained.append({'originalPath': path, 'outputPath': path, 'bytes': target.stat().st_size, 'sha256': sha(target), 'change': 'unchanged'}) else: deleted.append({'originalPath': path, 'bytes': original.get_record(joliet_path=path).data_length, 'reason': removal_reason(path)}) original.close() if {r['originalPath'] for r in retained} != set(EXPECTED_ORIGINAL): raise ValueError('Missing retained original file') source_delivery = json.loads((EVIDENCE / 'tightvnc-source-delivery.json').read_text()) sources = [] for name, source, expected, url in [ ('7z442.tar.bz2', SOURCE_7ZIP, SOURCE_7ZIP_SHA, 'https://sourceforge.net/projects/sevenzip/files/7-Zip/4.42/7z442.tar.bz2/download'), ('tightvnc-1.3.9-source-without-system-sdk.tar.gz', Path(source_delivery['path']), source_delivery['sha256'], 'https://sourceforge.net/projects/vnc-tight/files/TightVNC-win32/1.3.9/')]: target = tree / 'sources' / name verified_copy(source, target, expected) with tarfile.open(target) as archive: regular = [member for member in archive if member.isfile()] sources.append({'filename': name, 'outputPath': '/sources/' + name, 'localSource': str(source), 'bytes': target.stat().st_size, 'sha256': expected, 'archiveFiles': len(regular), 'originURL': url}) if [row['archiveFiles'] for row in sources] != [1279, 628]: raise ValueError('Unexpected corresponding source member count') for component in ['7zip', 'tightvnc', 'opendisc']: shutil.copytree(EVIDENCE / 'notices' / component, tree / 'notices' / component) (tree / 'manifests').mkdir(exist_ok=True) for name in ['source-inventory.json', 'tightvnc-source-delivery.json', 'component-readiness.json', 'pe-imports.json']: shutil.copy2(EVIDENCE / name, tree / 'manifests' / name) shutil.copy2(Path(__file__), tree / 'sources' / 'build-opendisc0710-cleaned.py') windows_text(tree / 'notices/README.txt', TITLE + '\nModified copy by SVITS, 22 October 2026; not an official OpenDisc release.\n\n' 'Derived by subtraction from OpenDisc 07.10, original SHA256: ' + ORIGINAL_SHA + '\n' 'Only the original 7-Zip 4.42 and TightVNC 1.3.9 installers remain; their bytes are unchanged.\n' '7-Zip Copyright (C) 1999-2006 Igor Pavlov; LGPL 2.1 or later and original unRAR terms.\n' 'The unRAR part must not be used to recreate a RAR-compatible compressor; retain its full notice.\n' 'There is no charge for this download or for access to the corresponding source.\n' 'TightVNC is GPL 2 or later. All original copyright, zlib and JPEG notices remain.\n' 'This software is based in part on the work of the Independent JPEG Group.\n' 'Matching source and build/install scripts are supplied in sources on this same disc.\n' 'TightVNC source delivery omits only four external Microsoft HTML Help SDK headers/import libraries.\n' 'All 627 program/dependency/build source files remain unchanged. Read its SOURCE-DELIVERY-NOTE.txt.\n' 'The external system SDK prerequisite is stated in the original BUILDING.txt.\n' 'No Microsoft SDK or extra Microsoft runtime files are distributed here.\n' 'Historical OpenDisc artwork is unchanged and accompanied by the publisher print/use permission.\n' 'The old cover lists applications present on the original release, not on this cleaned copy.\n' 'The separate cleaned-copy label and this notice must accompany the reduced copy.\n' 'OpenDisc is an upstream name; no upstream endorsement is claimed.\n' 'All other programs and the compiled K-Meleon/Gecko launcher are absent.\n' 'This does not assert a general redistribution ban on unreviewed free programs.\n' 'SVITS menu, label and build modifications are GPL-2.0-or-later, without warranty.\n' 'Their preferred source forms are README.HTM, coverart/cleaned-label.svg and the Python builder in sources.\n') windows_text(tree / 'README.txt', TITLE.upper() + '\n\nTHIS IS A MODIFIED COPY, NOT THE OFFICIAL ORIGINAL RELEASE.\n\n' 'Open README.HTM for the local menu, or open an installer in Windows Explorer:\n' ' programs\\7zip\\setup.exe 7-Zip 4.42\n' ' programs\\tightvnc\\setup.exe TightVNC 1.3.9\n\n' 'These two original installers are unchanged. The other 37 programs and the\n' 'original compiled launcher were removed. Nothing starts a VNC server merely\n' 'by opening this menu. Choose components yourself during its original setup.\n\n' 'Full matching source archives are in sources. Full licenses are in notices.\n' 'Every retained/deleted original path and reason is listed in manifests.\n' 'The original 582270976-byte ISO remains separately preserved and unchanged.\n' 'Historical coverart is unchanged. Use it with the separate cleaned-copy label.\n' 'AutoRun depends on normal Windows policy; if disabled, open README.HTM yourself.\n' 'No security policy changes, remote resources, scripts or custom menu executable.\n') windows_text(tree / 'README.HTM', menu()) windows_text(tree / 'autorun.inf', '[autorun]\nshellexecute=README.HTM\nlabel=OpenDisc 07.10 - cleaned r1\n') art = base64.b64encode((tree / 'coverart/cover-front.png').read_bytes()).decode('ascii') label = ('' '' '' '' '' 'MODIFIED COPY / NOT AN OFFICIAL RELEASE' 'OpenDisc 07.10 - cleaned r1' '7-Zip 4.42 / TightVNC 1.3.9' 'Full matching sources and notices included' 'Other 37 applications and original launcher removed' '') (tree / 'coverart/cleaned-label.svg').write_text(label, encoding='utf8') write_json(tree / 'manifests/retained-original-files.json', sorted(retained, key=lambda r: r['originalPath'])) write_json(tree / 'manifests/deleted-original-files.json', sorted(deleted, key=lambda r: r['originalPath'])) write_json(tree / 'manifests/source-payloads.json', sources) class LocalReferences(HTMLParser): def __init__(self): super().__init__() self.paths = [] def handle_starttag(self, tag, attrs): for key, value in attrs: if key in ['href', 'src'] and value: parsed = urlsplit(value) if parsed.scheme or parsed.netloc or value.startswith('/'): raise ValueError('Menu must not load a remote/absolute reference: ' + value) self.paths.append(unquote(parsed.path)) refs = LocalReferences() refs.feed((tree / 'README.HTM').read_text()) for rel in refs.paths: if not (tree / rel).is_file(): raise ValueError('Broken local menu reference: ' + rel) iso = pycdlib.PyCdlib() iso.new(interchange_level=3, joliet=3, rock_ridge='1.09', vol_ident='OD0710_CLEANED') def primary_directory(rel): return '/' + '/'.join(re.sub('[^A-Z0-9_]', '_', part.upper()) for part in rel.split('/')) for directory in sorted((p for p in tree.rglob('*') if p.is_dir()), key=lambda p: (len(p.parts), str(p))): rel = directory.relative_to(tree).as_posix() iso.add_directory(iso_path=primary_directory(rel), joliet_path='/' + rel, rr_name=directory.name) inventory, aliases = [], set() for path in sorted(p for p in tree.rglob('*') if p.is_file()): rel = path.relative_to(tree).as_posix() stem, dot, ext = path.name.rpartition('.') name = re.sub('[^A-Z0-9_]', '_', (stem if dot else ext).upper()) if dot: name += '.' + re.sub('[^A-Z0-9_]', '_', ext.upper()) parent = path.parent.relative_to(tree).as_posix() primary = (primary_directory(parent) if parent != '.' else '') + '/' + name + ';1' if primary in aliases: raise ValueError('ISO primary name collision: ' + primary) aliases.add(primary) iso.add_file(str(path), iso_path=primary, joliet_path='/' + rel, rr_name=path.name) inventory.append({'path': '/' + rel, 'bytes': path.stat().st_size, 'sha256': sha(path), 'isoPath': primary}) temporary = work / 'OpenDisc-07.10-cleaned-windows-r1.iso' iso.write(str(temporary)) iso.close() output_sha = sha(temporary) output = temporary.with_name('OpenDisc-07.10-cleaned-windows-r1-' + output_sha + '.iso') temporary.rename(output) verify = pycdlib.PyCdlib() verify.open(str(output)) actual_paths = set() for directory, _, names in verify.walk(joliet_path='/'): for name in names: actual_paths.add(directory.rstrip('/') + '/' + name) if actual_paths != {row['path'] for row in inventory}: raise ValueError('Unexpected or missing ISO filesystem entries') for row in inventory: for namespace, path in [('joliet_path', row['path']), ('iso_path', row['isoPath'])]: body = io.BytesIO() verify.get_file_from_iso_fp(body, **{namespace: path}) if len(body.getvalue()) != row['bytes'] or hashlib.sha256(body.getvalue()).hexdigest() != row['sha256']: raise ValueError('ISO readback mismatch: ' + row['path'] + ' / ' + namespace) verify.close() if sha(ORIGINAL) != ORIGINAL_SHA: raise ValueError('Original changed during build') chunks = [] with output.open('rb') as stream: offset = 0 for body in iter(lambda: stream.read(256 * 1024), b''): chunks.append({'offset': offset, 'bytes': len(body), 'sha256': hashlib.sha256(body).hexdigest()}) offset += len(body) write_json(proof_dir / 'output-inventory.json', inventory) for filename in ['retained-original-files.json', 'deleted-original-files.json', 'source-payloads.json']: shutil.copy2(tree / 'manifests' / filename, proof_dir / filename) write_json(proof_dir / 'iso-chunks.json', {'bytes': output.stat().st_size, 'sha256': output_sha, 'chunkBytes': 256 * 1024, 'chunks': chunks}) shutil.copy2(tree / 'README.HTM', proof_dir / 'README.HTM') shutil.copy2(tree / 'README.txt', proof_dir / 'disc-README.txt') shutil.copy2(tree / 'coverart/cleaned-label.svg', proof_dir / 'cleaned-label.svg') proof = {'created': stamp, 'status': 'complete-filesystem-readback-passed; native-Windows-and-public-Insert-pending', 'id': 'opendisc-07.10-cleaned-r1', 'title': TITLE, 'original': {'localFile': str(ORIGINAL), 'bytes': ORIGINAL.stat().st_size, 'sha256': ORIGINAL_SHA, 'immutableBeforeAfter': True, 'files': original_count}, 'output': {'localFile': str(output), 'filename': output.name, 'bytes': output.stat().st_size, 'sha256': output_sha, 'volume': 'OD0710_CLEANED', 'files': len(inventory)}, 'applications': ['7-Zip 4.42', 'TightVNC 1.3.9'], 'retainedOriginalFiles': len(retained), 'deletedOriginalFiles': len(deleted), 'removedApplications': 37, 'sourceArchiveBytes': sum(s['bytes'] for s in sources), 'matchingSourceFiles': 1279 + 627, 'readback': {'allFiles': True, 'namespaces': ['ISO9660-primary', 'Joliet'], 'unexpectedFiles': 0, 'allMenuLocalLinksExist': True, 'menuReferences': len(refs.paths)}, 'menu': {'path': '/README.HTM', 'format': 'static HTML4, no JavaScript, no remote resources', 'autorun': 'native shellexecute; actual guest policy/launch still needs checking'}, 'artwork': {'originalCoverBytesUnchanged': True, 'permission': '/notices/opendisc/cover.html', 'modifiedLabel': '/coverart/cleaned-label.svg', 'separateFromOriginalImage': True}, 'localTree': str(tree), 'evidenceDirectory': str(proof_dir), 'tool': 'ready pycdlib; new compact filesystem, no original hidden extents or boot payload', 'boundary': 'No Worker/provider/catalog edit, no VM, no production deployment by this builder.'} write_json(proof_dir / 'ready-artifact.json', proof) print(json.dumps(proof, indent=2)) if __name__ == '__main__': main()