@@ -13,6 +13,8 @@
inherit rootfs
inherit image
+# Generate the uuid from BB_TASKHASH to ensure a new
+# hash on each rebuild
def generate_image_uuid(d):
import uuid
@@ -23,6 +25,23 @@ def generate_image_uuid(d):
IMAGE_UUID ?= "${@generate_image_uuid(d)}"
+def read_target_image_uuid(d):
+ import os.path
+
+ deploy_dir = d.getVar("DEPLOY_DIR_IMAGE")
+ image_full_name = d.getVar("IMAGE_FULLNAME")
+ uuid_file = f"{deploy_dir}/{image_full_name}.uuid.env"
+ if not os.path.isfile(uuid_file):
+ return None
+
+ target_image_uuid = None
+ with open(uuid_file, "r") as f:
+ uuid_file_content = f.read()
+ target_image_uuid = uuid_file_content.split('=')[1].strip(' \t\n\r').strip('\"')
+ return target_image_uuid
+
+TARGET_IMAGE_UUID = "${@read_target_image_uuid(d)}"
+
do_generate_image_uuid[vardeps] += "IMAGE_UUID"
do_generate_image_uuid[depends] = "buildchroot-target:do_build"
do_generate_image_uuid[dirs] = "${DEPLOY_DIR_IMAGE}"