Bug 14129

Summary: wic: wrong rootfs file owner when using --exclude-path
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Bartłomiej Burdukiewicz <bartlomiej.burdukiewicz>
Component: Scripts and ToolsAssignee: Paul Barker <paul>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: High CC: anuj.mittal, erik.boto, paul, randy.macleod, richard.purdie, ross.burton
Version: 3.2   
Target Milestone: 3.3 M2   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
example wks file with --exclude-path parameter none

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 ...