From bed0ce9489227aac910172f94e2c7d3e83cd3a46 Mon Sep 17 00:00:00 2001 From: Zhixiong Chi Date: Tue, 26 Oct 2021 18:10:51 +0800 Subject: [PATCH] stx tool: Add the debdownloader task for building image Before building the iso image, we need to make sure the binary packages have been downloaded, therefore now we add the debdownloader to implement this task. Depends-On: https://review.opendev.org/c/starlingx/tools/+/817129 Story: 2008862 Task: 43771 Signed-off-by: Zhixiong Chi Change-Id: I8a986c315777a7c43629795e52659d822400be70 --- stx/lib/stx/stx_build.py | 10 ++++++++++ stx/toCOPY/builder/buildrc | 2 ++ 2 files changed, 12 insertions(+) diff --git a/stx/lib/stx/stx_build.py b/stx/lib/stx/stx_build.py index a66064209..345ac410b 100644 --- a/stx/lib/stx/stx_build.py +++ b/stx/lib/stx/stx_build.py @@ -60,6 +60,12 @@ be [ rt|std ]') cmd = prefixcmd + '". /usr/local/bin/stx/stx-cleanup"\'' return cmd + def buildDebdownloaderCMD(self, prefixcmd): + + cmd = prefixcmd + '"debdownloader ' + \ + '$STX_BINARYLIST_DIR/common/base-bullseye.lst"\'' + return cmd + def buildPackageCMD(self, args, prefixcmd): if args.force: @@ -116,6 +122,10 @@ the setup step before building') cmd = self.buildCleanupCMD(prefix_cmd) self.logger.debug('Execute the cleanup command: [%s].', cmd) + elif args.build_task == 'debdownloader': + cmd = self.buildDebdownloaderCMD(prefix_cmd) + self.logger.debug('Execute the debdownloader command: [%s].', cmd) + else: cmd = self.buildPackageCMD(args, prefix_cmd) self.logger.debug('Compile the package: [%s] with the command \ diff --git a/stx/toCOPY/builder/buildrc b/stx/toCOPY/builder/buildrc index 153589f6f..a65555490 100644 --- a/stx/toCOPY/builder/buildrc +++ b/stx/toCOPY/builder/buildrc @@ -30,6 +30,8 @@ export MY_REPO=$MY_REPO_ROOT_DIR/cgcs-root export MY_BUILD_TOOLS_DIR=$MY_REPO/build-tools export LAYER=$LAYER export STX_CONFIG_DIR=$MY_REPO_ROOT_DIR/stx-tools +export PREFIX_BINARYLIST_DIR=debian-mirror-tools/config/debian/ +export STX_BINARYLIST_DIR=$STX_CONFIG_DIR/$PREFIX_BINARYLIST_DIR export STX_GIT_SRC_DIR=$MY_REPO/stx/git export PATH=$PATH:$MY_BUILD_TOOLS_DIR/stx:/opt/LAT/lat