summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2020-04-25 22:15:39 +0000
committerStefan Agner <stefan.agner@toradex.com>2020-04-27 07:42:22 +0000
commitc60b6bb82e7121635ce3f7119927e8704fe03f0f (patch)
tree0ee93f7ca1dcbed5740bda9173c2dba05f9dcc5f
parent34b1e543c91cfb89c29687c799ac941085d83307 (diff)
downloadmeta-updater-c60b6bb82e7121635ce3f7119927e8704fe03f0f.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.bbclass20
1 files changed, 15 insertions, 5 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index d29d4c4..758ce00 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -20,14 +20,24 @@ CONVERSION_CMD_tar = "touch ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${
20CONVERSIONTYPES_append = " tar" 20CONVERSIONTYPES_append = " tar"
21 21
22TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}" 22TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}"
23
24python prepare_ostree_rootfs() {
25 import oe.path
26 import shutil
27
28 ostree_rootfs = d.getVar("OSTREE_ROOTFS")
29 if os.path.lexists(ostree_rootfs):
30 bb.utils.remove(ostree_rootfs, True)
31
32 # Copy required as we change permissions on some files.
33 image_rootfs = d.getVar("IMAGE_ROOTFS")
34 oe.path.copyhardlinktree(image_rootfs, ostree_rootfs)
35}
36
23do_image_ostree[dirs] = "${OSTREE_ROOTFS}" 37do_image_ostree[dirs] = "${OSTREE_ROOTFS}"
24do_image_ostree[cleandirs] = "${OSTREE_ROOTFS}" 38do_image_ostree[prefuncs] += "prepare_ostree_rootfs"
25do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete" 39do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete"
26IMAGE_CMD_ostree () { 40IMAGE_CMD_ostree () {
27 cp -a ${IMAGE_ROOTFS}/* ${OSTREE_ROOTFS}
28 chmod a+rx ${OSTREE_ROOTFS}
29 sync
30
31 for d in var/*; do 41 for d in var/*; do
32 if [ "${d}" != "var/local" ]; then 42 if [ "${d}" != "var/local" ]; then
33 rm -rf ${d} 43 rm -rf ${d}