Add debian snapshot and CENGN mirror into sources.list of builder

A new environment variable DEBIAN_SNAPSHOT points to Debian snapshot
source. Both DEBIAN_SNAPSHOT and CENGN mirror point to Debian Bullyseye
11.3.

Set the 2 sources in builder container to avoid downloader -b fails due
to Debian upstream uprev.

Not comment the Debian upstream sources to allow upgrading a package
individually from Debian upstream, for example, fix CVEs.

Test Plan:

Pass: download -b succeeds with commenting the Debian upstream sources

Story: 2008846
Task: 44979

Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
Change-Id: If4dc935cc0fd10b6f0848b8b1bbff50e0db02582
This commit is contained in:
Yue Tao 2022-04-07 14:13:44 +08:00 committed by Yue Tao
parent 718dbfb9ca
commit 88d2329e72
4 changed files with 17 additions and 0 deletions

View File

@ -8,6 +8,7 @@ proxyport = 8080
buildbranch = master
manifest = default.xml
ostree_osname = debian
debian_snapshot = http://snapshot.debian.org/archive/debian/20220331T000000Z
[builder]
uid = 1000

View File

@ -87,6 +87,7 @@ class HandleControlTask:
deblist = self.config.get('repomgr', 'deblist')
dsclist = self.config.get('repomgr', 'dsclist')
ostree_osname = self.config.get('project', 'ostree_osname')
debian_snapshot = self.config.get('project', 'debian_snapshot')
if sourceslist:
if not (deblist or dsclist):
self.logger.warning('*************************************\
@ -159,6 +160,7 @@ stx-pkgbuilder/configmap/')
line = line.replace("@CENGNURL@", cengnurl)
line = line.replace("@CENGNSTRATEGY@", cengnstrategy)
line = line.replace("@OSTREE_OSNAME@", ostree_osname)
line = line.replace("@DEBIAN_SNAPSHOT@", debian_snapshot)
line = line.replace("@MAX_CPUS@", max_cpus)
if sourceslist:
line = line.replace("@fetch@", "true")

View File

@ -55,4 +55,6 @@ export BUILDER_URL=http://@PROJECT@-stx-pkgbuilder:8080/pkgbuilder/
export OSTREE_OSNAME=@OSTREE_OSNAME@
export DEBIAN_SNAPSHOT=@DEBIAN_SNAPSHOT@
export MAX_CPUS=@MAX_CPUS@

View File

@ -4,6 +4,8 @@
REPOMGR=aptly
if [ "$REPOMGR" == "aptly" ]; then
CENGN_MIRROR="${CENGNURL}/debian/debian/deb.debian.org/debian/bullseye-11.3 bullseye main"
REPO_SNAPSHOT="[check-valid-until=no] ${DEBIAN_SNAPSHOT} bullseye main"
REPO_BIN="deb [trusted=yes] ${REPOMGR_DEPLOY_URL}deb-local-binary bullseye main"
REPO_SRC="deb-src [trusted=yes] ${REPOMGR_DEPLOY_URL}deb-local-source bullseye main"
ret=`grep 'deb-local-binary' /etc/apt/sources.list`
@ -14,6 +16,16 @@ if [ "$REPOMGR" == "aptly" ]; then
if [ "x$ret" == "x" ]; then
sed -i "1i\\${REPO_SRC}" /etc/apt/sources.list
fi
ret=`grep ${DEBIAN_SNAPSHOT} /etc/apt/sources.list`
if [ "x$ret" == "x" ]; then
sed -i "1i\\deb ${REPO_SNAPSHOT}" /etc/apt/sources.list
sed -i "1i\\deb-src ${REPO_SNAPSHOT}" /etc/apt/sources.list
fi
ret=`grep ${CENGNURL} /etc/apt/sources.list`
if [ "x$ret" == "x" ]; then
sed -i "1i\\deb ${CENGN_MIRROR}" /etc/apt/sources.list
sed -i "1i\\deb-src ${CENGN_MIRROR}" /etc/apt/sources.list
fi
fi
addgroup -gid 751 cgts > /dev/null 2>&1