[OE-core] [PATCH v2 1/7] image-live-artifacts: Add support for creating image artifacts only
Ylinen, Mikko
mikko.ylinen at intel.com
Thu Jan 12 12:52:24 UTC 2017
On Wed, Jan 11, 2017 at 9:55 PM, Alejandro Hernandez <
alejandro.hernandez at linux.intel.com> wrote:
> From: Tom Zanussi <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.
>
>
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>
> Signed-off-by: Tom Zanussi <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 \
>
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"
>
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/fc5eb7b5/attachment-0002.html>
More information about the Openembedded-core
mailing list