summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-05 17:52:55 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-06 15:27:33 +0000
commit401c632508d7e6700d1a68b6bfa9eda349cc720e (patch)
tree0758f1dea00f2a8ac141424745ca156cb279b3f9 /meta/classes/image.bbclass
parent0051510ae3e8f5d4dcd1f074bba1bd9c7e2362d9 (diff)
downloadpoky-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>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass44
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
192IMAGE_POSTPROCESS_COMMAND ?= "" 192IMAGE_POSTPROCESS_COMMAND ?= ""
193 193
194
195
196# some default locales 194# some default locales
197IMAGE_LINGUAS ?= "de-de fr-fr en-gb" 195IMAGE_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.
203PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}" 201PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}"
204 202
205do_rootfs[dirs] = "${TOPDIR}"
206do_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.
210do_rootfs[umask] = "022"
211
212inherit rootfs-postcommands 203inherit rootfs-postcommands
213 204
214PACKAGE_EXCLUDE ??= "" 205PACKAGE_EXCLUDE ??= ""
215PACKAGE_EXCLUDE[type] = "list" 206PACKAGE_EXCLUDE[type] = "list"
216 207
217python rootfs_process_ignore() { 208fakeroot 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}
237do_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
242python 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}
248do_rootfs[prefuncs] += "rootfs_runtime_mapping"
249
250fakeroot 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}
251do_rootfs[dirs] = "${TOPDIR}"
252do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
253do_rootfs[cleandirs] += "${S}"
254do_rootfs[umask] = "022"
255addtask rootfs before do_build
264 256
265MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|${sysconfdir}|${nonarch_base_libdir}/udev|/lib/modules/[^/]*/modules.*|" 257MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|${sysconfdir}|${nonarch_base_libdir}/udev|/lib/modules/[^/]*/modules.*|"
266MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py" 258MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py"
267MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib" 259MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib"
268 260
269
270do_fetch[noexec] = "1" 261do_fetch[noexec] = "1"
271do_unpack[noexec] = "1" 262do_unpack[noexec] = "1"
272do_patch[noexec] = "1" 263do_patch[noexec] = "1"
@@ -281,7 +272,6 @@ do_package_write_ipk[noexec] = "1"
281do_package_write_deb[noexec] = "1" 272do_package_write_deb[noexec] = "1"
282do_package_write_rpm[noexec] = "1" 273do_package_write_rpm[noexec] = "1"
283 274
284addtask 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
286do_bundle_initramfs[depends] += "virtual/kernel:do_bundle_initramfs" 276do_bundle_initramfs[depends] += "virtual/kernel:do_bundle_initramfs"
287do_bundle_initramfs[nostamp] = "1" 277do_bundle_initramfs[nostamp] = "1"