Fix candidate build metadata and runtime safeguards
Offline project checks / check (push) Canceled after 0s
Offline project checks / check (push) Canceled after 0s
Repair kernel patch formatting and refresh kernel/camera package revisions and checksums. Integrate battery guard into generated images, correct charging controls and emergency shutdown handling, and reject invalid camera authentication configuration. Extend recipe validation and regression coverage, and update build and installation documentation. Kernel, camera and image compilation remain pending on the build server.
This commit is contained in:
+10
-2
@@ -17,6 +17,7 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
RECIPES = ('device-xiaomi-platina', 'firmware-xiaomi-platina', 'linux-postmarketos-qcom-sdm660')
|
||||
ARCHIVES = {'linux-v6.19.10-sdm660.tar.gz',
|
||||
'linux-dd1ed52c8ceef4f16715118ed0252fe75adbe71d.tar.gz'}
|
||||
CAMERA_ARCHIVES = {'libcamera-v0.7.1.tar.gz', 'mesa-26.1.6.tar.xz'}
|
||||
|
||||
|
||||
def run(command, **kwargs):
|
||||
@@ -77,9 +78,9 @@ def checksums(recipe):
|
||||
return {name.strip(): value for value, name in rows}
|
||||
|
||||
|
||||
def recipe_checks(directory, external):
|
||||
def recipe_checks(directory, external, packages=RECIPES):
|
||||
# Parse only: never evaluate arbitrary APKBUILD shell code on the host.
|
||||
for name in RECIPES:
|
||||
for name in packages:
|
||||
recipe = directory / name / 'APKBUILD'
|
||||
for filename, expected in checksums(recipe).items():
|
||||
if filename in external:
|
||||
@@ -92,6 +93,11 @@ def recipe_checks(directory, external):
|
||||
install = re.search(r'^install="\$pkgname([^"\n]+)"$', recipe.read_text(), re.M)
|
||||
if install and not (recipe.parent / (name + install[1])).is_file():
|
||||
raise ValueError('Missing package install hook: ' + name)
|
||||
for source in sorted(recipe.parent.glob('*.patch')):
|
||||
result = subprocess.run(['git', 'apply', '--numstat', str(source.resolve())],
|
||||
capture_output=True, text=True)
|
||||
if result.returncode:
|
||||
raise ValueError('Invalid patch format: ' + name + '/' + source.name)
|
||||
|
||||
|
||||
def check():
|
||||
@@ -126,6 +132,8 @@ def check():
|
||||
if digest(branding / 'platina-linux-logo.png') != provenance['sha256']:
|
||||
raise ValueError('Logo changed without updating provenance')
|
||||
data = lock()
|
||||
recipe_checks(ROOT / 'project/camera', CAMERA_ARCHIVES,
|
||||
packages=('libcamera-headless', 'mesa-freedreno'))
|
||||
for profile in data['profiles'].values():
|
||||
recipe_checks(ROOT / profile['ports'], set(data['local_firmware']) | ARCHIVES)
|
||||
for package, field in zip(RECIPES, ('device_package', 'firmware_package', 'kernel_package')):
|
||||
|
||||
Reference in New Issue
Block a user