All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/7] image-live-artifacts: Add support for creating image artifacts only
@ 2017-01-13 13:17 Ylinen, Mikko
  0 siblings, 0 replies; 4+ messages in thread
From: Ylinen, Mikko @ 2017-01-13 13:17 UTC (permalink / raw)
  To: Alejandro Hernandez; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

On Fri, Jan 13, 2017 at 12:34 AM, Alejandro Hernandez <
alejandro.hernandez@linux.intel.com> wrote:

[snip]

>
> 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?
>

My only feedback was: we could target something that gives the necessary
artifacts
without depending on any other IMAGE_FSTYPES than wic (and I was assuming
wic
is the reason why the patch exists).

Currently, for example, all "live" artifacts (including rootfs.img) are
built first to get a
wic image created. The same applies with this patch still: one would need
to specify
another image type first to get the artifacts to get wic image type built.
Furthermore, that
image type would give unnecessary build dependencies (depending on your
configuration).

It can also be argued whether the build_*_cfg() are needed here because the
wic source
plugins write their own configs.

The desired outcome (IMO) would be independent from "live" (naming wise
also).

-- Mikko

[-- Attachment #2: Type: text/html, Size: 2099 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/7] image-live-artifacts: Add support for creating image artifacts only
  2017-01-12 12:52   ` Ylinen, Mikko
@ 2017-01-12 22:34     ` Alejandro Hernandez
  0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Hernandez @ 2017-01-12 22:34 UTC (permalink / raw)
  To: Ylinen, Mikko; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 5204 bytes --]

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@linux.intel.com 
> <mailto:alejandro.hernandez@linux.intel.com>> wrote:
>
>     From: Tom Zanussi <tom.zanussi@linux.intel.com
>     <mailto:tom.zanussi@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@linux.intel.com
>     <mailto:alejandro.hernandez@linux.intel.com>>
>     Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com
>     <mailto:tom.zanussi@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


[-- Attachment #2: Type: text/html, Size: 9558 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/7] image-live-artifacts: Add support for creating image artifacts only
  2017-01-11 19:55 ` [PATCH v2 1/7] image-live-artifacts: Add support for creating image artifacts only Alejandro Hernandez
@ 2017-01-12 12:52   ` Ylinen, Mikko
  2017-01-12 22:34     ` Alejandro Hernandez
  0 siblings, 1 reply; 4+ messages in thread
From: Ylinen, Mikko @ 2017-01-12 12:52 UTC (permalink / raw)
  To: Alejandro Hernandez; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 3795 bytes --]

On Wed, Jan 11, 2017 at 9:55 PM, Alejandro Hernandez <
alejandro.hernandez@linux.intel.com> wrote:

> From: Tom Zanussi <tom.zanussi@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@linux.intel.com>
> Signed-off-by: Tom Zanussi <tom.zanussi@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

[-- Attachment #2: Type: text/html, Size: 5489 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/7] image-live-artifacts: Add support for creating image artifacts only
  2017-01-11 19:55 [PATCH v2 0/7] poky-tiny improvements Alejandro Hernandez
@ 2017-01-11 19:55 ` Alejandro Hernandez
  2017-01-12 12:52   ` Ylinen, Mikko
  0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Hernandez @ 2017-01-11 19:55 UTC (permalink / raw)
  To: openembedded-core

From: Tom Zanussi <tom.zanussi@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.

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@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 \
+                        mtools-native:do_populate_sysroot \
+                        cdrtools-native:do_populate_sysroot \
+                        virtual/kernel:do_deploy \
+                        ${MLPREFIX}syslinux:do_populate_sysroot \
+                        syslinux-native:do_populate_sysroot \
+                        ${@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"
+
     if bb.utils.contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg
         d.setVar('NOISO', bb.utils.contains('IMAGE_FSTYPES', "iso", "0", "1", d))
         d.setVar('NOHDD', bb.utils.contains('IMAGE_FSTYPES', "hddimg", "0", "1", d))
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 8f04849..b9359b2 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -270,6 +270,8 @@ python () {
                 bb.build.addtask('do_write_wks_template', 'do_image_wic', None, d)
 }
 
+IMAGE_CMD_live-artifacts-only = " "
+
 EXTRA_IMAGECMD = ""
 
 inherit siteinfo
-- 
2.6.6



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-13 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-13 13:17 [PATCH v2 1/7] image-live-artifacts: Add support for creating image artifacts only Ylinen, Mikko
  -- strict thread matches above, loose matches on Subject: below --
2017-01-11 19:55 [PATCH v2 0/7] poky-tiny improvements Alejandro Hernandez
2017-01-11 19:55 ` [PATCH v2 1/7] image-live-artifacts: Add support for creating image artifacts only Alejandro Hernandez
2017-01-12 12:52   ` Ylinen, Mikko
2017-01-12 22:34     ` Alejandro Hernandez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.