| Summary: | New santiy check for userspace packages | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Meta-yocto | Reporter: | Mark Hatle <mark.hatle> |
| Component: | meta-yocto | Assignee: | Scott Garman <scott.a.garman> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Low | CC: | jiajun.xu, poky.bs.watcher, poky.watcher, scott.a.garman, sgw, song.liu |
| Version: | unspecified | ||
| Target Milestone: | 1.2 M1 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | (P2)(QA Testing Completed) (Done) | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Mark Hatle
2011-04-26 09:35:51 UTC
Design I'm starting with: Iterate through each file in /bin, /sbin, and /lib of the rootfs, and grep the output of the 'file' command to determine which type the file is. Based on my desktop system, the keywords I'd grep for are: ELF - binary or library Bourne - shell script "POSIX shell" - shell script Then based on this I would grep shell scripts for "usr", and grep the output of ldd of binaries/libraries for "usr". I'd then throw a QA warning. This would be a function I'd add to the default do_package step. I think the general design is correct. But you'll likely want to break this up into a few steps as some are more useful (and time consuming) then others. The critical one for me is the library dependencies.. things installed in /bin or /sbin should not reference libraries in /usr/lib. Similarly libraries in /lib should also not references libraries in /usr/lib. These to me should be an error. For the scripts scanning for specific calls to /usr/... from the items in /bin and /sbin. This is likely the right approach. It's far from fool-proof, but it will help... Design ACK'ed In Poky master and oe-core as of: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=198f2ac06e60245750a2c6561b8c8e2eaa93f6be http://git.openembedded.org/openembedded-core/commit/?id=ed937940f54d1a376b518fc276da78811c4ac50b I tested against latest master with commit cb89d43473a91ff4cb2447d642fcd9308d7366e3, the feature could work and improper link would be reported out by bitbake. |