[oe-commits] [openembedded-core] 12/27: image/image-live: Improve handling of live/iso/hddimg types (drop NOISO/NOHDD)

git at git.openembedded.org git at git.openembedded.org
Tue Jun 19 12:23:51 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 5b7d697a44dd5235ea9b549f9bd2f0c1d0ded270
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Jun 18 11:04:59 2018 +0000

    image/image-live: Improve handling of live/iso/hddimg types (drop NOISO/NOHDD)
    
    The logic can be improved and the historical NOISO/NOHDD variables
    moved into the class and out of common code.
    
    The variables are also then removed in favour of directly controlling
    the behaviour from IMAGE_FSTYPES in line with all the other image types.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/image-live.bbclass        |  8 +++-----
 meta/classes/image.bbclass             | 11 +----------
 meta/conf/documentation.conf           |  2 --
 meta/conf/machine/include/x86-base.inc |  3 +--
 4 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass
index 966277c..942298a 100644
--- a/meta/classes/image-live.bbclass
+++ b/meta/classes/image-live.bbclass
@@ -19,8 +19,6 @@
 
 # External variables (also used by syslinux.bbclass)
 # ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
-# ${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)
 
@@ -80,8 +78,8 @@ populate_live() {
 }
 
 build_iso() {
-	# Only create an ISO if we have an INITRD and NOISO was not set
-	if [ -z "${INITRD}" ] || [ "${NOISO}" = "1" ]; then
+	# Only create an ISO if we have an INITRD and the live or iso image type was selected
+	if [ -z "${INITRD}" ] || [ "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso', '1', '0', d)}" != "1" ]; then
 		bbnote "ISO image will not be created."
 		return
 	fi
@@ -217,7 +215,7 @@ build_fat_img() {
 
 build_hddimg() {
 	# Create an HDD image
-	if [ "${NOHDD}" != "1" ] ; then
+	if [ "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live hddimg', '1', '0', d)}" = "1" ] ; then
 		populate_live ${HDDDIR}
 
 		if [ "${PCBIOS}" = "1" ]; then
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index cc889cf..c4fc457 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -1,18 +1,9 @@
-def build_live(d):
-    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))
-        if d.getVar('NOISO') == "0" or d.getVar('NOHDD') == "0":
-            return "image-live"
-        return ""
-    return "image-live"
-
 # Handle inherits of any of the image classes we need
 IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
 # Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base
 # in the non-Linux SDK_OS case, such as mingw32
 IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
-IMGCLASSES += "${@build_live(d)}"
+IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}"
 IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
 IMGCLASSES += "image_types_wic"
 IMGCLASSES += "${@oe.utils.conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}"
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index 254f8f1..3189dd3 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -288,8 +288,6 @@ MULTIMACH_TARGET_SYS[doc] = "Separates files for different machines such that yo
 
 NATIVELSBSTRING[doc] = "A string identifying the host distribution."
 NO_RECOMMENDATIONS[doc] = "When set to '1', no recommended packages will be installed. Realize that some recommended packages might be required for certain system functionality, such as kernel-modules. It is up to the user to add packages to IMAGE_INSTALL as needed."
-NOHDD[doc] = "Causes the OpenEmbedded build system to skip building the .hddimg image."
-NOISO[doc] = "Causes the OpenEmbedded build system to skip building the ISO image."
 
 #O
 
diff --git a/meta/conf/machine/include/x86-base.inc b/meta/conf/machine/include/x86-base.inc
index f8aacea..0edcea7 100644
--- a/meta/conf/machine/include/x86-base.inc
+++ b/meta/conf/machine/include/x86-base.inc
@@ -10,8 +10,7 @@ MACHINE_FEATURES += "screen keyboard pci usbhost ext2 ext3 x86 \
 
 MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
 
-IMAGE_FSTYPES ?= "live"
-NOISO ?= "1"
+IMAGE_FSTYPES ?= "hddimg"
 
 KERNEL_IMAGETYPE ?= "bzImage"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list