test/demo: emulate layer-aggregation filesystem + cross-layer dynamic linking (#671) - #673
Conversation
…#671) Add tests/fake-layers/run-fake-layers.sh — models the read-only-layer deployment (/mw + /vendor) from the directory & dynamic-linking spec, rather than a flat sysroot: each layer exposes its modules through aggregation directories (lib/, ld.so.conf.d/) of symlinks, wired via /etc/ld.so.conf.d/ <layer>.conf + ldconfig. The MW layer provides the binder runtime + HAL interface libs; a vendor-layer library links a HAL lib from the MW layer; the test asserts the cross-layer dependency resolves through the ld.so.conf.d aggregation (not rpath / not a flat sysroot). No root/mount needed — emulated in a work dir, validated with ldconfig (registration) + ldd (resolution). Doubles as a demo (prints the layer tree; --keep). Skips cleanly without ldconfig/ldd/compiler. Verified: 4/4 assertions pass (aggregation symlinks, ldconfig registration, cross-layer resolution of libcommon from /vendor into /mw).
There was a problem hiding this comment.
Pull request overview
Adds a new on-demand test/demo to model the real layer-aggregation deployment layout (/mw + /vendor) and validate dynamic-linker wiring in a throwaway rootfs, complementing the existing flat-sysroot fake-yocto test.
Changes:
- Document the new
tests/fake-layers/test/demo intests/README.md, with a link to the directory + dynamic-linking spec. - Add
tests/fake-layers/run-fake-layers.shto stage MW/vendor “modules”, create aggregation symlinks, runldconfig, and check cross-layer library resolution.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/README.md | Adds a new section describing the fake-layers/ test/demo and its intent. |
| tests/fake-layers/run-fake-layers.sh | New script that emulates /mw and /vendor layer trees, wires ld.so.conf.d, runs ldconfig, and asserts aggregation + cross-layer linking behavior. |
…review)
Copilot review:
- vendor lib now links against the MW *aggregation* dir (${MW}/lib) rather than
the module-private ${MW}/halif/lib — the path a real vendor consumes, so it
also proves the aggregation symlinks are usable.
- README: distinguish the two assertions — ldconfig *registers* via the per-layer
ld.so.conf.d (cache), ldd *resolves* against the aggregated lib dirs
(LD_LIBRARY_PATH, since host ldd can't read the work-dir cache). The prior
wording implied ldd used the ld.so.conf.d cache.
|
Copilot review addressed: vendor lib now links via the MW aggregation dir ( |
Closes #671.
Our Yocto test stages the SDK into a flat sysroot. Real deployment uses the layer-aggregation model (spec): independently-mounted
/mwand/vendorlayers, each exposing modules via aggregation dirs (lib/,ld.so.conf.d/) of symlinks, wired for dynamic linking through/etc/ld.so.conf.d/<layer>.conf+ldconfig.What it does
tests/fake-layers/run-fake-layers.sh:/mw/binder,/mw/halif) with aggregation symlinks + per-moduleld.so.conf.d,/etc/ld.so.conf.d/{mw,vendor}.confand runsldconfig,ldconfigregisters the binder+HAL libs via the aggregatedld.so.conf.d; and the vendor lib's MW-provided dependency resolves across layers (nothing "not found").Doubles as a demo (prints the emulated layer tree;
--keepto inspect). No root/mount needed; skips cleanly withoutldconfig/ldd/compiler.Verified
4/4 assertions pass locally (aggregation symlinks,
ldconfigregistration, cross-layer resolution oflibcommonfrom/vendor→/mw).Relates to #672 (per-layer build model) and #662 (per-layer binder).