Bug 6638

Summary: mkfs.ext4-native compiles with hardcoded .conf file location that is not valid if a shared sstate feed is used
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Rob Anders <rob.anders>
Component: devtools / tool chainAssignee: Rob Anders <rob.anders>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: Medium CC: meta.mr.watcher, meta.watcher, sgw
Version: 1.6.1   
Target Milestone: 1.8 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Rob Anders 2014-08-20 19:18:44 UTC
mkfs.ext4 compiles in a fixed location for mke2fs.conf using the value of $sysconfdir at build time.  However, if the e2fsprogs package is being shared across multiple build environments using a shared sstate package feed (ie, SSTATE_MIRRORS is set), then this mkfs.ext4 can end up in a completely different build environment, still referencing the absolute path to mke2fs.conf in the original build environment where it was compiled.  This can lead to one of two outcomes:

- If the original mke2fs.conf no longer exits, mkfs.ext4 silently fails to open it and proceeds (I'm not sure what sort of default values it then uses or the impact of not referencing the actual file in the local environment)
- If the original mke2fs.conf exists, but has no read permissions for the user running mkfs.ext4, then mkfs.ext4 fails.

It seems the ideal situation would be to add this line to the do_install of e2fsprogs.bb:

create_wrapper ${D}/${base_sbindir}/mkfs.ext4 MKE2FS_CONFIG=$sysconfdir/../etc/mke2fs.conf

Except that the create_image.ext4 script does not export $sysconfdir, do this doesn't work.
Comment 1 Aníbal Limón 2015-02-23 17:08:52 UTC
Hi Rob,

I'm trying to reproduce the issue but i can't,

I'm using SSATE's from qemux86-64 build into another build using SSTATE_DIR and then built core-image-minimal.

Here is my local.conf,

MACHINE ??= "qemux86-64"
SSTATE_DIR ?= "/home/alimon/repos/poky/build/sstate-cache"
PACKAGE_CLASSES ?= "package_deb"

Any idea?

Regards,
    alimon
Comment 2 Rob Anders 2015-04-14 02:28:24 UTC
Sorry, I guess I don't have time to attempt reproduction and provide the logs.  We'll go ahead and close this for now.