diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-18 11:04:59 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-21 09:34:40 +0100 |
commit | 83d791089fb220553d4df144f56ebea61d9e0713 (patch) | |
tree | 76d131c07f8298655469aafe9f13d6cd957f418b | |
parent | 25a2244265a14bb1b1585fb406f2b9a722055011 (diff) | |
download | poky-83d791089fb220553d4df144f56ebea61d9e0713.tar.gz |
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.
(From OE-Core rev: a052caed563a09a01f5a3ea1f0477f379c05bee0)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/image-live.bbclass | 8 | ||||
-rw-r--r-- | meta/classes/image.bbclass | 10 | ||||
-rw-r--r-- | meta/conf/documentation.conf | 2 | ||||
-rw-r--r-- | meta/conf/machine/include/x86-base.inc | 3 |
4 files changed, 5 insertions, 18 deletions
diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass index 966277c678..942298a7ce 100644 --- a/meta/classes/image-live.bbclass +++ b/meta/classes/image-live.bbclass | |||
@@ -19,8 +19,6 @@ | |||
19 | 19 | ||
20 | # External variables (also used by syslinux.bbclass) | 20 | # External variables (also used by syslinux.bbclass) |
21 | # ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional) | 21 | # ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional) |
22 | # ${NOISO} - skip building the ISO image if set to 1 | ||
23 | # ${NOHDD} - skip building the HDD image if set to 1 | ||
24 | # ${HDDIMG_ID} - FAT image volume-id | 22 | # ${HDDIMG_ID} - FAT image volume-id |
25 | # ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional) | 23 | # ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional) |
26 | 24 | ||
@@ -80,8 +78,8 @@ populate_live() { | |||
80 | } | 78 | } |
81 | 79 | ||
82 | build_iso() { | 80 | build_iso() { |
83 | # Only create an ISO if we have an INITRD and NOISO was not set | 81 | # Only create an ISO if we have an INITRD and the live or iso image type was selected |
84 | if [ -z "${INITRD}" ] || [ "${NOISO}" = "1" ]; then | 82 | if [ -z "${INITRD}" ] || [ "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso', '1', '0', d)}" != "1" ]; then |
85 | bbnote "ISO image will not be created." | 83 | bbnote "ISO image will not be created." |
86 | return | 84 | return |
87 | fi | 85 | fi |
@@ -217,7 +215,7 @@ build_fat_img() { | |||
217 | 215 | ||
218 | build_hddimg() { | 216 | build_hddimg() { |
219 | # Create an HDD image | 217 | # Create an HDD image |
220 | if [ "${NOHDD}" != "1" ] ; then | 218 | if [ "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live hddimg', '1', '0', d)}" = "1" ] ; then |
221 | populate_live ${HDDDIR} | 219 | populate_live ${HDDDIR} |
222 | 220 | ||
223 | if [ "${PCBIOS}" = "1" ]; then | 221 | if [ "${PCBIOS}" = "1" ]; then |
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index b1132b420e..f056ca5970 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -1,11 +1,3 @@ | |||
1 | def build_live(d): | ||
2 | if bb.utils.contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg | ||
3 | d.setVar('NOISO', bb.utils.contains('IMAGE_FSTYPES', "iso", "0", "1", d)) | ||
4 | d.setVar('NOHDD', bb.utils.contains('IMAGE_FSTYPES', "hddimg", "0", "1", d)) | ||
5 | if d.getVar('NOISO') == "0" or d.getVar('NOHDD') == "0": | ||
6 | return "image-live" | ||
7 | return "" | ||
8 | return "image-live" | ||
9 | 1 | ||
10 | IMAGE_CLASSES ??= "" | 2 | IMAGE_CLASSES ??= "" |
11 | 3 | ||
@@ -18,7 +10,7 @@ IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}" | |||
18 | # Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base | 10 | # Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base |
19 | # in the non-Linux SDK_OS case, such as mingw32 | 11 | # in the non-Linux SDK_OS case, such as mingw32 |
20 | IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" | 12 | IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" |
21 | IMGCLASSES += "${@build_live(d)}" | 13 | IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}" |
22 | IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" | 14 | IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" |
23 | IMGCLASSES += "image_types_wic" | 15 | IMGCLASSES += "image_types_wic" |
24 | IMGCLASSES += "${@oe.utils.conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}" | 16 | IMGCLASSES += "${@oe.utils.conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}" |
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf index 254f8f1960..3189dd39b7 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 | |||
288 | 288 | ||
289 | NATIVELSBSTRING[doc] = "A string identifying the host distribution." | 289 | NATIVELSBSTRING[doc] = "A string identifying the host distribution." |
290 | 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." | 290 | 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." |
291 | NOHDD[doc] = "Causes the OpenEmbedded build system to skip building the .hddimg image." | ||
292 | NOISO[doc] = "Causes the OpenEmbedded build system to skip building the ISO image." | ||
293 | 291 | ||
294 | #O | 292 | #O |
295 | 293 | ||
diff --git a/meta/conf/machine/include/x86-base.inc b/meta/conf/machine/include/x86-base.inc index f8aacea64c..0edcea7f56 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 \ | |||
10 | 10 | ||
11 | MACHINE_EXTRA_RRECOMMENDS += "kernel-modules" | 11 | MACHINE_EXTRA_RRECOMMENDS += "kernel-modules" |
12 | 12 | ||
13 | IMAGE_FSTYPES ?= "live" | 13 | IMAGE_FSTYPES ?= "hddimg" |
14 | NOISO ?= "1" | ||
15 | 14 | ||
16 | KERNEL_IMAGETYPE ?= "bzImage" | 15 | KERNEL_IMAGETYPE ?= "bzImage" |
17 | 16 | ||