From dde1695ed0b3a068f5ed6cf974443cacef56cf2f Mon Sep 17 00:00:00 2001 From: Haiqing Bai Date: Sun, 16 Jul 2023 15:35:31 +0800 Subject: [PATCH] build-image: Fixed debootstrap tar cache issue In order to speed up the build-image, the minbase debootstrap tar is cached and will be reused by the next build-image with '--keep' option. The case is that the package 'libudev1' from 'deb-merge-all' is provided by 'systemd' that is upgraded to a new version, but the cached debootstrap tar contains an older version of 'libudev1' which causes the conflict like below when running 'build-image --keep': "The following packages have unmet dependencies: systemd : Depends: libsystemd0 (= 247.3-7+deb11u2.stx.9) \ but 247.3-7.stx.8 is to be installed udev : Depends: libudev1 (= 247.3-7+deb11u2.stx.9) \ but 247.3-7.stx.8 is to be installed E: Unable to correct problems, you have held broken packages." Test Plan: Pass: #build-image #Apply patch to 'systemd' or make changes to upgrade it #commit the change #build-image --keep Closes-Bug: 2027756 Change-Id: I43c17a5430ccf7c1da1d5558543715b4bf941813 Signed-off-by: Haiqing Bai --- build-tools/stx/build-image | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tools/stx/build-image b/build-tools/stx/build-image index 6da1fe1a..dc3656dd 100755 --- a/build-tools/stx/build-image +++ b/build-tools/stx/build-image @@ -602,9 +602,9 @@ if __name__ == "__main__": logger.error("Failed to add packages into image YAML config") sys.exit(ret) + os.system('sudo rm -rf ' + LAT_ROOT + '/workdir') + os.system('sudo rm -rf ' + LAT_ROOT + '/sub_workdir') if not args.keep: - os.system('sudo rm -rf ' + LAT_ROOT + '/workdir') - os.system('sudo rm -rf ' + LAT_ROOT + '/sub_workdir') os.system('sudo rm -rf ' + LAT_ROOT + '/deploy') # Prepare the boot cert