Bug 12177

Summary: Support wic in the esdk
Product: [Yocto Project Subprojects] eSDK Reporter: brian avery <brian.avery>
Component: eSDKAssignee: Rebecca Chang <rebecca.swee.fun.chang>
Status: RESOLVED FIXED QA Contact: Francisco Pedraza <francisco.j.pedraza.gonzalez>
Severity: enhancement    
Priority: Medium+ CC: amber.n.elliot, bluelightning, california.l.sullivan, rebecca.swee.fun.chang, sgw, stephano
Version: 2.4   
Target Milestone: 2.5 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Error importing wic module none

Description brian avery 2017-10-03 22:32:07 UTC
wic is present in the esdk but it is not in the path. now that we have wic ls,cp,rm there is a lot of value in being able to use wic to manipulate images from within the esdk so it would be nice if it appeared in the path as a std tool.
Comment 1 Rebecca Chang 2017-10-05 02:29:30 UTC
Created attachment 4054 [details]
Error importing wic module
Comment 2 Rebecca Chang 2017-10-05 02:30:35 UTC
Trying to include wic in eSDK environment, while running wic in eSDK env, it was failed to import module. Will dig deeper for root cause.
Comment 3 brian avery 2017-10-14 17:27:37 UTC
wic is playing with the import path to make sure it finds its modules in the standard build mode:
# External modules                                                    |                                                                 
scripts_path = os.path.abspath(os.path.dirname(__file__))             |
lib_path = scripts_path + '/lib'                                      |
sys.path.insert(0, lib_path)                                          |
oe_lib_path = os.path.join(os.path.dirname(scripts_path), 'meta', 'lib')
sys.path.insert(0, oe_lib_path)                                       |
                                                                      |
---
One approch would be to append to PYTHONPATH in the environment script
Comment 5 Rebecca Chang 2018-01-02 07:38:11 UTC
The WIP branch has the patches to enable wic image manipulation commands (wic ls,cp,rm). Tested "wic list images" is working too but not for "wic create". 

I've understand that wic has its own requirements in order for it to work (http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#wic-requirements), by looking at the bug list on wic, I think this feature is dependent to other bugzilla or it needs a major restructure in wic.

1. "You must have sourced the build environment setup script (i.e. oe-init-build-env) found in the Build Directory." We need to design for better eSDK support as in eSDK environment, there will be no bitbake command available. We could possibly explore eSDK environment setup script (environment-setup-i586-poky-linux) to help setup the variable needed by wic?
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11281

2. "You need to have the build artifacts already available, which typically means that you must have already created an image using the Openembedded build system." In eSDK workflow, the artifacts are available in different location under the condition where BUILDDIR is not defined. We need the ability to set arbitrary artifacts to arbitrary locations so we could use this ability to control wic within eSDK environment.
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11280

These are my opinions from my exploratory task on wic. I would like to collect more inputs from developers who are working on wic.
Comment 6 Rebecca Chang 2018-01-03 06:13:52 UTC
WIP branch with workaround on BUILDDIR set in environment:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=rebeccas/12177-wic-esdk

But this might not be the best solutions.
Comment 7 Rebecca Chang 2018-01-10 04:17:52 UTC
New contrib branch:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=rebeccas/wic-dev

Where BUILDDIR is being set within wic itself instead of setting from eSDK environment.
Comment 8 Rebecca Chang 2018-01-11 06:15:55 UTC
Pushed to mailing list:
http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146283.html