[OE-core] [PATCH v2 1/7] image-live-artifacts: Add support for creating image artifacts only

Alejandro Hernandez alejandro.hernandez at linux.intel.com
Thu Jan 12 22:34:53 UTC 2017


Hey Mikko


On 01/12/2017 06:52 AM, Ylinen, Mikko wrote:
>
>
> On Wed, Jan 11, 2017 at 9:55 PM, Alejandro Hernandez 
> <alejandro.hernandez at linux.intel.com 
> <mailto:alejandro.hernandez at linux.intel.com>> wrote:
>
>     From: Tom Zanussi <tom.zanussi at linux.intel.com
>     <mailto:tom.zanussi at linux.intel.com>>
>
>     Rather than create an actual image, just put the image artifacts in an
>     'artifacts' directory that can then be picked up by wic.
>
I thought about changing it to boot-artifacts-only, but once I did, 
since it is based on image-live the code looked more confusing in my 
opinion.
Also, we wanted what image-live does  in some parts, in this case 
do_bootimg, but we also avoid other things from image-live.
>
> This is a desired goal now that wic is more widely used. However, any 
> particular
> reason why the implementation talks about "live" and copies what the 
> live image
> do_bootimg gives?
>
>     Signed-off-by: Alejandro Hernandez
>     <alejandro.hernandez at linux.intel.com
>     <mailto:alejandro.hernandez at linux.intel.com>>
>     Signed-off-by: Tom Zanussi <tom.zanussi at linux.intel.com
>     <mailto:tom.zanussi at linux.intel.com>>
>     ---
>      meta/classes/image-live-artifacts.bbclass | 40
>     +++++++++++++++++++++++++++++++
>      meta/classes/image.bbclass                |  3 +++
>      meta/classes/image_types.bbclass          |  2 ++
>      3 files changed, 45 insertions(+)
>      create mode 100644 meta/classes/image-live-artifacts.bbclass
>
>     diff --git a/meta/classes/image-live-artifacts.bbclass
>     b/meta/classes/image-live-artifacts.bbclass
>     new file mode 100644
>     index 0000000..1501a9b
>     --- /dev/null
>     +++ b/meta/classes/image-live-artifacts.bbclass
>     @@ -0,0 +1,40 @@
>     +# Create the artifacts only on an ARTIFACTS_DIR,
>     +# which can be later picked up by wic
>     +
>     +inherit live-vm-common
>     +
>     +do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
>
>
Again, this was thought based on what image-live does, I'm not saying I 
disagree with you regarding handling the dependencies, but in this case 
you're saying you have the same issue with image-live?

> perhaps have 'do_image_artifacts' and let users/other classes set 
> additional dependencies.
>
>     +                   mtools-native:do_populate_sysroot \
>     +                        cdrtools-native:do_populate_sysroot \
>     +                        virtual/kernel:do_deploy \
>     +                        ${MLPREFIX}syslinux:do_populate_sysroot \
>     +                        syslinux-native:do_populate_sysroot \
>
>
> For example, if I use systemd-boot I don't need syslinux built at all. 
> The EFI_CLASS/PCBIOS_CLASS
> could define the additional depends here (like they are currently 
> doing for bootimg/bootdirectdisk).
>
> The defaults should be just kernel and initrd(s) (if defined).
>
>     +                   ${@oe.utils.ifelse(d.getVar('COMPRESSISO',
>     False),'zisofs-tools-native:do_populate_sysroot','')} \
>     +                        "
>     +
>     +
>     +LABELS_LIVE ?= "boot install"
>     +
>     +ARTIFACTS_DIR = "${DEPLOY_DIR_IMAGE}/artifacts"
>     +
>     +populate_bootloader() {
>     +       populate_kernel ${ARTIFACTS_DIR}
>     +
>     +       if [ "${PCBIOS}" = "1" ]; then
>     +               syslinux_hddimg_populate ${ARTIFACTS_DIR}
>     +       fi
>     +       if [ "${EFI}" = "1" ]; then
>     +               efi_hddimg_populate ${ARTIFACTS_DIR}
>     +       fi
>     +}
>     +
>     +python do_bootimg() {
>     +    set_live_vm_vars(d, 'LIVE')
>     +    if d.getVar("PCBIOS", True) == "1":
>     +        bb.build.exec_func('build_syslinux_cfg', d)
>     +    if d.getVar("EFI", True) == "1":
>     +        bb.build.exec_func('build_efi_cfg', d)
>     +    bb.build.exec_func('populate_bootloader', d)
>     +}
>     +
>     +addtask bootimg before do_image_complete
>     diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>     index 04fd5f9..fd249c8 100644
>     --- a/meta/classes/image.bbclass
>     +++ b/meta/classes/image.bbclass
>     @@ -130,6 +130,9 @@ do_rootfs[vardeps] += "${@rootfs_variables(d)}"
>      do_build[depends] += "virtual/kernel:do_deploy"
>
>      def build_live(d):
>     +    if bb.utils.contains("IMAGE_FSTYPES", "live-artifacts-only",
>     "live-artifacts-only", "0", d) == "live-artifacts-only":
>     +         return "image-live-artifacts"
>
>
Not as far as I know, but so that would work when building something AND 
the artifacts, but what if you want to build the artifacts only?, you 
would have to build everything else as well wouldn't you?

I'm trying to think if this change is not more related to actually 
changing image-live, but I could be misunderstanding things
> Is there a need for the image artifacts for other than wic? It could 
> be made so that if wic is in IMAGE_FSTYPES,
> image-artifacts are built by default. This means the logic of 
> inheriting image-artifacts has a better place, e.g.,
> in it's own build_wic() check.
>
> -- Mikko

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170112/7683f801/attachment-0002.html>


More information about the Openembedded-core mailing list