summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2020-04-25 22:15:39 +0000
committerLaurent Bonnans <laurent.bonnans@here.com>2020-06-02 10:12:14 +0200
commit50835b85ab5fa5fa7b2c340a35f829766c6d0be9 (patch)
treeb4a905751cb818fa3d6448edff7ff060dc9ffa1b
parent52276a4ee4f2e8cd63a186ed8775c8d2f2b18216 (diff)
downloadmeta-updater-50835b85ab5fa5fa7b2c340a35f829766c6d0be9.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 a3eae24..7275867 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -19,14 +19,24 @@ CONVERSIONTYPES_append = " tar"
19 19
20REQUIRED_DISTRO_FEATURES = "usrmerge" 20REQUIRED_DISTRO_FEATURES = "usrmerge"
21TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}" 21TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}"
22
23python 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
22do_image_ostree[dirs] = "${OSTREE_ROOTFS}" 36do_image_ostree[dirs] = "${OSTREE_ROOTFS}"
23do_image_ostree[cleandirs] = "${OSTREE_ROOTFS}" 37do_image_ostree[prefuncs] += "prepare_ostree_rootfs"
24do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete" 38do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete"
25IMAGE_CMD_ostree () { 39IMAGE_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}