Bug 14129 - wic: wrong rootfs file owner when using --exclude-path
Summary: wic: wrong rootfs file owner when using --exclude-path
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 3.2
Hardware: All Multiple
: High major
Target Milestone: 3.3 M2
Assignee: Paul Barker
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-11-18 11:26 UTC by Bartłomiej Burdukiewicz
Modified: 2021-01-21 16:06 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
example wks file with --exclude-path parameter (105 bytes, application/vnd.lotus-1-2-3)
2020-11-18 11:26 UTC, Bartłomiej Burdukiewicz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bartłomiej Burdukiewicz 2020-11-18 11:26:38 UTC
Created attachment 4749 [details]
example wks file with --exclude-path parameter

After using additional switch "--exclude-path" in wks file, a whole rootfs becomes owned by local user (1000:1000).

Affected version poky@5232b03e22a49c368fbf4d79e05519ad5e48db4a
Working as expected: poky@6bf90676038a7a6111bbfeaef2f73614c7206b9e
Comment 1 Erik Botö 2020-12-09 14:24:32 UTC
Seems like there's a few cases where in scripts/lib/wic/plugins/source/rootfs.py where a copy of the rootfs is created so that modifications can be done before creating the partitions, this happens if --exclude-path, --include_path or --change-directory is used. 

This temporary directory is created under ${WORKDIR}/build-wic, and since and since meta/classes/image_types_wic.bbclass has the line:

PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/build-wic"

it will not use pseudo and the resulting file permissions will not be correct.

If I remove ${WORKDIR}/build-wic from PSEUDO_IGNORE_PATHS, the permissions seems ok even when using --exclude-path, but I'm not sure if there's any unwanted side-effects of doing this. If so, maybe it's better to create the the temporary rootfs in some other directory, not in PSEUDO_IGNORE_PATHS.
Comment 2 Erik Botö 2020-12-10 10:29:23 UTC
Seems like I ran into problems later, with pseudo aborting with a link to "https://wiki.yoctoproject.org/wiki/Pseudo_Abort".

Looking at pseudo.log it seems like the partition files created in build-wic/ caused the problem.
Comment 3 Anuj Mittal 2021-01-08 01:12:40 UTC
This would need fixing in gatesgarth as well ...