diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-05 17:52:55 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-06 15:27:33 +0000 |
commit | 401c632508d7e6700d1a68b6bfa9eda349cc720e (patch) | |
tree | 0758f1dea00f2a8ac141424745ca156cb279b3f9 | |
parent | 0051510ae3e8f5d4dcd1f074bba1bd9c7e2362d9 (diff) | |
download | poky-401c632508d7e6700d1a68b6bfa9eda349cc720e.tar.gz |
image: Condense do_rootfs function/flags
Various prefuncs and flags and addtask statements make sense to belong together
in one clearer function now, this patch cleans things up a bit.
(From OE-Core rev: eae0cf7875197f9520be54370bc670e27338aad3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/image.bbclass | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index da64cadd3a..81971fefef 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -191,8 +191,6 @@ inherit ${IMAGE_CLASSES} | |||
191 | 191 | ||
192 | IMAGE_POSTPROCESS_COMMAND ?= "" | 192 | IMAGE_POSTPROCESS_COMMAND ?= "" |
193 | 193 | ||
194 | |||
195 | |||
196 | # some default locales | 194 | # some default locales |
197 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" | 195 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" |
198 | 196 | ||
@@ -202,19 +200,17 @@ LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IM | |||
202 | # aren't yet available. | 200 | # aren't yet available. |
203 | PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}" | 201 | PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}" |
204 | 202 | ||
205 | do_rootfs[dirs] = "${TOPDIR}" | ||
206 | do_rootfs[cleandirs] += "${S}" | ||
207 | |||
208 | # Must call real_do_rootfs() from inside here, rather than as a separate | ||
209 | # task, so that we have a single fakeroot context for the whole process. | ||
210 | do_rootfs[umask] = "022" | ||
211 | |||
212 | inherit rootfs-postcommands | 203 | inherit rootfs-postcommands |
213 | 204 | ||
214 | PACKAGE_EXCLUDE ??= "" | 205 | PACKAGE_EXCLUDE ??= "" |
215 | PACKAGE_EXCLUDE[type] = "list" | 206 | PACKAGE_EXCLUDE[type] = "list" |
216 | 207 | ||
217 | python rootfs_process_ignore() { | 208 | fakeroot python do_rootfs () { |
209 | from oe.rootfs import create_rootfs | ||
210 | from oe.image import create_image | ||
211 | from oe.manifest import create_manifest | ||
212 | |||
213 | # Handle package exclusions | ||
218 | excl_pkgs = d.getVar("PACKAGE_EXCLUDE", True).split() | 214 | excl_pkgs = d.getVar("PACKAGE_EXCLUDE", True).split() |
219 | inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split() | 215 | inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split() |
220 | inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY", True).split() | 216 | inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY", True).split() |
@@ -233,40 +229,35 @@ python rootfs_process_ignore() { | |||
233 | 229 | ||
234 | d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs)) | 230 | d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs)) |
235 | d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs)) | 231 | d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs)) |
236 | } | ||
237 | do_rootfs[prefuncs] += "rootfs_process_ignore" | ||
238 | 232 | ||
239 | # We have to delay the runtime_mapping_rename until just before rootfs runs | 233 | # Ensure we handle package name remapping |
240 | # otherwise, the multilib renaming could step in and squash any fixups that | 234 | # We have to delay the runtime_mapping_rename until just before rootfs runs |
241 | # may have occurred. | 235 | # otherwise, the multilib renaming could step in and squash any fixups that |
242 | python rootfs_runtime_mapping() { | 236 | # may have occurred. |
243 | pn = d.getVar('PN', True) | 237 | pn = d.getVar('PN', True) |
244 | runtime_mapping_rename("PACKAGE_INSTALL", pn, d) | 238 | runtime_mapping_rename("PACKAGE_INSTALL", pn, d) |
245 | runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d) | 239 | runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d) |
246 | runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d) | 240 | runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d) |
247 | } | ||
248 | do_rootfs[prefuncs] += "rootfs_runtime_mapping" | ||
249 | |||
250 | fakeroot python do_rootfs () { | ||
251 | from oe.rootfs import create_rootfs | ||
252 | from oe.image import create_image | ||
253 | from oe.manifest import create_manifest | ||
254 | 241 | ||
255 | # generate the initial manifest | 242 | # Generate the initial manifest |
256 | create_manifest(d) | 243 | create_manifest(d) |
257 | 244 | ||
258 | # generate rootfs | 245 | # Generate rootfs |
259 | create_rootfs(d) | 246 | create_rootfs(d) |
260 | 247 | ||
261 | # generate final images | 248 | # generate final images |
262 | create_image(d) | 249 | create_image(d) |
263 | } | 250 | } |
251 | do_rootfs[dirs] = "${TOPDIR}" | ||
252 | do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock" | ||
253 | do_rootfs[cleandirs] += "${S}" | ||
254 | do_rootfs[umask] = "022" | ||
255 | addtask rootfs before do_build | ||
264 | 256 | ||
265 | MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|${sysconfdir}|${nonarch_base_libdir}/udev|/lib/modules/[^/]*/modules.*|" | 257 | MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|${sysconfdir}|${nonarch_base_libdir}/udev|/lib/modules/[^/]*/modules.*|" |
266 | MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py" | 258 | MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py" |
267 | MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib" | 259 | MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib" |
268 | 260 | ||
269 | |||
270 | do_fetch[noexec] = "1" | 261 | do_fetch[noexec] = "1" |
271 | do_unpack[noexec] = "1" | 262 | do_unpack[noexec] = "1" |
272 | do_patch[noexec] = "1" | 263 | do_patch[noexec] = "1" |
@@ -281,7 +272,6 @@ do_package_write_ipk[noexec] = "1" | |||
281 | do_package_write_deb[noexec] = "1" | 272 | do_package_write_deb[noexec] = "1" |
282 | do_package_write_rpm[noexec] = "1" | 273 | do_package_write_rpm[noexec] = "1" |
283 | 274 | ||
284 | addtask rootfs before do_build | ||
285 | # Allow the kernel to be repacked with the initramfs and boot image file as a single file | 275 | # Allow the kernel to be repacked with the initramfs and boot image file as a single file |
286 | do_bundle_initramfs[depends] += "virtual/kernel:do_bundle_initramfs" | 276 | do_bundle_initramfs[depends] += "virtual/kernel:do_bundle_initramfs" |
287 | do_bundle_initramfs[nostamp] = "1" | 277 | do_bundle_initramfs[nostamp] = "1" |