summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs-postcommands.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-06 22:57:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-11 23:26:29 +0000
commit0a4e1f968ada5099e3270ed06404d2827e9729aa (patch)
treec805d6d23f593e8647b21de154d8a5fe181cb02c /meta/classes/rootfs-postcommands.bbclass
parentfdced52387613a09368716d1f3bb7a13a6edd46d (diff)
downloadpoky-0a4e1f968ada5099e3270ed06404d2827e9729aa.tar.gz
image: Create separate tasks for rootfs construction
This patch splits the code in lib/oe/image into separate tasks, one per image type. This removes the need for the simple task graph code and defers to the bitbake task management code to handle this instead. This is a good step forward in splitting up the monolithic code and starting to make it more accessible to people. It should also make it easier for people to hook in other tasks and processes into the rootfs code. Incidentally, the reason this code was all combined originally was due to limitations of fakeroot where if you exited the session, you lost permissions data. With pseudo this constraint was removed. We did start to rework the rootfs/image code previously and got so far with untangling it however we did prioritise some performance tweaks over splitting into separate tasks and in hindsight, this was a mistake and should have been done the other way around. That work was suspended due to changes in the people working on the project but this split has always been intended, now is the time to finish it IMO. There were some side effects of doing this: * The symlink for the manifest moves to the rootfs-postcommands class and into the manifest function. * There is no seperate "symlink removal" and "symlink creation", they are merged * The date/time stamps of the manifest and the built images can now be different since the tasks can be run separately and the datetime stamp will then be different between do_rootfs and the do_image_* tasks. (From OE-Core rev: c2dab181c1cdabac3be6197f4b9ea4235cbbc140) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfs-postcommands.bbclass')
-rw-r--r--meta/classes/rootfs-postcommands.bbclass13
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 7c440acf00..96d3051429 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -207,9 +207,20 @@ insert_feed_uris () {
207 207
208python write_image_manifest () { 208python write_image_manifest () {
209 from oe.rootfs import image_list_installed_packages 209 from oe.rootfs import image_list_installed_packages
210 with open(d.getVar('IMAGE_MANIFEST', True), 'w+') as image_manifest: 210
211 deploy_dir = d.getVar('DEPLOY_DIR_IMAGE', True)
212 link_name = d.getVar('IMAGE_LINK_NAME', True)
213 manifest_name = d.getVar('IMAGE_MANIFEST', True)
214
215 with open(manifest_name, 'w+') as image_manifest:
211 image_manifest.write(image_list_installed_packages(d, 'ver')) 216 image_manifest.write(image_list_installed_packages(d, 'ver'))
212 image_manifest.write("\n") 217 image_manifest.write("\n")
218
219 if manifest_name is not None and os.path.exists(manifest_name):
220 manifest_link = deploy_dir + "/" + link_name + ".manifest"
221 if os.path.exists(manifest_link):
222 os.remove(manifest_link)
223 os.symlink(os.path.basename(manifest_name), manifest_link)
213} 224}
214 225
215# Can be use to create /etc/timestamp during image construction to give a reasonably 226# Can be use to create /etc/timestamp during image construction to give a reasonably