From patchwork Tue Feb 6 13:00:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1895698 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TTjzG70G4z23gb for ; Wed, 7 Feb 2024 00:00:41 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rXL3s-0004Hb-3e; Tue, 06 Feb 2024 13:00:28 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rXL3j-0004HI-JW for kernel-team@lists.ubuntu.com; Tue, 06 Feb 2024 13:00:19 +0000 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id EFFA23F6A4 for ; Tue, 6 Feb 2024 13:00:15 +0000 (UTC) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-40ef6b8d0f6so33451065e9.2 for ; Tue, 06 Feb 2024 05:00:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707224414; x=1707829214; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ihKdZLmupsPZnHANyg86kAk9Q8szleh0mDrXROQuskM=; b=dh/QtmON/dujfenK2kR19jBfYIGyC0P39+mvZqpyaL0dOzCQYoCK6La8cQyIrqkl90 b+jax1OEYZwzdUxeggQRNkD5CVe1fCM2nHIUx0wmJ/19XnwAsGYsHYPjeHNPing0m0l+ bjfvFZzkhB1EwMA+tI+1zU8v6CxaM4T2fqGUTXNvoBKyruvgUBpYBmOleAvXMIdmMfij IoDT2ZKfuMUb/6uokpQHIF5gzfvOmnHpCnavN2yFju76/bYlo/r1eii6ZG6oOLvAvt/9 O03Jv1zSp94dAN+3G+j1Xfx6RoH2fDUqaDRhx/hPDggtW19QCA3J0L2ZxuJ5QRjn/uoW sxrw== X-Gm-Message-State: AOJu0YzkGsIscvmwzWDFAgbXXIwv7x/yI8MP4FCCKYUCOeFc45+l+bkU 7uNKCpUuA9lr5IC8hwo4nn6g4ypRvUJjv5ubP3UNMAhcQ8fvdzzbBcnQHLVqykLaIWy4H09mUmh YGBisCuaxaPd/hisLtShJibwYEmMRerpEddcfwmNSUeSJD94RluCjj1tfbg9Xspungh9yLlVbio ETu2JylqPpDA== X-Received: by 2002:a05:600c:a3a4:b0:40f:dc50:aea5 with SMTP id hn36-20020a05600ca3a400b0040fdc50aea5mr1531483wmb.22.1707224414619; Tue, 06 Feb 2024 05:00:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGio/bEcSW7wDF14AKpTguCGqnHjtDc0bCmoZS1R1C6VPEYwbeiV7q4dQgWFiX8eC3RGUJpAg== X-Received: by 2002:a05:600c:a3a4:b0:40f:dc50:aea5 with SMTP id hn36-20020a05600ca3a400b0040fdc50aea5mr1531459wmb.22.1707224414198; Tue, 06 Feb 2024 05:00:14 -0800 (PST) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id r18-20020a056000015200b0033b07e4cadbsm2051222wrx.115.2024.02.06.05.00.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 05:00:13 -0800 (PST) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [Unstable/Noble][PATCH] UBUNTU: [Packaging] Remove update-dkms-versions and move dkms-versions Date: Tue, 6 Feb 2024 14:00:12 +0100 Message-Id: <20240206130012.1545656-1-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Remove the update-dkms-versions script from the tree, it's replaced by 'cranky update-dkms-versions', move the dkms-versions file and fix all references to the old location. Signed-off-by: Juerg Haefliger --- {debian => debian.master}/dkms-versions | 0 debian/rules.d/0-common-vars.mk | 2 +- debian/scripts/control-create | 2 +- update-dkms-versions | 195 ------------------------ 4 files changed, 2 insertions(+), 197 deletions(-) rename {debian => debian.master}/dkms-versions (100%) delete mode 100755 update-dkms-versions diff --git a/debian/dkms-versions b/debian.master/dkms-versions similarity index 100% rename from debian/dkms-versions rename to debian.master/dkms-versions diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk index 0f6108d7ca05..8f57611ad971 100644 --- a/debian/rules.d/0-common-vars.mk +++ b/debian/rules.d/0-common-vars.mk @@ -233,7 +233,7 @@ all_dkms_modules = subst_paired = $(subst $(firstword $(subst =, ,$(1))),$(lastword $(subst =, ,$(1))),$(2)) recursive_call = $(if $(2),$(call recursive_call,$(1),$(wordlist 2,$(words $(2)),$(2)),$(call $(1),$(firstword $(2)),$(3))),$(3)) -$(foreach _line,$(shell gawk '{ OFS = "!"; $$1 = $$1; print }' $(DROOT)/dkms-versions), \ +$(foreach _line,$(shell gawk '{ OFS = "!"; $$1 = $$1; print }' $(DEBIAN)/dkms-versions), \ $(eval _params = $(subst !, ,$(_line))) \ $(eval _deb_pkgname = $(firstword $(_params))) \ $(eval _deb_version = $(word 2,$(_params))) \ diff --git a/debian/scripts/control-create b/debian/scripts/control-create index 32ef0f2df536..f2af8b9bb2f4 100755 --- a/debian/scripts/control-create +++ b/debian/scripts/control-create @@ -59,4 +59,4 @@ do -e "s#ARCH#$arch#g" \ -e "s#MODULE#$module#g" \ -e "s#FLAVOUR#$flavour#g" -done <"debian/dkms-versions" +done <"${DEBIAN}/dkms-versions" diff --git a/update-dkms-versions b/update-dkms-versions deleted file mode 100755 index e0ab5898ac36..000000000000 --- a/update-dkms-versions +++ /dev/null @@ -1,195 +0,0 @@ -#!/bin/bash - -remote_repo='' -remote_branch='main' -sru_cycle= -while : -do - if [ "$1" = "--remote-repo" ]; then - remote_repo="$2" - shift 2 - - elif [ "$1" = "--remote-branch" ]; then - remote_branch="$2" - shift 2 - - elif [ "$1" = "--sru-cycle" ]; then - sru_cycle="$2" - shift 2 - - else - break - fi -done -if [ "$#" -ne 0 ]; then - { - echo "Usage: $0 []" - echo " --remote-repo " - echo " --sru-cycle " - } 1>&2 - exit 1 -fi - -default_sru_cycle() -{ - local tracking_bug - local version - - # Pick out the cycle from the tracking bug file. - if [ -f "$DEBIAN/tracking-bug" ]; then - read tracking_bug sru_cycle X <"$DEBIAN/tracking-bug" - fi - - if [ -z "$sru_cycle" ]; then - echo "$0: sru-cycle not found via debian/tracking-bug; specify --sru-cycle" 1>&2 - exit 1 - fi - - sru_cycle=$(echo "$sru_cycle" | sed -e 's/-[0-9][0-9]*$//' -e 's/^kernel-sru-cycle-//') - - #echo "default_sru_cycle: version<$version> sru_cycle<$sru_cycle>" -} - -# Determine where our changelog is. -DEBIAN=debian -[ -f 'debian/debian.env' ] && . 'debian/debian.env' - -[ -z "$sru_cycle" ] && default_sru_cycle -if [ -z "$remote_repo" ]; then - case "$sru_cycle" in - c[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9]) - remote_repo='security' ;; - *) - remote_repo='main' ;; - esac -fi -case "$remote_repo" in -security) - remote_repo='ssh+git://git.launchpad.net/~canonical-kernel-security-team/canonical-kernel-private/+git/kernel-versions' - remote_name='security' - ;; -main) - remote_repo='git://git.launchpad.net/~canonical-kernel/+git/kernel-versions' - remote_name='main' - ;; -*) - remote_name='adhoc' - ;; -esac - -# -# kernel-versoins repository dkms-version mapping see below for details: -# https://git.launchpad.net/~canonical-kernel/+git/kernel-versions/plain/README -# -kv_repo="$HOME/.cache/kernel-versions-bare" - -# Now we know where our repo is and what it called update it. -# We maintain "persistent" remotes for main and security, but assume -# any manually supplied entries are transient. -( - [ ! -d "$kv_repo" ] && mkdir -p "$kv_repo" - cd "$kv_repo" || exit 1 - [ ! -f config ] && git init -q --bare - current_url=$(git config "remote.$remote_name.url") - if [ -z "$current_url" ]; then - git remote add "$remote_name" "$remote_repo" - elif [ "$current_url" != "$remote_repo" ]; then - git config "remote.$remote_name.url" "$remote_repo" - fi - git fetch -q -p "$remote_name" -) || exit 1 - -cat_file() -{ - (cd "$kv_repo" && git cat-file "$@") || exit 1 -} - -present=$(cat_file -t "$remote_name/$remote_branch:devel/" 2>/dev/null) -if [ "$present" ]; then - git_base_devel="$remote_name/$remote_branch:devel/" -else - git_base_devel="$remote_name/$remote_branch:tip/" -fi -git_base="$remote_name/$remote_branch:$sru_cycle/" -git_human="$remote_name/$sru_cycle" - -# Determine if we have this cycle. -present=$(cat_file -t "$git_base" 2>/dev/null) -if [ "$present" = "" ]; then - # If we don't have the cycle in the development cycle then - # fall back to master. - case "$sru_cycle" in - d*) git_base="$git_base_devel" ;; - *) echo "$sru_cycle: cycle not found in $remote_repo" 2>&1 - exit 1 - ;; - esac -fi - -# Determine our series and mainline version from our own changelog. -our_series=$(LC_ALL=C dpkg-parsechangelog -l"$DEBIAN/changelog" -SDistribution) -if [ "$our_series" = "UNRELEASED" ]; then - our_series=$(LC_ALL=C dpkg-parsechangelog -l"$DEBIAN/changelog" -o1 -c1 -SDistribution) -fi -our_mainline=$(LC_ALL=C dpkg-parsechangelog -l"$DEBIAN/changelog" -SVersion | sed -e 's/-.*//') -our_package=$(LC_ALL=C dpkg-parsechangelog -l"$DEBIAN/changelog" -SSource) -our_source=$(echo "$our_package" | sed -e 's/-restricted-modules//') -case "$our_package" in -linux-restricted-modules*) our_type="lrm" ;; -*) our_type="main" ;; -esac - -# Update rules are complex. We update development series kernels to the -# versions in development. For stable series we update versions against -# the series in which our prime kernel was built. This is expressed -# via the map/dkms-versions namespace. Attempt to map via our series -# and then our mainline-version. - -# Try and find a package specific dkms-versions fragment. Try: -# handle+type -# series+type -# mainline+type -# series - backwards compatibility -# mainline - backwards compatibility -for versions_path_tail in \ - "$our_series:$our_source:$our_type" \ - "$our_series:$our_mainline:$our_type" \ - "$our_series:$our_type" \ - "$our_mainline:$our_type" \ - "$our_series" \ - "$our_mainline" -do - echo "II: trying $versions_path_tail ..." - versions_paths=$(echo $(cat_file -p "${git_base}map/dkms-versions/$versions_path_tail" 2>/dev/null)) - [ -n "$versions_paths" ] && break -done - -if [ -z "$versions_paths" ]; then - echo "$0: unable to identify dkms-versions mapping" 1>&2 - exit 1 -fi - -echo "git_base<$git_base> versions_paths<$versions_paths>" -echo "II: grabbing dkms-versions from $sru_cycle $versions_paths" - -: ">debian/dkms-versions.new" -for versions_path in $versions_paths -do - cat_file -p "$git_base$versions_path" >>"debian/dkms-versions.new" - if [ "$?" -ne 0 ]; then - echo "$0: unable to download an updated dkms-versions file" 1>&2 - exit 1 - fi -done -mv "debian/dkms-versions.new" "debian/dkms-versions" - -thing="debian/dkms-versions" -if ! git diff --exit-code -- "$thing" >/dev/null; then - git commit -m "UBUNTU: $thing -- update from kernel-versions ($git_human)" \ - -m "BugLink: https://bugs.launchpad.net/bugs/1786013" \ - -s -- "$thing" -else - echo "$thing: no changes from kernel-versions" -fi - -exit 0