diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2020-04-25 22:15:39 +0000 |
---|---|---|
committer | Laurent Bonnans <laurent.bonnans@here.com> | 2020-06-02 12:02:33 +0200 |
commit | 38c99b68929d00064978d69ced2d763e66501bdc (patch) | |
tree | b195e1ebfd26911d3f1fa83b325f0030f58a65f5 | |
parent | bfc257df1e74d4ff530636322b916271c6380e4c (diff) | |
download | meta-updater-38c99b68929d00064978d69ced2d763e66501bdc.tar.gz |
image_types_ostree: use hardlink tree
Instead of copying the files to be commited to the ostree just use a
hardlink tree. This improves performance and wasts less diskspace.
When using this method the root directory has already the correct
permission bits set. Also get rid of the unnecessary sync. This halfs
the execution time of the do_image_ostree tasks in my measurments.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r-- | classes/image_types_ostree.bbclass | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index a3eae24..7275867 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -19,14 +19,24 @@ CONVERSIONTYPES_append = " tar" | |||
19 | 19 | ||
20 | REQUIRED_DISTRO_FEATURES = "usrmerge" | 20 | REQUIRED_DISTRO_FEATURES = "usrmerge" |
21 | TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}" | 21 | TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}" |
22 | |||
23 | python prepare_ostree_rootfs() { | ||
24 | import oe.path | ||
25 | import shutil | ||
26 | |||
27 | ostree_rootfs = d.getVar("OSTREE_ROOTFS") | ||
28 | if os.path.lexists(ostree_rootfs): | ||
29 | bb.utils.remove(ostree_rootfs, True) | ||
30 | |||
31 | # Copy required as we change permissions on some files. | ||
32 | image_rootfs = d.getVar("IMAGE_ROOTFS") | ||
33 | oe.path.copyhardlinktree(image_rootfs, ostree_rootfs) | ||
34 | } | ||
35 | |||
22 | do_image_ostree[dirs] = "${OSTREE_ROOTFS}" | 36 | do_image_ostree[dirs] = "${OSTREE_ROOTFS}" |
23 | do_image_ostree[cleandirs] = "${OSTREE_ROOTFS}" | 37 | do_image_ostree[prefuncs] += "prepare_ostree_rootfs" |
24 | do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete" | 38 | do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete" |
25 | IMAGE_CMD_ostree () { | 39 | IMAGE_CMD_ostree () { |
26 | cp -a ${IMAGE_ROOTFS}/* ${OSTREE_ROOTFS} | ||
27 | chmod a+rx ${OSTREE_ROOTFS} | ||
28 | sync | ||
29 | |||
30 | for d in var/*; do | 40 | for d in var/*; do |
31 | if [ "${d}" != "var/local" ]; then | 41 | if [ "${d}" != "var/local" ]; then |
32 | rm -rf ${d} | 42 | rm -rf ${d} |