From 40f25f5391492c2fbd7dda849c06bd9d14c321e0 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 1 Nov 2025 16:08:56 +0100 Subject: [PATCH 1/3] d/b/genorig.py, d/rules, d/salsa-ci.yml: Put orig tarballs directly in .. Currently orig tarball caching is broken in CI. The fix for this on debian/latest doesn't cleanly apply here, in part because: - Here we use genorig.py, which puts tarballs in ../orig and creates symlinks to them in .. - There we use uscan, which puts tarballs in .. To reduce the conflicts, change genorig.py to create tarballs in .. and change debian/rules and debian/salsa-ci.yml to work with that. (cherry picked from commit d16220d004bb7477276895bc3bfe5992ca84f6c2) --- debian/bin/genorig.py | 11 +---------- debian/changelog | 6 ++++++ debian/rules | 9 ++------- debian/salsa-ci.yml | 17 +++++++++-------- 4 files changed, 18 insertions(+), 25 deletions(-) diff --git a/debian/bin/genorig.py b/debian/bin/genorig.py index 9bf43a34e2..b13e738ac9 100755 --- a/debian/bin/genorig.py +++ b/debian/bin/genorig.py @@ -114,11 +114,7 @@ class Main(object): RuntimeWarning) def tar(self, orig_date): - out = os.path.join("../orig", self.orig_tar) - try: - os.mkdir("../orig") - except OSError: - pass + out = os.path.join("..", self.orig_tar) try: os.stat(out) raise RuntimeError("Destination already exists") @@ -151,11 +147,6 @@ class Main(object): except OSError: pass raise - try: - os.symlink(os.path.join('orig', self.orig_tar), - os.path.join('..', self.orig_tar)) - except OSError: - pass if __name__ == '__main__': diff --git a/debian/changelog b/debian/changelog index 5b13e0c974..70a41c4571 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +linux (6.1.153-2) UNRELEASED; urgency=medium + + * d/b/genorig.py, d/rules, d/salsa-ci.yml: Put orig tarballs directly in .. + + -- Ben Hutchings Sat, 01 Nov 2025 22:50:11 +0100 + linux (6.1.153-1) bookworm-security; urgency=high * New upstream stable update: diff --git a/debian/rules b/debian/rules index f6e291c473..742734ad2c 100755 --- a/debian/rules +++ b/debian/rules @@ -66,20 +66,15 @@ binary-indep: build-indep $(MAKE) -f debian/rules.gen binary-indep DIR_ORIG = ../orig/$(SOURCE)-$(VERSION_UPSTREAM) -TAR_ORIG_NAME = $(SOURCE)_$(VERSION_UPSTREAM).orig.tar.xz -TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME))) +TAR_ORIG = ../$(SOURCE)_$(VERSION_UPSTREAM).orig.tar.xz orig: $(DIR_ORIG) rsync --delete --exclude /debian --exclude .svk --exclude .svn --exclude .git --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ . QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_PC=.pc quilt push --quiltrc - -a -q --fuzz=0 -$(DIR_ORIG): -ifeq ($(TAR_ORIG),) - $(error Cannot find orig tarball $(TAR_ORIG_NAME)) -else +$(DIR_ORIG): $(TAR_ORIG) mkdir -p ../orig tar -C ../orig -xaf $(TAR_ORIG) -endif CLEAN_PATTERNS := $(BUILD_DIR) $(STAMPS_DIR) debian/lib/python/debian_linux/*.pyc debian/lib/python/debian_linux/__pycache__ $$(find debian -maxdepth 1 -type d -name 'linux-*') debian/*-modules-*-di* debian/kernel-image-*-di* debian/*-tmp debian/*.substvars diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index 3ea3fdcda2..0c01a7487e 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -45,10 +45,13 @@ build: # Do the same as the common .build-definition script - !reference [.build-before-script] - !reference [.build-script-setup-environment] - # Move cache to where genorig.py and orig target want it - - mkdir -p orig - - rm -rf ../orig - - mv orig ../orig + + # Move orig tarball cache + - | + if [ -d orig ]; then + mv orig/* .. + rmdir orig + fi # Install dependencies of gencontrol.py, genorig.py, and debian/rules orig - apt-get update @@ -72,9 +75,7 @@ build: # tarball fom the archive if available or run uscan if not, but # uscan is currently excessively slow for us (bug #1003251). - | - if [ -f ../orig/linux_${upstream_version}.orig.tar.xz ]; then - ln -s orig/linux_${upstream_version}.orig.tar.xz .. - else + if ! [ -f ../linux_${upstream_version}.orig.tar.xz ]; then debian/bin/genorig.py https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git fi - debian/rules orig @@ -97,7 +98,7 @@ build: # Put packed source in artifacts - dpkg-buildpackage -uc -us -S -sa -d - mkdir -p ${WORKING_DIR} - - cp ../orig/linux_${upstream_version}.orig.tar.xz ${WORKING_DIR} + - cp ../linux_${upstream_version}.orig.tar.xz ${WORKING_DIR} - mv ../linux_${version}.dsc ../linux_${version}.debian.tar.xz ${WORKING_DIR} # Move orig tarballs back to where GitLab wants them From 6105de0bfa9a7e217d6c2a5ec050588d91dbea87 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 1 Nov 2025 22:51:52 +0100 Subject: [PATCH 2/3] Backport "d/salsa-ci.yml: Adjust filenames to allow source package name suffix" This backports merge request kernel-team/linux!1663 For debian/6.1/bookworm, also update the file test before running genorig.py. --- debian/changelog | 1 + debian/salsa-ci.yml | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 70a41c4571..fa166f12b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ linux (6.1.153-2) UNRELEASED; urgency=medium * d/b/genorig.py, d/rules, d/salsa-ci.yml: Put orig tarballs directly in .. + * d/salsa-ci.yml: Adjust filenames to allow source package name suffix -- Ben Hutchings Sat, 01 Nov 2025 22:50:11 +0100 diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index 0c01a7487e..3391bcab02 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -68,6 +68,7 @@ build: quilt \ rsync + - source=$(dpkg-parsechangelog -SSource) - version=$(dpkg-parsechangelog -SVersion) - upstream_version=$(echo $version | sed 's/-[^-]*$//') @@ -75,7 +76,7 @@ build: # tarball fom the archive if available or run uscan if not, but # uscan is currently excessively slow for us (bug #1003251). - | - if ! [ -f ../linux_${upstream_version}.orig.tar.xz ]; then + if ! [ -f ../${source}_${upstream_version}.orig.tar.xz ]; then debian/bin/genorig.py https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git fi - debian/rules orig @@ -98,8 +99,8 @@ build: # Put packed source in artifacts - dpkg-buildpackage -uc -us -S -sa -d - mkdir -p ${WORKING_DIR} - - cp ../linux_${upstream_version}.orig.tar.xz ${WORKING_DIR} - - mv ../linux_${version}.dsc ../linux_${version}.debian.tar.xz ${WORKING_DIR} + - cp ../${source}_${upstream_version}.orig.tar.xz ${WORKING_DIR} + - mv ../${source}_${version}.dsc ../${source}_${version}.debian.tar.xz ${WORKING_DIR} # Move orig tarballs back to where GitLab wants them - mkdir ${CI_PROJECT_DIR}/orig @@ -110,7 +111,7 @@ build: - !reference [.build-script-setup-build-command] - cd ${WORKING_DIR} - - export BUILD_COMMAND="${BUILD_COMMAND} linux_${version}.dsc" + - export BUILD_COMMAND="${BUILD_COMMAND} ${source}_${version}.dsc" - !reference [.build-script-run-build-command] after_script: @@ -238,12 +239,12 @@ sign-code: # Sign the code and build a source package - | "$kernel_team_dir"/scripts/debian-test-sign \ - ${WORKING_DIR}/linux_*_${BUILD_ARCH}.changes \ + ${WORKING_DIR}/linux*_${BUILD_ARCH}.changes \ debian/certs/ci-test-sign/ci-test-sign-key.pem \ debian/certs/ci-test-sign/ci-test-sign.pem artifacts: paths: - - ${WORKING_DIR}/linux-signed-${BUILD_ARCH}_* + - ${WORKING_DIR}/linux-signed*-${BUILD_ARCH}_* needs: - job: build artifacts: true @@ -269,7 +270,7 @@ build-signed: - !reference [.build-script-setup-build-command] - - export BUILD_COMMAND="${BUILD_COMMAND} ${WORKING_DIR}/linux-signed-${BUILD_ARCH}_*.dsc" + - export BUILD_COMMAND="${BUILD_COMMAND} ${WORKING_DIR}/linux-signed*-${BUILD_ARCH}_*.dsc" - !reference [.build-script-run-build-command] after_script: @@ -279,7 +280,7 @@ build-signed: # packages, and (for piuparts) the versioned dependencies produced # by the build job paths: - - ${WORKING_DIR}/linux-signed-${BUILD_ARCH}_* + - ${WORKING_DIR}/linux-signed*-${BUILD_ARCH}_* - ${WORKING_DIR}/linux-headers-*_${BUILD_ARCH}.deb - ${WORKING_DIR}/linux-headers-*-common_*_all.deb - ${WORKING_DIR}/linux-image-*_${BUILD_ARCH}.deb From 846475e25dae1d914ea9151e3f0608bf54a5b1bc Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 1 Nov 2025 22:54:08 +0100 Subject: [PATCH 3/3] Backport "CI: Fix more issues introduced by the removal of the extract-source job" This backports merge request kernel-team/linux!1675 For debian/6.1/bookworm, keep using genorig.py to generate the orig tarball. --- debian/changelog | 3 ++ debian/salsa-ci.yml | 83 ++++++++++++++++++++++++++++++++------------- 2 files changed, 63 insertions(+), 23 deletions(-) diff --git a/debian/changelog b/debian/changelog index fa166f12b1..c430753c58 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ linux (6.1.153-2) UNRELEASED; urgency=medium * d/b/genorig.py, d/rules, d/salsa-ci.yml: Put orig tarballs directly in .. * d/salsa-ci.yml: Adjust filenames to allow source package name suffix + * d/salsa-ci.yml: Fix cache configuration for build job + * d/salsa-ci.yml: Move orig tarball generation to a separate job again + * d/salsa-ci.yml: Restore lintian checking of source package -- Ben Hutchings Sat, 01 Nov 2025 22:50:11 +0100 diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index 3391bcab02..fb41228bb0 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -18,6 +18,7 @@ variables: # Add stages for signed packages stages: + - provisioning - build - publish - test @@ -25,17 +26,67 @@ stages: - build-signed - test-signed +orig: + stage: provisioning + image: $SALSA_CI_IMAGES_BASE + cache: + key: "orig-${RELEASE}" + paths: + - orig + extends: + - .artifacts-default-expire + except: + variables: + - $CI_COMMIT_TAG != null + script: + # Move orig tarball cache + - | + if [ -d orig ]; then + mv orig/* .. + rmdir orig + fi + + # Install dpkg-parsechangelog and dependencies of genorig.py + - apt-get update + - | + eatmydata apt-get install --no-install-recommends -y \ + dpkg-dev \ + git \ + gpg \ + gpgv \ + python3 \ + python3-debian + + - source=$(dpkg-parsechangelog -SSource) + - version=$(dpkg-parsechangelog -SVersion) + - upstream_version=$(echo $version | sed 's/-[^-]*$//') + + # We could use origtargz to download a tarball fom the archive if + # available or run uscan if not, but uscan is currently + # excessively slow for us (bug #1003251). + - | + if ! [ -f ../${source}_${upstream_version}.orig.tar.xz ]; then + debian/bin/genorig.py https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git + fi + + # Move orig tarballs back to where GitLab wants them + - mkdir orig + - mv ../*.orig.tar.* orig + # Our modified build jobs build: timeout: 3 hours cache: - key: "orig-${RELEASE}" - paths: - - orig - key: "build-${BUILD_ARCH}_${HOST_ARCH}" - paths: - - .ccache + - key: "orig-${RELEASE}" + paths: + - orig + policy: pull + - key: "build-${BUILD_ARCH}_${HOST_ARCH}" + paths: + - .ccache + needs: + - job: orig extends: - .build-definition except: @@ -53,14 +104,11 @@ build: rmdir orig fi - # Install dependencies of gencontrol.py, genorig.py, and debian/rules orig + # Install dependencies of gencontrol.py and debian/rules orig - apt-get update - | eatmydata apt-get install --no-install-recommends -y \ debhelper \ - git \ - gpg \ - gpgv \ kernel-wedge \ python3 \ python3-debian \ @@ -72,13 +120,7 @@ build: - version=$(dpkg-parsechangelog -SVersion) - upstream_version=$(echo $version | sed 's/-[^-]*$//') - # Merge upstream source. We could use origtargz to download a - # tarball fom the archive if available or run uscan if not, but - # uscan is currently excessively slow for us (bug #1003251). - - | - if ! [ -f ../${source}_${upstream_version}.orig.tar.xz ]; then - debian/bin/genorig.py https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git - fi + # Merge upstream source - debian/rules orig # Fudge source version and distribution *before* gencontrol.py @@ -99,12 +141,7 @@ build: # Put packed source in artifacts - dpkg-buildpackage -uc -us -S -sa -d - mkdir -p ${WORKING_DIR} - - cp ../${source}_${upstream_version}.orig.tar.xz ${WORKING_DIR} - - mv ../${source}_${version}.dsc ../${source}_${version}.debian.tar.xz ${WORKING_DIR} - - # Move orig tarballs back to where GitLab wants them - - mkdir ${CI_PROJECT_DIR}/orig - - cp -v ${WORKING_DIR}/*.orig.tar.* ${CI_PROJECT_DIR}/orig + - mv ../${source}_${upstream_version}.orig.tar.xz ../${source}_${version}.dsc ../${source}_${version}.debian.tar.xz ../${source}_${version}_source.buildinfo ../${source}_${version}_source.changes ${WORKING_DIR} - chown -R 'salsa-ci:' ${WORKING_DIR} ${CCACHE_DIR}