From 880eda723bc21a68f5647be6238dd273f9e87b80 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Wed, 8 Dec 2021 11:56:32 +0100 Subject: [PATCH] Generate delta in /run/upgrade-sysroot instead of /system Upgrade path is hardcoded and it's used by Update Agent. In A/B case Update Agent is run in normal boot, requiring for the /system path to be "reserved" - possibly causing conflicts. Change-Id: I044f0949b57ba7828c764b92f9418f1c4b2fa696 --- mk_delta/common/bin/CreatePatch.py | 9 +++------ mk_delta/common/bin/mk_part_delta.sh | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mk_delta/common/bin/CreatePatch.py b/mk_delta/common/bin/CreatePatch.py index 9da5c88..1299f58 100755 --- a/mk_delta/common/bin/CreatePatch.py +++ b/mk_delta/common/bin/CreatePatch.py @@ -50,7 +50,6 @@ def global_paths(): global DIFF_UTIL global ZIPUTIL global NEW_FILES_PATH - global NEW_FILES_FOLDER global NEW_FILES_ZIP_NAME global SYMLINK_TYPE global ATTR_DOC_EXT @@ -76,8 +75,7 @@ DIFF_UTIL = "/usr/local/bin/ss_bsdiff" DIFFPATCH_UTIL = "/usr/local/bin/ss_bspatch" #ZIPUTIL = "p7zip " ZIPUTIL = "7z -mf=off a system.7z " -NEW_FILES_PATH = "system" -NEW_FILES_FOLDER = "system" +NEW_FILES_PATH = "run/upgrade-sysroot" NEW_FILES_ZIP_NAME = "system.7z" SYMLINK_TYPE = "SYM" ATTR_DOC_EXT = "_attr.txt" @@ -805,7 +803,7 @@ def SS_Generate_Delta(PART_NAME, BASE_OLD, Old_files, Old_dirs, BASE_NEW, New_fi for elt in files_new: dst_file = BASE_NEW+'/'+elt - newfiles_dest_path = 'system/' + newfiles_dest_path = 'run/upgrade-sysroot/' ensure_dir_exists(newfiles_dest_path) if os.path.islink(dst_file): patch = os.readlink(dst_file) @@ -826,7 +824,6 @@ def SS_Generate_Delta(PART_NAME, BASE_OLD, Old_files, Old_dirs, BASE_NEW, New_fi New_Cnt = New_Cnt + 1 else: New_Cnt = New_Cnt + 1 - #newfiles_dest_path = OUT_DIR + '/system/' destpath = newfiles_dest_path + elt destdir = os.path.dirname(destpath) logging.debug('New files - %s ==> %s' % (dst_file, destdir)) @@ -847,7 +844,7 @@ def SS_Generate_Delta(PART_NAME, BASE_OLD, Old_files, Old_dirs, BASE_NEW, New_fi raise for elt in Dir_Added: - newfiles_dest_path = 'system/' + newfiles_dest_path = 'run/upgrade-sysroot/' ensure_dir_exists(newfiles_dest_path) destpath = newfiles_dest_path + elt if not os.path.exists(destpath): diff --git a/mk_delta/common/bin/mk_part_delta.sh b/mk_delta/common/bin/mk_part_delta.sh index 8fbce44..d6843c6 100755 --- a/mk_delta/common/bin/mk_part_delta.sh +++ b/mk_delta/common/bin/mk_part_delta.sh @@ -344,7 +344,7 @@ fn_mk_delta_fs() DEBUG_DELTA=debug_${DELTA} #CFG_XML=${PART_NAME}_FS.xml - FAKE_ROOT=system + FAKE_ROOT=run/upgrade-sysroot BASE_OLD=${PART_NAME}_OLD BASE_NEW=${PART_NAME}_NEW -- 2.7.4