summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-18 10:45:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-21 09:34:40 +0100
commit25a2244265a14bb1b1585fb406f2b9a722055011 (patch)
tree1f1dc131e936943d8758d96ecef5e19ed9d37813 /meta/classes/image.bbclass
parent52b11deeb921ba201c16641bc10ff71b8ed16164 (diff)
downloadpoky-25a2244265a14bb1b1585fb406f2b9a722055011.tar.gz
image: Combine all the class handling code into a single section
Right now the code handling class inherits is spread all over and its hard to get an idea of what is happening overall. Combine all the code together to make it clearer. There shoould be no functionality changes. (From OE-Core rev: 9b6cda7ff443eebfc5a5a8c9442c93a881807dab) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass53
1 files changed, 23 insertions, 30 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 16c6b1256e..b1132b420e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -1,9 +1,29 @@
1inherit rootfs_${IMAGE_PKGTYPE} 1def 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
10IMAGE_CLASSES ??= ""
2 11
12# rootfs bootstrap install
13# warning - image-container resets this
14ROOTFS_BOOTSTRAP_INSTALL = "run-postinsts"
15
16# Handle inherits of any of the image classes we need
17IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
3# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base 18# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base
4# in the non-Linux SDK_OS case, such as mingw32 19# in the non-Linux SDK_OS case, such as mingw32
5SDKEXTCLASS ?= "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" 20IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
6inherit ${SDKEXTCLASS} 21IMGCLASSES += "${@build_live(d)}"
22IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
23IMGCLASSES += "image_types_wic"
24IMGCLASSES += "${@oe.utils.conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}"
25IMGCLASSES += "rootfs-postcommands"
26inherit ${IMGCLASSES}
7 27
8TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" 28TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
9TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}" 29TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}"
@@ -18,9 +38,6 @@ PATH_prepend = "${@":".join(all_multilib_tune_values(d, 'STAGING_BINDIR_CROSS').
18 38
19INHIBIT_DEFAULT_DEPS = "1" 39INHIBIT_DEFAULT_DEPS = "1"
20 40
21TESTIMAGECLASS = "${@oe.utils.conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}"
22inherit ${TESTIMAGECLASS}
23
24# IMAGE_FEATURES may contain any available package group 41# IMAGE_FEATURES may contain any available package group
25IMAGE_FEATURES ?= "" 42IMAGE_FEATURES ?= ""
26IMAGE_FEATURES[type] = "list" 43IMAGE_FEATURES[type] = "list"
@@ -29,8 +46,6 @@ IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs empty-root-password
29# Generate companion debugfs? 46# Generate companion debugfs?
30IMAGE_GEN_DEBUGFS ?= "0" 47IMAGE_GEN_DEBUGFS ?= "0"
31 48
32# rootfs bootstrap install
33ROOTFS_BOOTSTRAP_INSTALL = "run-postinsts"
34 49
35# These packages will be removed from a read-only rootfs after all other 50# These packages will be removed from a read-only rootfs after all other
36# packages have been installed 51# packages have been installed
@@ -127,23 +142,6 @@ do_rootfs[vardeps] += "${@rootfs_variables(d)}"
127 142
128do_build[depends] += "virtual/kernel:do_deploy" 143do_build[depends] += "virtual/kernel:do_deploy"
129 144
130def build_live(d):
131 if bb.utils.contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg
132 d.setVar('NOISO', bb.utils.contains('IMAGE_FSTYPES', "iso", "0", "1", d))
133 d.setVar('NOHDD', bb.utils.contains('IMAGE_FSTYPES', "hddimg", "0", "1", d))
134 if d.getVar('NOISO') == "0" or d.getVar('NOHDD') == "0":
135 return "image-live"
136 return ""
137 return "image-live"
138
139IMAGE_TYPE_live = "${@build_live(d)}"
140inherit ${IMAGE_TYPE_live}
141
142IMAGE_TYPE_container = '${@bb.utils.contains("IMAGE_FSTYPES", "container", "image-container", "", d)}'
143inherit ${IMAGE_TYPE_container}
144
145IMAGE_TYPE_wic = "image_types_wic"
146inherit ${IMAGE_TYPE_wic}
147 145
148python () { 146python () {
149 def extraimage_getdepends(task): 147 def extraimage_getdepends(task):
@@ -178,9 +176,6 @@ python () {
178 check_image_features(d) 176 check_image_features(d)
179} 177}
180 178
181IMAGE_CLASSES += "image_types"
182inherit ${IMAGE_CLASSES}
183
184IMAGE_POSTPROCESS_COMMAND ?= "" 179IMAGE_POSTPROCESS_COMMAND ?= ""
185 180
186# some default locales 181# some default locales
@@ -192,8 +187,6 @@ LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IM
192# aren't yet available. 187# aren't yet available.
193PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}" 188PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}"
194 189
195inherit rootfs-postcommands
196
197PACKAGE_EXCLUDE ??= "" 190PACKAGE_EXCLUDE ??= ""
198PACKAGE_EXCLUDE[type] = "list" 191PACKAGE_EXCLUDE[type] = "list"
199 192