| Summary: | Remove the obsolote images | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Robert Yang <liezhi.yang> |
| Component: | core | Assignee: | Robert Yang <liezhi.yang> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Medium | CC: | ke.zou, mark.hatle, meta.mr.watcher, meta.watcher, richard.purdie, sgw |
| Version: | 1.5 | ||
| Target Milestone: | 1.5 M1 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Robert Yang
2013-04-23 03:33:59 UTC
This should be part of the cleanup-workdir instead and not part of the bbclass files. (In reply to comment #1) > This should be part of the cleanup-workdir instead and not part of the > bbclass files. Hi Saul, thanks for your suggestion, but it seems that it is easy to use and implement if we do it in image_types.bbclass, here is the draft patch: diff --git a/meta-yocto/conf/local.conf.sample.extended b/meta-yocto/conf/local.conf.sample.extended index d0dff80..a7979e1 100644 --- a/meta-yocto/conf/local.conf.sample.extended +++ b/meta-yocto/conf/local.conf.sample.extended @@ -211,3 +211,6 @@ # Put the following two lines in the conf file with intact. #ARCHIVER_CLASS = "${@'archive-${ARCHIVER_MODE}-source' if ARCHIVER_MODE != 'none' else ''}" #INHERIT += "${ARCHIVER_CLASS}" + +# Remove the obsolete image before the new one generated to save disk sapce +#RM_OBSOLETE_IMAGE = "1" diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index 94837ae..27f232e 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass @@ -51,7 +51,11 @@ def get_imagecmds(d): types.remove("live") if d.getVar('IMAGE_LINK_NAME', True): - cmds += "\trm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.*" + if d.getVar('RM_OBSOLETE_IMAGE', True) == "1": + # Remove the obsolete image + cmds += "\trm -f `find ${DEPLOY_DIR_IMAGE} -maxdepth 1 -type l -name ${IMAGE_LINK_NAME}'.*' -exec readlink -f {} \;`" + # Remove the symlink + cmds += "\n\trm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.*" for type in types: ccmd = [] If we do it in the cleanup-workdir script, we need consider which files should be kept when different archs and image recipes have been built, and we need to add an option for it to cleanup the DEPLOY_DIR_IMAGE directory rather than the work dir. Merged into master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=c51e8b4532361b11fe73c28613653c0f5aaf566b No, not merged, it is in review. Merged into master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=0948a237ddfcd92dcc4a21e238a963568161f12d http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=995c196f98bf3a85e73f4981cfeeacfb5b84330e verified in yocto 1.5
master git rev: 676fd3f394a0c0576b63c77ed2184bf5f42c29b6
Test step:
1.build any type of image in poky
2.change ${POKY}/build/conf/local.conf
add line: RM_OLD_IMAGE = 1
3.re-build image again
4.Last build in ${POKY}/build/tmp/deploy/images/ should be deleted
|