diff options
| -rw-r--r-- | meta/classes/image.bbclass | 53 |
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 @@ | |||
| 1 | inherit rootfs_${IMAGE_PKGTYPE} | 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 | |||
| 10 | IMAGE_CLASSES ??= "" | ||
| 2 | 11 | ||
| 12 | # rootfs bootstrap install | ||
| 13 | # warning - image-container resets this | ||
| 14 | ROOTFS_BOOTSTRAP_INSTALL = "run-postinsts" | ||
| 15 | |||
| 16 | # Handle inherits of any of the image classes we need | ||
| 17 | IMGCLASSES = "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 |
| 5 | SDKEXTCLASS ?= "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" | 20 | IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" |
| 6 | inherit ${SDKEXTCLASS} | 21 | IMGCLASSES += "${@build_live(d)}" |
| 22 | IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" | ||
| 23 | IMGCLASSES += "image_types_wic" | ||
| 24 | IMGCLASSES += "${@oe.utils.conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}" | ||
| 25 | IMGCLASSES += "rootfs-postcommands" | ||
| 26 | inherit ${IMGCLASSES} | ||
| 7 | 27 | ||
| 8 | TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" | 28 | TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" |
| 9 | TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}" | 29 | TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}" |
| @@ -18,9 +38,6 @@ PATH_prepend = "${@":".join(all_multilib_tune_values(d, 'STAGING_BINDIR_CROSS'). | |||
| 18 | 38 | ||
| 19 | INHIBIT_DEFAULT_DEPS = "1" | 39 | INHIBIT_DEFAULT_DEPS = "1" |
| 20 | 40 | ||
| 21 | TESTIMAGECLASS = "${@oe.utils.conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}" | ||
| 22 | inherit ${TESTIMAGECLASS} | ||
| 23 | |||
| 24 | # IMAGE_FEATURES may contain any available package group | 41 | # IMAGE_FEATURES may contain any available package group |
| 25 | IMAGE_FEATURES ?= "" | 42 | IMAGE_FEATURES ?= "" |
| 26 | IMAGE_FEATURES[type] = "list" | 43 | IMAGE_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? |
| 30 | IMAGE_GEN_DEBUGFS ?= "0" | 47 | IMAGE_GEN_DEBUGFS ?= "0" |
| 31 | 48 | ||
| 32 | # rootfs bootstrap install | ||
| 33 | ROOTFS_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 | ||
| 128 | do_build[depends] += "virtual/kernel:do_deploy" | 143 | do_build[depends] += "virtual/kernel:do_deploy" |
| 129 | 144 | ||
| 130 | def 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 | |||
| 139 | IMAGE_TYPE_live = "${@build_live(d)}" | ||
| 140 | inherit ${IMAGE_TYPE_live} | ||
| 141 | |||
| 142 | IMAGE_TYPE_container = '${@bb.utils.contains("IMAGE_FSTYPES", "container", "image-container", "", d)}' | ||
| 143 | inherit ${IMAGE_TYPE_container} | ||
| 144 | |||
| 145 | IMAGE_TYPE_wic = "image_types_wic" | ||
| 146 | inherit ${IMAGE_TYPE_wic} | ||
| 147 | 145 | ||
| 148 | python () { | 146 | python () { |
| 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 | ||
| 181 | IMAGE_CLASSES += "image_types" | ||
| 182 | inherit ${IMAGE_CLASSES} | ||
| 183 | |||
| 184 | IMAGE_POSTPROCESS_COMMAND ?= "" | 179 | IMAGE_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. |
| 193 | PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}" | 188 | PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}" |
| 194 | 189 | ||
| 195 | inherit rootfs-postcommands | ||
| 196 | |||
| 197 | PACKAGE_EXCLUDE ??= "" | 190 | PACKAGE_EXCLUDE ??= "" |
| 198 | PACKAGE_EXCLUDE[type] = "list" | 191 | PACKAGE_EXCLUDE[type] = "list" |
| 199 | 192 | ||
