feat(image): bake easytier mesh binaries and service into rootfs export
Offline project checks / check (push) Canceled after 0s

This commit is contained in:
shenlei
2026-11-10 09:57:58 +09:00
parent 139bb1fc21
commit 225ad54930
3 changed files with 19 additions and 2 deletions
+17
View File
@@ -125,6 +125,23 @@ def main():
archive.seek(0)
subprocess.run(PMB + ['chroot', '--image', '--', 'tar', '-xf', '-', '-C', '/',
'--no-same-owner'], cwd=ROOT, stdin=archive, check=True)
# Install standalone EasyTier mesh networking binaries if available on host
for bin_dir in (Path('/opt/easytier'), ROOT / 'vendor/bin/aarch64', ROOT / 'tools/bin/aarch64'):
if (bin_dir / 'easytier-core').is_file():
with tempfile.TemporaryFile() as bin_archive:
with tarfile.open(fileobj=bin_archive, mode='w') as bstream:
for bname in ('easytier-core', 'easytier-cli'):
bpath = bin_dir / bname
if bpath.is_file():
tinfo = tarfile.TarInfo(name=f'usr/local/bin/{bname}')
tinfo.size = bpath.stat().st_size
tinfo.mode = 0o755
with bpath.open('rb') as bf:
bstream.addfile(tinfo, bf)
bin_archive.seek(0)
subprocess.run(PMB + ['chroot', '--image', '--', 'tar', '-xf', '-', '-C', '/',
'--no-same-owner'], cwd=ROOT, stdin=bin_archive, check=True)
break
record('hardening-and-auditing-image')
# Each pmbootstrap chroot entry restores build DNS/repositories. Configure
# and audit in one entry, then export without entering the image again.