Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | inherit rootfs_${IMAGE_PKGTYPE} |
| 2 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 3 | # Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 4 | # in the non-Linux SDK_OS case, such as mingw32 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 5 | SDKEXTCLASS ?= "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 6 | inherit ${SDKEXTCLASS} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | |
| 8 | TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" |
| 9 | TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}" |
| 10 | POPULATE_SDK_POST_TARGET_COMMAND += "rootfs_sysroot_relativelinks; " |
| 11 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | LICENSE = "MIT" |
| 13 | PACKAGES = "" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 14 | DEPENDS += "${MLPREFIX}qemuwrapper-cross depmodwrapper-cross" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 15 | RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL}" |
| 16 | RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}" |
| 17 | |
| 18 | INHIBIT_DEFAULT_DEPS = "1" |
| 19 | |
| 20 | TESTIMAGECLASS = "${@base_conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}" |
| 21 | inherit ${TESTIMAGECLASS} |
| 22 | |
| 23 | # IMAGE_FEATURES may contain any available package group |
| 24 | IMAGE_FEATURES ?= "" |
| 25 | IMAGE_FEATURES[type] = "list" |
| 26 | IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs empty-root-password allow-empty-password post-install-logging" |
| 27 | |
| 28 | # Generate companion debugfs? |
| 29 | IMAGE_GEN_DEBUGFS ?= "0" |
| 30 | |
| 31 | # rootfs bootstrap install |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 32 | ROOTFS_BOOTSTRAP_INSTALL = "run-postinsts" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 34 | # These packages will be removed from a read-only rootfs after all other |
| 35 | # packages have been installed |
| 36 | ROOTFS_RO_UNNEEDED = "update-rc.d base-passwd shadow ${VIRTUAL-RUNTIME_update-alternatives} ${ROOTFS_BOOTSTRAP_INSTALL}" |
| 37 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | # packages to install from features |
| 39 | FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}" |
| 40 | FEATURE_INSTALL[vardepvalue] = "${FEATURE_INSTALL}" |
| 41 | FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}" |
| 42 | FEATURE_INSTALL_OPTIONAL[vardepvalue] = "${FEATURE_INSTALL_OPTIONAL}" |
| 43 | |
| 44 | # Define some very basic feature package groups |
| 45 | FEATURE_PACKAGES_package-management = "${ROOTFS_PKGMANAGE}" |
| 46 | SPLASH ?= "psplash" |
| 47 | FEATURE_PACKAGES_splash = "${SPLASH}" |
| 48 | |
| 49 | IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}' |
| 50 | |
| 51 | def check_image_features(d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 52 | valid_features = (d.getVarFlag('IMAGE_FEATURES', 'validitems') or "").split() |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | valid_features += d.getVarFlags('COMPLEMENTARY_GLOB').keys() |
| 54 | for var in d: |
| 55 | if var.startswith("PACKAGE_GROUP_"): |
| 56 | bb.warn("PACKAGE_GROUP is deprecated, please use FEATURE_PACKAGES instead") |
| 57 | valid_features.append(var[14:]) |
| 58 | elif var.startswith("FEATURE_PACKAGES_"): |
| 59 | valid_features.append(var[17:]) |
| 60 | valid_features.sort() |
| 61 | |
| 62 | features = set(oe.data.typed_value('IMAGE_FEATURES', d)) |
| 63 | for feature in features: |
| 64 | if feature not in valid_features: |
| 65 | if bb.utils.contains('EXTRA_IMAGE_FEATURES', feature, True, False, d): |
| 66 | raise bb.parse.SkipRecipe("'%s' in IMAGE_FEATURES (added via EXTRA_IMAGE_FEATURES) is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features))) |
| 67 | else: |
| 68 | raise bb.parse.SkipRecipe("'%s' in IMAGE_FEATURES is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features))) |
| 69 | |
| 70 | IMAGE_INSTALL ?= "" |
| 71 | IMAGE_INSTALL[type] = "list" |
| 72 | export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL} ${FEATURE_INSTALL}" |
| 73 | PACKAGE_INSTALL_ATTEMPTONLY ?= "${FEATURE_INSTALL_OPTIONAL}" |
| 74 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 75 | IMGDEPLOYDIR = "${WORKDIR}/deploy-${PN}-image-complete" |
| 76 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | # Images are generally built explicitly, do not need to be part of world. |
| 78 | EXCLUDE_FROM_WORLD = "1" |
| 79 | |
| 80 | USE_DEVFS ?= "1" |
| 81 | USE_DEPMOD ?= "1" |
| 82 | |
| 83 | PID = "${@os.getpid()}" |
| 84 | |
| 85 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 86 | |
| 87 | LDCONFIGDEPEND ?= "ldconfig-native:do_populate_sysroot" |
| 88 | LDCONFIGDEPEND_libc-uclibc = "" |
| 89 | LDCONFIGDEPEND_libc-musl = "" |
| 90 | |
| 91 | # This is needed to have depmod data in PKGDATA_DIR, |
| 92 | # but if you're building small initramfs image |
| 93 | # e.g. to include it in your kernel, you probably |
| 94 | # don't want this dependency, which is causing dependency loop |
| 95 | KERNELDEPMODDEPEND ?= "virtual/kernel:do_packagedata" |
| 96 | |
| 97 | do_rootfs[depends] += " \ |
| 98 | makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ${LDCONFIGDEPEND} \ |
| 99 | virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot \ |
| 100 | ${KERNELDEPMODDEPEND} \ |
| 101 | " |
| 102 | do_rootfs[recrdeptask] += "do_packagedata" |
| 103 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 104 | def rootfs_command_variables(d): |
| 105 | return ['ROOTFS_POSTPROCESS_COMMAND','ROOTFS_PREPROCESS_COMMAND','ROOTFS_POSTINSTALL_COMMAND','ROOTFS_POSTUNINSTALL_COMMAND','OPKG_PREPROCESS_COMMANDS','OPKG_POSTPROCESS_COMMANDS','IMAGE_POSTPROCESS_COMMAND', |
| 106 | 'IMAGE_PREPROCESS_COMMAND','RPM_PREPROCESS_COMMANDS','RPM_POSTPROCESS_COMMANDS','DEB_PREPROCESS_COMMANDS','DEB_POSTPROCESS_COMMANDS'] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 107 | |
| 108 | python () { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 109 | variables = rootfs_command_variables(d) + sdk_command_variables(d) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 110 | for var in variables: |
| 111 | if d.getVar(var, False): |
| 112 | d.setVarFlag(var, 'func', '1') |
| 113 | } |
| 114 | |
| 115 | def rootfs_variables(d): |
| 116 | from oe.rootfs import variable_depends |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 117 | variables = ['IMAGE_DEVICE_TABLE','IMAGE_DEVICE_TABLES','BUILD_IMAGES_FROM_FEEDS','IMAGE_TYPES_MASKED','IMAGE_ROOTFS_ALIGNMENT','IMAGE_OVERHEAD_FACTOR','IMAGE_ROOTFS_SIZE','IMAGE_ROOTFS_EXTRA_SPACE', |
| 118 | 'IMAGE_ROOTFS_MAXSIZE','IMAGE_NAME','IMAGE_LINK_NAME','IMAGE_MANIFEST','DEPLOY_DIR_IMAGE','IMAGE_FSTYPES','IMAGE_INSTALL_COMPLEMENTARY','IMAGE_LINGUAS', |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 119 | 'MULTILIBRE_ALLOW_REP','MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS', |
| 120 | 'PACKAGE_ARCHS','PACKAGE_CLASSES','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','USE_DEVFS', |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 121 | 'CONVERSIONTYPES', 'IMAGE_GEN_DEBUGFS', 'ROOTFS_RO_UNNEEDED', 'IMGDEPLOYDIR', 'PACKAGE_EXCLUDE_COMPLEMENTARY'] |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 122 | variables.extend(rootfs_command_variables(d)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 123 | variables.extend(variable_depends(d)) |
| 124 | return " ".join(variables) |
| 125 | |
| 126 | do_rootfs[vardeps] += "${@rootfs_variables(d)}" |
| 127 | |
| 128 | do_build[depends] += "virtual/kernel:do_deploy" |
| 129 | |
| 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)) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 134 | if d.getVar('NOISO') == "0" or d.getVar('NOHDD') == "0": |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 135 | return "image-live" |
| 136 | return "" |
| 137 | return "image-live" |
| 138 | |
| 139 | IMAGE_TYPE_live = "${@build_live(d)}" |
| 140 | inherit ${IMAGE_TYPE_live} |
| 141 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 142 | IMAGE_TYPE_vm = '${@bb.utils.contains_any("IMAGE_FSTYPES", ["vmdk", "vdi", "qcow2", "hdddirect"], "image-vm", "", d)}' |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 143 | inherit ${IMAGE_TYPE_vm} |
| 144 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 145 | IMAGE_TYPE_container = '${@bb.utils.contains("IMAGE_FSTYPES", "container", "image-container", "", d)}' |
| 146 | inherit ${IMAGE_TYPE_container} |
| 147 | |
| 148 | IMAGE_TYPE_wic = "image_types_wic" |
| 149 | inherit ${IMAGE_TYPE_wic} |
| 150 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 151 | python () { |
| 152 | deps = " " + imagetypes_getdepends(d) |
| 153 | d.appendVarFlag('do_rootfs', 'depends', deps) |
| 154 | |
| 155 | deps = "" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 156 | for dep in (d.getVar('EXTRA_IMAGEDEPENDS') or "").split(): |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 157 | deps += " %s:do_populate_sysroot" % dep |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 158 | d.appendVarFlag('do_image_complete', 'depends', deps) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 159 | |
| 160 | #process IMAGE_FEATURES, we must do this before runtime_mapping_rename |
| 161 | #Check for replaces image features |
| 162 | features = set(oe.data.typed_value('IMAGE_FEATURES', d)) |
| 163 | remain_features = features.copy() |
| 164 | for feature in features: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 165 | replaces = set((d.getVar("IMAGE_FEATURES_REPLACES_%s" % feature) or "").split()) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 166 | remain_features -= replaces |
| 167 | |
| 168 | #Check for conflict image features |
| 169 | for feature in remain_features: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 170 | conflicts = set((d.getVar("IMAGE_FEATURES_CONFLICTS_%s" % feature) or "").split()) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 171 | temp = conflicts & remain_features |
| 172 | if temp: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 173 | bb.fatal("%s contains conflicting IMAGE_FEATURES %s %s" % (d.getVar('PN'), feature, ' '.join(list(temp)))) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 174 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 175 | d.setVar('IMAGE_FEATURES', ' '.join(sorted(list(remain_features)))) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 176 | |
| 177 | check_image_features(d) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | IMAGE_CLASSES += "image_types" |
| 181 | inherit ${IMAGE_CLASSES} |
| 182 | |
| 183 | IMAGE_POSTPROCESS_COMMAND ?= "" |
| 184 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 185 | # some default locales |
| 186 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" |
| 187 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 188 | LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS').split()))}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 189 | |
| 190 | # Prefer image, but use the fallback files for lookups if the image ones |
| 191 | # aren't yet available. |
| 192 | PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}" |
| 193 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 194 | inherit rootfs-postcommands |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 195 | |
| 196 | PACKAGE_EXCLUDE ??= "" |
| 197 | PACKAGE_EXCLUDE[type] = "list" |
| 198 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 199 | fakeroot python do_rootfs () { |
| 200 | from oe.rootfs import create_rootfs |
| 201 | from oe.manifest import create_manifest |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 202 | import logging |
| 203 | |
| 204 | logger = d.getVar('BB_TASK_LOGGER', False) |
| 205 | if logger: |
| 206 | logcatcher = bb.utils.LogCatcher() |
| 207 | logger.addHandler(logcatcher) |
| 208 | else: |
| 209 | logcatcher = None |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 210 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 211 | # NOTE: if you add, remove or significantly refactor the stages of this |
| 212 | # process then you should recalculate the weightings here. This is quite |
| 213 | # easy to do - just change the MultiStageProgressReporter line temporarily |
| 214 | # to pass debug=True as the last parameter and you'll get a printout of |
| 215 | # the weightings as well as a map to the lines where next_stage() was |
| 216 | # called. Of course this isn't critical, but it helps to keep the progress |
| 217 | # reporting accurate. |
| 218 | stage_weights = [1, 203, 354, 186, 65, 4228, 1, 353, 49, 330, 382, 23, 1] |
| 219 | progress_reporter = bb.progress.MultiStageProgressReporter(d, stage_weights) |
| 220 | progress_reporter.next_stage() |
| 221 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 222 | # Handle package exclusions |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 223 | excl_pkgs = d.getVar("PACKAGE_EXCLUDE").split() |
| 224 | inst_pkgs = d.getVar("PACKAGE_INSTALL").split() |
| 225 | inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY").split() |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 226 | |
| 227 | d.setVar('PACKAGE_INSTALL_ORIG', ' '.join(inst_pkgs)) |
| 228 | d.setVar('PACKAGE_INSTALL_ATTEMPTONLY', ' '.join(inst_attempt_pkgs)) |
| 229 | |
| 230 | for pkg in excl_pkgs: |
| 231 | if pkg in inst_pkgs: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 232 | bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL (%s). It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 233 | inst_pkgs.remove(pkg) |
| 234 | |
| 235 | if pkg in inst_attempt_pkgs: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 236 | bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL_ATTEMPTONLY (%s). It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 237 | inst_attempt_pkgs.remove(pkg) |
| 238 | |
| 239 | d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs)) |
| 240 | d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 241 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 242 | # Ensure we handle package name remapping |
| 243 | # We have to delay the runtime_mapping_rename until just before rootfs runs |
| 244 | # otherwise, the multilib renaming could step in and squash any fixups that |
| 245 | # may have occurred. |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 246 | pn = d.getVar('PN') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 247 | runtime_mapping_rename("PACKAGE_INSTALL", pn, d) |
| 248 | runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d) |
| 249 | runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 250 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 251 | # Generate the initial manifest |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 252 | create_manifest(d) |
| 253 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 254 | progress_reporter.next_stage() |
| 255 | |
| 256 | # generate rootfs |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 257 | create_rootfs(d, progress_reporter=progress_reporter, logcatcher=logcatcher) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 258 | |
| 259 | progress_reporter.finish() |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 260 | } |
| 261 | do_rootfs[dirs] = "${TOPDIR}" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 262 | do_rootfs[cleandirs] += "${S} ${IMGDEPLOYDIR}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 263 | do_rootfs[umask] = "022" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 264 | addtask rootfs before do_build after do_prepare_recipe_sysroot |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 265 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 266 | fakeroot python do_image () { |
| 267 | from oe.utils import execute_pre_post_process |
| 268 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 269 | pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND") |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 270 | |
| 271 | execute_pre_post_process(d, pre_process_cmds) |
| 272 | } |
| 273 | do_image[dirs] = "${TOPDIR}" |
| 274 | do_image[umask] = "022" |
| 275 | addtask do_image after do_rootfs before do_build |
| 276 | |
| 277 | fakeroot python do_image_complete () { |
| 278 | from oe.utils import execute_pre_post_process |
| 279 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 280 | post_process_cmds = d.getVar("IMAGE_POSTPROCESS_COMMAND") |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 281 | |
| 282 | execute_pre_post_process(d, post_process_cmds) |
| 283 | } |
| 284 | do_image_complete[dirs] = "${TOPDIR}" |
| 285 | do_image_complete[umask] = "022" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 286 | SSTATETASKS += "do_image_complete" |
| 287 | SSTATE_SKIP_CREATION_task-image-complete = '1' |
| 288 | do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}" |
| 289 | do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" |
| 290 | do_image_complete[stamp-extra-info] = "${MACHINE}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 291 | addtask do_image_complete after do_image before do_build |
| 292 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 293 | # Add image-level QA/sanity checks to IMAGE_QA_COMMANDS |
| 294 | # |
| 295 | # IMAGE_QA_COMMANDS += " \ |
| 296 | # image_check_everything_ok \ |
| 297 | # " |
| 298 | # This task runs all functions in IMAGE_QA_COMMANDS after the image |
| 299 | # construction has completed in order to validate the resulting image. |
| 300 | fakeroot python do_image_qa () { |
| 301 | from oe.utils import ImageQAFailed |
| 302 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 303 | qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split() |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 304 | qamsg = "" |
| 305 | |
| 306 | for cmd in qa_cmds: |
| 307 | try: |
| 308 | bb.build.exec_func(cmd, d) |
| 309 | except oe.utils.ImageQAFailed as e: |
| 310 | qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (e.name, e.description) |
| 311 | except bb.build.FuncFailed as e: |
| 312 | qamsg = qamsg + '\tImage QA function %s failed' % e.name |
| 313 | if e.logfile: |
| 314 | qamsg = qamsg + ' (log file is located at %s)' % e.logfile |
| 315 | qamsg = qamsg + '\n' |
| 316 | |
| 317 | if qamsg: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 318 | imgname = d.getVar('IMAGE_NAME') |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 319 | bb.fatal("QA errors found whilst validating image: %s\n%s" % (imgname, qamsg)) |
| 320 | } |
| 321 | addtask do_image_qa after do_image_complete before do_build |
| 322 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 323 | def setup_debugfs_variables(d): |
| 324 | d.appendVar('IMAGE_ROOTFS', '-dbg') |
| 325 | d.appendVar('IMAGE_LINK_NAME', '-dbg') |
| 326 | d.appendVar('IMAGE_NAME','-dbg') |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 327 | d.setVar('IMAGE_BUILDING_DEBUGFS', 'true') |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 328 | debugfs_image_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS') |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 329 | if debugfs_image_fstypes: |
| 330 | d.setVar('IMAGE_FSTYPES', debugfs_image_fstypes) |
| 331 | |
| 332 | python setup_debugfs () { |
| 333 | setup_debugfs_variables(d) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 334 | } |
| 335 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 336 | python () { |
| 337 | vardeps = set() |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 338 | # We allow CONVERSIONTYPES to have duplicates. That avoids breaking |
| 339 | # derived distros when OE-core or some other layer independently adds |
| 340 | # the same type. There is still only one command for each type, but |
| 341 | # presumably the commands will do the same when the type is the same, |
| 342 | # even when added in different places. |
| 343 | # |
| 344 | # Without de-duplication, gen_conversion_cmds() below |
| 345 | # would create the same compression command multiple times. |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 346 | ctypes = set(d.getVar('CONVERSIONTYPES').split()) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 347 | old_overrides = d.getVar('OVERRIDES', False) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 348 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 349 | def _image_base_type(type): |
| 350 | basetype = type |
| 351 | for ctype in ctypes: |
| 352 | if type.endswith("." + ctype): |
| 353 | basetype = type[:-len("." + ctype)] |
| 354 | break |
| 355 | |
| 356 | if basetype != type: |
| 357 | # New base type itself might be generated by a conversion command. |
| 358 | basetype = _image_base_type(basetype) |
| 359 | |
| 360 | return basetype |
| 361 | |
| 362 | basetypes = {} |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 363 | alltypes = d.getVar('IMAGE_FSTYPES').split() |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 364 | typedeps = {} |
| 365 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 366 | if d.getVar('IMAGE_GEN_DEBUGFS') == "1": |
| 367 | debugfs_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS').split() |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 368 | for t in debugfs_fstypes: |
| 369 | alltypes.append("debugfs_" + t) |
| 370 | |
| 371 | def _add_type(t): |
| 372 | baset = _image_base_type(t) |
| 373 | input_t = t |
| 374 | if baset not in basetypes: |
| 375 | basetypes[baset]= [] |
| 376 | if t not in basetypes[baset]: |
| 377 | basetypes[baset].append(t) |
| 378 | debug = "" |
| 379 | if t.startswith("debugfs_"): |
| 380 | t = t[8:] |
| 381 | debug = "debugfs_" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 382 | deps = (d.getVar('IMAGE_TYPEDEP_' + t) or "").split() |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 383 | vardeps.add('IMAGE_TYPEDEP_' + t) |
| 384 | if baset not in typedeps: |
| 385 | typedeps[baset] = set() |
| 386 | deps = [debug + dep for dep in deps] |
| 387 | for dep in deps: |
| 388 | if dep not in alltypes: |
| 389 | alltypes.append(dep) |
| 390 | _add_type(dep) |
| 391 | basedep = _image_base_type(dep) |
| 392 | typedeps[baset].add(basedep) |
| 393 | |
| 394 | if baset != input_t: |
| 395 | _add_type(baset) |
| 396 | |
| 397 | for t in alltypes[:]: |
| 398 | _add_type(t) |
| 399 | |
| 400 | d.appendVarFlag('do_image', 'vardeps', ' '.join(vardeps)) |
| 401 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 402 | maskedtypes = (d.getVar('IMAGE_TYPES_MASKED') or "").split() |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 403 | maskedtypes = [dbg + t for t in maskedtypes for dbg in ("", "debugfs_")] |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 404 | |
| 405 | for t in basetypes: |
| 406 | vardeps = set() |
| 407 | cmds = [] |
| 408 | subimages = [] |
| 409 | realt = t |
| 410 | |
| 411 | if t in maskedtypes: |
| 412 | continue |
| 413 | |
| 414 | localdata = bb.data.createCopy(d) |
| 415 | debug = "" |
| 416 | if t.startswith("debugfs_"): |
| 417 | setup_debugfs_variables(localdata) |
| 418 | debug = "setup_debugfs " |
| 419 | realt = t[8:] |
| 420 | localdata.setVar('OVERRIDES', '%s:%s' % (realt, old_overrides)) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 421 | localdata.setVar('type', realt) |
| 422 | # Delete DATETIME so we don't expand any references to it now |
| 423 | # This means the task's hash can be stable rather than having hardcoded |
| 424 | # date/time values. It will get expanded at execution time. |
| 425 | # Similarly TMPDIR since otherwise we see QA stamp comparision problems |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 426 | # Expand PV else it can trigger get_srcrev which can fail due to these variables being unset |
| 427 | localdata.setVar('PV', d.getVar('PV')) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 428 | localdata.delVar('DATETIME') |
| 429 | localdata.delVar('TMPDIR') |
| 430 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 431 | image_cmd = localdata.getVar("IMAGE_CMD") |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 432 | vardeps.add('IMAGE_CMD_' + realt) |
| 433 | if image_cmd: |
| 434 | cmds.append("\t" + image_cmd) |
| 435 | else: |
| 436 | bb.fatal("No IMAGE_CMD defined for IMAGE_FSTYPES entry '%s' - possibly invalid type name or missing support class" % t) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 437 | cmds.append(localdata.expand("\tcd ${IMGDEPLOYDIR}")) |
| 438 | |
| 439 | # Since a copy of IMAGE_CMD_xxx will be inlined within do_image_xxx, |
| 440 | # prevent a redundant copy of IMAGE_CMD_xxx being emitted as a function. |
| 441 | d.delVarFlag('IMAGE_CMD_' + realt, 'func') |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 442 | |
| 443 | rm_tmp_images = set() |
| 444 | def gen_conversion_cmds(bt): |
Gerson Fernando Budke | 3c4c45d | 2017-09-19 14:15:36 -0300 | [diff] [blame] | 445 | for ctype in sorted(ctypes): |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 446 | if bt.endswith("." + ctype): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 447 | type = bt[0:-len(ctype) - 1] |
| 448 | if type.startswith("debugfs_"): |
| 449 | type = type[8:] |
| 450 | # Create input image first. |
| 451 | gen_conversion_cmds(type) |
| 452 | localdata.setVar('type', type) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 453 | cmd = "\t" + (localdata.getVar("CONVERSION_CMD_" + ctype) or localdata.getVar("COMPRESS_CMD_" + ctype)) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 454 | if cmd not in cmds: |
| 455 | cmds.append(cmd) |
| 456 | vardeps.add('CONVERSION_CMD_' + ctype) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 457 | vardeps.add('COMPRESS_CMD_' + ctype) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 458 | subimage = type + "." + ctype |
| 459 | if subimage not in subimages: |
| 460 | subimages.append(subimage) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 461 | if type not in alltypes: |
| 462 | rm_tmp_images.add(localdata.expand("${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}")) |
| 463 | |
| 464 | for bt in basetypes[t]: |
| 465 | gen_conversion_cmds(bt) |
| 466 | |
| 467 | localdata.setVar('type', realt) |
| 468 | if t not in alltypes: |
| 469 | rm_tmp_images.add(localdata.expand("${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}")) |
| 470 | else: |
| 471 | subimages.append(realt) |
| 472 | |
| 473 | # Clean up after applying all conversion commands. Some of them might |
| 474 | # use the same input, therefore we cannot delete sooner without applying |
| 475 | # some complex dependency analysis. |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 476 | for image in sorted(rm_tmp_images): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 477 | cmds.append("\trm " + image) |
| 478 | |
| 479 | after = 'do_image' |
| 480 | for dep in typedeps[t]: |
| 481 | after += ' do_image_%s' % dep.replace("-", "_").replace(".", "_") |
| 482 | |
| 483 | t = t.replace("-", "_").replace(".", "_") |
| 484 | |
| 485 | d.setVar('do_image_%s' % t, '\n'.join(cmds)) |
| 486 | d.setVarFlag('do_image_%s' % t, 'func', '1') |
| 487 | d.setVarFlag('do_image_%s' % t, 'fakeroot', '1') |
| 488 | d.setVarFlag('do_image_%s' % t, 'prefuncs', debug + 'set_image_size') |
| 489 | d.setVarFlag('do_image_%s' % t, 'postfuncs', 'create_symlinks') |
| 490 | d.setVarFlag('do_image_%s' % t, 'subimages', ' '.join(subimages)) |
| 491 | d.appendVarFlag('do_image_%s' % t, 'vardeps', ' '.join(vardeps)) |
| 492 | d.appendVarFlag('do_image_%s' % t, 'vardepsexclude', 'DATETIME') |
| 493 | |
| 494 | bb.debug(2, "Adding type %s before %s, after %s" % (t, 'do_image_complete', after)) |
| 495 | bb.build.addtask('do_image_%s' % t, 'do_image_complete', after, d) |
| 496 | } |
| 497 | |
| 498 | # |
| 499 | # Compute the rootfs size |
| 500 | # |
| 501 | def get_rootfs_size(d): |
| 502 | import subprocess |
| 503 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 504 | rootfs_alignment = int(d.getVar('IMAGE_ROOTFS_ALIGNMENT')) |
| 505 | overhead_factor = float(d.getVar('IMAGE_OVERHEAD_FACTOR')) |
| 506 | rootfs_req_size = int(d.getVar('IMAGE_ROOTFS_SIZE')) |
| 507 | rootfs_extra_space = eval(d.getVar('IMAGE_ROOTFS_EXTRA_SPACE')) |
| 508 | rootfs_maxsize = d.getVar('IMAGE_ROOTFS_MAXSIZE') |
| 509 | image_fstypes = d.getVar('IMAGE_FSTYPES') or '' |
| 510 | initramfs_fstypes = d.getVar('INITRAMFS_FSTYPES') or '' |
| 511 | initramfs_maxsize = d.getVar('INITRAMFS_MAXSIZE') |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 512 | |
| 513 | output = subprocess.check_output(['du', '-ks', |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 514 | d.getVar('IMAGE_ROOTFS')]) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 515 | size_kb = int(output.split()[0]) |
| 516 | base_size = size_kb * overhead_factor |
| 517 | base_size = max(base_size, rootfs_req_size) + rootfs_extra_space |
| 518 | |
| 519 | if base_size != int(base_size): |
| 520 | base_size = int(base_size + 1) |
| 521 | else: |
| 522 | base_size = int(base_size) |
| 523 | |
| 524 | base_size += rootfs_alignment - 1 |
| 525 | base_size -= base_size % rootfs_alignment |
| 526 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 527 | # Do not check image size of the debugfs image. This is not supposed |
| 528 | # to be deployed, etc. so it doesn't make sense to limit the size |
| 529 | # of the debug. |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 530 | if (d.getVar('IMAGE_BUILDING_DEBUGFS') or "") == "true": |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 531 | return base_size |
| 532 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 533 | # Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set) |
| 534 | if rootfs_maxsize: |
| 535 | rootfs_maxsize_int = int(rootfs_maxsize) |
| 536 | if base_size > rootfs_maxsize_int: |
| 537 | bb.fatal("The rootfs size %d(K) overrides IMAGE_ROOTFS_MAXSIZE: %d(K)" % \ |
| 538 | (base_size, rootfs_maxsize_int)) |
| 539 | |
| 540 | # Check the initramfs size against INITRAMFS_MAXSIZE (if set) |
| 541 | if image_fstypes == initramfs_fstypes != '' and initramfs_maxsize: |
| 542 | initramfs_maxsize_int = int(initramfs_maxsize) |
| 543 | if base_size > initramfs_maxsize_int: |
| 544 | bb.error("The initramfs size %d(K) overrides INITRAMFS_MAXSIZE: %d(K)" % \ |
| 545 | (base_size, initramfs_maxsize_int)) |
| 546 | bb.error("You can set INITRAMFS_MAXSIZE a larger value. Usually, it should") |
| 547 | bb.fatal("be less than 1/2 of ram size, or you may fail to boot it.\n") |
| 548 | return base_size |
| 549 | |
| 550 | python set_image_size () { |
| 551 | rootfs_size = get_rootfs_size(d) |
| 552 | d.setVar('ROOTFS_SIZE', str(rootfs_size)) |
| 553 | d.setVarFlag('ROOTFS_SIZE', 'export', '1') |
| 554 | } |
| 555 | |
| 556 | # |
| 557 | # Create symlinks to the newly created image |
| 558 | # |
| 559 | python create_symlinks() { |
| 560 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 561 | deploy_dir = d.getVar('IMGDEPLOYDIR') |
| 562 | img_name = d.getVar('IMAGE_NAME') |
| 563 | link_name = d.getVar('IMAGE_LINK_NAME') |
| 564 | manifest_name = d.getVar('IMAGE_MANIFEST') |
| 565 | taskname = d.getVar("BB_CURRENTTASK") |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 566 | subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split() |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 567 | imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix') or d.expand("${IMAGE_NAME_SUFFIX}.") |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 568 | |
| 569 | if not link_name: |
| 570 | return |
| 571 | for type in subimages: |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 572 | dst = os.path.join(deploy_dir, link_name + "." + type) |
| 573 | src = img_name + imgsuffix + type |
| 574 | if os.path.exists(os.path.join(deploy_dir, src)): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 575 | bb.note("Creating symlink: %s -> %s" % (dst, src)) |
| 576 | if os.path.islink(dst): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 577 | os.remove(dst) |
| 578 | os.symlink(src, dst) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 579 | else: |
| 580 | bb.note("Skipping symlink, source does not exist: %s -> %s" % (dst, src)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 581 | } |
| 582 | |
| 583 | MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|${sysconfdir}|${nonarch_base_libdir}/udev|/lib/modules/[^/]*/modules.*|" |
| 584 | MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py" |
| 585 | MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib" |
| 586 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 587 | do_fetch[noexec] = "1" |
| 588 | do_unpack[noexec] = "1" |
| 589 | do_patch[noexec] = "1" |
| 590 | do_configure[noexec] = "1" |
| 591 | do_compile[noexec] = "1" |
| 592 | do_install[noexec] = "1" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 593 | deltask do_populate_sysroot |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 594 | do_package[noexec] = "1" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 595 | deltask do_package_qa |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 596 | do_packagedata[noexec] = "1" |
| 597 | do_package_write_ipk[noexec] = "1" |
| 598 | do_package_write_deb[noexec] = "1" |
| 599 | do_package_write_rpm[noexec] = "1" |
| 600 | |