All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 1/6] image-live-artifacts: Add support for creating image artifacts only
Date: Tue,  3 Jan 2017 22:30:37 +0000	[thread overview]
Message-ID: <04107922d67fb222e89181e85f914884a34a4141.1482363237.git.alejandro.hernandez@linux.intel.com> (raw)
In-Reply-To: <cover.1482363237.git.alejandro.hernandez@linux.intel.com>
In-Reply-To: <cover.1482363237.git.alejandro.hernandez@linux.intel.com>

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: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 meta/classes/image-live-artifacts.bbclass | 64 +++++++++++++++++++++++++++++++
 meta/classes/image.bbclass                |  4 ++
 2 files changed, 68 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..e056336
--- /dev/null
+++ b/meta/classes/image-live-artifacts.bbclass
@@ -0,0 +1,64 @@
+# Copyright (C) 2004, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+# Creates a bootable image using syslinux, your kernel and an optional
+# initrd
+
+#
+# End result is two things:
+#
+# 1. A .hddimg file which is an msdos filesystem containing syslinux, a kernel,
+# an initrd and a rootfs image. These can be written to harddisks directly and
+# also booted on USB flash disks (write them there with dd).
+#
+# 2. A CD .iso image
+
+# Boot process is that the initrd will boot and process which label was selected
+# in syslinux. Actions based on the label are then performed (e.g. installing to
+# an hdd)
+
+# External variables (also used by syslinux.bbclass)
+# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
+# ${COMPRESSISO} - Transparent compress ISO, reduce size ~40% if set to 1
+# ${NOISO}  - skip building the ISO image if set to 1
+# ${NOHDD}  - skip building the HDD image if set to 1
+# ${HDDIMG_ID} - FAT image volume-id
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+
+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..c3f5f2e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -130,6 +130,10 @@ do_rootfs[vardeps] += "${@rootfs_variables(d)}"
 do_build[depends] += "virtual/kernel:do_deploy"
 
 def build_live(d):
+    artifacts_only = d.getVar("ARTIFACTS_ONLY", True)
+    if 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))
-- 
2.6.6



  reply	other threads:[~2017-01-03 22:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 22:30 [PATCH 0/6] poky-tiny improvements Alejandro Hernandez
2017-01-03 22:30 ` Alejandro Hernandez [this message]
2017-01-03 22:41   ` [PATCH 1/6] image-live-artifacts: Add support for creating image artifacts only Richard Purdie
2017-01-03 22:30 ` [PATCH 2/6] core-image-tiny-initramfs: Add and image " Alejandro Hernandez
2017-01-04 18:29   ` Leonardo Sandoval
2017-01-03 22:30 ` [PATCH 3/6] ksize.py: Python 3 fixes Alejandro Hernandez
2017-01-04  6:39   ` Khem Raj
2017-01-04 18:21     ` Alejandro Hernandez
2017-01-04 22:18       ` Alejandro Hernandez
2017-01-04 23:52         ` Khem Raj
2017-01-03 22:30 ` [PATCH 4/6] scripts/tiny/ksum.py: New tool Alejandro Hernandez
2017-01-04  6:38   ` Khem Raj
2017-01-03 22:30 ` [PATCH 5/6] bootimg-efi: Look for image artifacts in a common location Alejandro Hernandez
2017-01-03 22:30 ` [PATCH 6/6] core-image-tiny-initramfs: Fix error message shown after a successful initrd boot Alejandro Hernandez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04107922d67fb222e89181e85f914884a34a4141.1482363237.git.alejandro.hernandez@linux.intel.com \
    --to=alejandro.hernandez@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.