| Summary: | fixup_perms fails when both /var/run and /var/lock present | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Denys Dmytriyenko <denis> | ||||
| Component: | configuration | Assignee: | Bill Randle <bill.randle> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | Medium+ | CC: | bill.randle, dan.mcgregor, richard.purdie | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 2.1 M4 | ||||||
| Hardware: | x86 | ||||||
| OS: | Multiple | ||||||
| Whiteboard: | |||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||
| Attachments: |
|
||||||
Created attachment 3118 [details]
Proposed patch
When processing links, the directories are processed in unsorted order which can result in cases like /var/lock -> /run/lock handled before /var/run -> /run throwing an error for /var/run because /run already exists. Change the link processing to ensure links are processed in sorted order of the destination.
Seems to resolve the issue for me. The version in master introduces a new problem. The old code would process the permissions table in order, and later entries would override the first entries. This made overriding parts of the permissions file possible.
As an example, putting:
FILESYSTEM_PERMS_TABLES = "files/fs-perms.txt files/fs-perms-override.txt"
into conf/local.conf, where files/fs-perms.txt is the default from openembedded-core and files/fs-perms-override.txt contains:
# Override OE-core:
${localstatedir}/log 0755 root root false - - -
${localstatedir}/tmp 01777 root root false - - -
${sysconfdir}/mtab link /proc/self/mounts
${ROOT_HOME} 0700 root root false - - -
would allow ${localstatedir}/log and ${localstatedir}/tmp to be a real directories.
To demonstrate this, an append on base-files will suffice, so base-files_%.bbappend containing:
volatiles_remove = "log tmp"
dirs755 += "${localstatedir}/log"
dirs1777 += "${localstatedir}/tmp"
produces:
ERROR: base-files-3.0.14-r89 do_package: QA Issue: Fixup Perms: Unable to correct directory link, target already exists: /var/log -> /var/volatile/log [perm-link]
ERROR: base-files-3.0.14-r89 do_package: QA Issue: Fixup Perms: Unable to correct directory link, target already exists: /var/tmp -> /var/volatile/tmp [perm-link]
The same configuration, prior to the version currently in master created /var/log and /var/tmp as real directories.
|
The file meta/files/fs-perms.txt contains this: # Items from base-files # Links ${localstatedir}/run link /run ${localstatedir}/log link volatile/log ${localstatedir}/lock link /run/lock ${localstatedir}/tmp link volatile/tmp Now, when a recipe installs both /var/run and /var/lock, the fixup_perms function of do_package does create /run/lock and symlinks /var/lock into it, but then fails to symlink the actual /var/run into /run with the following error: ERROR: recipename do_package: QA Issue: Fixup Perms: Unable to correct directory link, target already exists: /var/run -> /run [perm-link]