From patchwork Mon Mar 8 14:59:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 1449148 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvM2q2MY9z9sWq; Tue, 9 Mar 2021 02:00:19 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lJHMk-0004xH-W7; Mon, 08 Mar 2021 15:00:14 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMe-0004vS-FS for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:08 +0000 Received: from mail-wr1-f72.google.com ([209.85.221.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMe-00062W-7o for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:08 +0000 Received: by mail-wr1-f72.google.com with SMTP id n16so3861072wro.1 for ; Mon, 08 Mar 2021 07:00:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u2A5VZM40QKttyq6iJNxzGoNN+lAohGhblimXVI4ljU=; b=lWPCG+XHkjeof8pK/HZtZufXVNkOutBPJo0bQWJJwpIQYPQJvSDKwPlDkgDfirzMDR vuuePa36ew1mSgzJA0PCMihaE/7mZpc4PNzq2aolGwJA8uniX5y5kz9lA5coCVroXLfu xKFBLSwh6ewqYF4rsYJUyTLBTmAAzXAirSup9DI+iC+CiczB+ohLpTXgPESN/mTke6qq oOCXOl5rVZz2lH/78Anx5TC0hzzYm+J1j+ukIyrgas5wh1qoroC8qUJt2571cLOzM8bv yFnrQpSiELvit82yva2ypXa1qVcmc7aLHturAUnHYnomu4j/ukaY3+coLyLr7RK0ow/I F2/w== X-Gm-Message-State: AOAM531AydiVOZI/SXVGCip5Fk3qo0mdfvCaoBPV97aig+EFNIZ4TJdk SA2dwukPsaQHhZCWl60hBIogLJNh9tOr1BzQ/1YssU6fJOZij/6h/wH6Uqg5R8lc8qr9KfGC1mR Cptc8t09JqelXo6YtXvtQ0bGMoFGaRFpsP0PqJ2IkFw== X-Received: by 2002:adf:e603:: with SMTP id p3mr23657973wrm.360.1615215607510; Mon, 08 Mar 2021 07:00:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyw26Zp1qcR0GtqKrO5BoxtNe9H0In5xmgI4jRjghlU3brDil39oopdqOoLZK9VHrUnUrgCWQ== X-Received: by 2002:adf:e603:: with SMTP id p3mr23657940wrm.360.1615215607191; Mon, 08 Mar 2021 07:00:07 -0800 (PST) Received: from localhost ([2001:470:6973:2:2843:61fd:9f2a:3b98]) by smtp.gmail.com with ESMTPSA id 3sm21748530wry.72.2021.03.08.07.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:00:06 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/9] UBUNTU: [Packaging] parameterise package generator based on package Date: Mon, 8 Mar 2021 14:59:56 +0000 Message-Id: <20210308150004.1746089-2-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308150004.1746089-1-apw@canonical.com> References: <20210308150004.1746089-1-apw@canonical.com> 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: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Move debian/scripts/gen-rules to a package specific name and add a simple name based switch table to call it. No changes are made to gen-rules.lrm. BugLink: https://bugs.launchpad.net/bugs/1918134 Signed-off-by: Andy Whitcroft --- debian/scripts/gen-rules | 175 +---------------------------------- debian/scripts/gen-rules.lrm | 173 ++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+), 170 deletions(-) create mode 100755 debian/scripts/gen-rules.lrm diff --git a/debian/scripts/gen-rules b/debian/scripts/gen-rules index 19830c0..ff91f48 100755 --- a/debian/scripts/gen-rules +++ b/debian/scripts/gen-rules @@ -1,173 +1,8 @@ #!/bin/bash -mkdir -p "debian/control.d" -cat "debian/rules.in" >"debian/rules.gen" -: >"debian/control.gen" -: >"debian/control.d/meta-nvidia" -: >"debian/control.d/nvidia" -: >"debian/control.d/migrate-nvidia" -: >"debian/control.d/transitionals-local" +src_package=$(LC_ALL=C dpkg-parsechangelog -SSource) +case "$src_package" in +linux-restricted-modules*) pkg='lrm' ;; +esac -dkms_build_new=$(grep -c 'shift 7' debian/scripts/dkms-build) -if [ "$dkms_build_new" -eq 0 ]; then - sed -i -e '/debian\/scripts\/dkms-build/s/ $(4)//' debian/rules.gen -fi - -nvidia_desktop= -nvidia_server= -nvidia_ignore= -while read command arg -do - case "$command" in - option) ;; - suppress) nvidia_ignore="$nvidia_ignore $arg"; continue ;; - *) continue ;; - esac - - case "$arg" in - desktop) nvidia_desktop=y ;; - server) nvidia_server=y ;; - esac -done <"debian/package.config" - -while read command flavour archs -do - case "$command" in - build) ;; - *) continue ;; - esac - - targets=$(echo "$archs" | sed -e 's/\>"debian/control.gen" <= @VERSION@) [${archs}], - linux-buildinfo-@ABI@-${flavour} (>= @VERSION@) [${archs}], -EOL - - while read package version extra - do - case "$package" in - nvidia-graphics-drivers-*-server) - [ -z "$nvidia_server" ] && continue - ;; - nvidia-graphics-drivers-*) - [ -z "$nvidia_desktop" ] && continue - ;; - *) continue ;; - esac - case " $nvidia_ignore " in - *\ $package\ *) continue ;; - esac - - case " $extra " in - *\ signonly\ *) continue ;; - esac - - suffix_minus=$(echo "$package" | sed -e 's/nvidia-graphics-drivers-//') - suffix_under=$(echo "$suffix_minus" | sed -e 's/-/_/g') - suffix_short=$(echo "$suffix_minus" | sed -e 's/-server/srv/g') - - echo "II: build $package for $flavour $archs" - - # debian/rules.gen - { - echo "" - #echo "# $package $version $suffix_minus $suffix_under" - echo "dkms_nvidia_${suffix_under}_version=\$(shell gawk '/^${package} / { print \$\$2; }' debian/dkms-versions)" - echo "nvidia_${suffix_under}_upstream_version=\$(shell echo \"\$(dkms_nvidia_${suffix_under}_version)\" | cut -d '-' -f 1)" - echo "gencontrol_flags += -Vdkms:nvidia-${suffix_minus}-modules=\"nvidia-dkms-${suffix_minus} (= \$(dkms_nvidia_${suffix_under}_version))\"" - echo "gencontrol_flags += -Vnvk:nvidia-${suffix_minus}=\"nvidia-kernel-common-${suffix_minus} (<= \$(nvidia_${suffix_under}_upstream_version)-1), nvidia-kernel-common-${suffix_minus} (>= \$(nvidia_${suffix_under}_upstream_version))\"" - echo "test::" - echo " @echo $package $version $suffix_minus $suffix_under $suffix_short $targets" - echo "$targets::" - echo " rm -rf \$(dkms_dir)/build \$(dkms_dir)/source" - echo " mkdir -p \$(dkms_dir)/build \$(dkms_dir)/source" - echo " install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}" - echo " install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/usr/lib/linux/triggers" - echo " \$(call build_dkms, \$(src_abi)-${flavour}, linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}, \$(CURDIR)/debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/lib/modules/\$(src_abi)-${flavour}/kernel, \"\", nvidia-${suffix_short}, pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-kernel-source-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-dkms-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb)" - echo " \$(call install_control,linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour},${flavour},nvidia,${suffix_short},postinst postrm prerm config templates)" - } >>"debian/rules.gen" - - # debian/control.d/meta-nvidia - cat - >>"debian/control.d/meta-nvidia" < -Architecture: ${archs} -Section: kernel -Provides: \${dkms:nvidia-${suffix_minus}-modules}, nvidia-prebuilt-kernel -Depends: - \${misc:Depends}, - linux-modules-nvidia-${suffix_minus}-@ABI@-${flavour} (= \${binary:Version}), - \${nvk:nvidia-${suffix_minus}} -Description: Extra drivers for nvidia-${suffix_minus} for the ${flavour}\${variant:suffix} flavour - Install extra signed nvidia-${suffix_minus} modules compatible with the ${flavour}\${variant:suffix} flavour. - -EOL - - # debian/control.d/nvidia - cat - >>"debian/control.d/nvidia" < -Architecture: ${archs} -Section: kernel -Priority: optional -Built-Using: \${linux:BuiltUsing} -Depends: - \${misc:Depends}, - \${shlibs:Depends}, - binutils, - linux-image-@ABI@-${flavour} | linux-image-unsigned-@ABI@-${flavour}, -Description: Linux kernel nvidia modules for version @ABI@ - This package contains the Linux kernel nvidia modules for version @ABI@. - . - You likely do not want to install this package directly. Instead, install the - one of the linux-modules-nvidia-${suffix_minus}-${flavour}* meta-packages, - which will ensure that upgrades work correctly, and that supporting packages are - also installed. - -EOL - # debian/control.d/migrate-nvidia - for cmd in $extra - do - case "$cmd" in - transition=*) - from="${cmd#transition=}" - from_minus=$(echo "$from" | sed -e 's/nvidia-graphics-drivers-//') - echo "II: general transition $from -> $package ($from_minus -> $suffix_minus)" - cat - >>"debian/control.d/migrate-nvidia" < linux-modules-nvidia-$to" - cat - >>"debian/control.d/transitionals-local" <"debian/rules.gen" +: >"debian/control.gen" +: >"debian/control.d/meta-nvidia" +: >"debian/control.d/nvidia" +: >"debian/control.d/migrate-nvidia" +: >"debian/control.d/transitionals-local" + +dkms_build_new=$(grep -c 'shift 7' debian/scripts/dkms-build) +if [ "$dkms_build_new" -eq 0 ]; then + sed -i -e '/debian\/scripts\/dkms-build/s/ $(4)//' debian/rules.gen +fi + +nvidia_desktop= +nvidia_server= +nvidia_ignore= +while read command arg +do + case "$command" in + option) ;; + suppress) nvidia_ignore="$nvidia_ignore $arg"; continue ;; + *) continue ;; + esac + + case "$arg" in + desktop) nvidia_desktop=y ;; + server) nvidia_server=y ;; + esac +done <"debian/package.config" + +while read command flavour archs +do + case "$command" in + build) ;; + *) continue ;; + esac + + targets=$(echo "$archs" | sed -e 's/\>"debian/control.gen" <= @VERSION@) [${archs}], + linux-buildinfo-@ABI@-${flavour} (>= @VERSION@) [${archs}], +EOL + + while read package version extra + do + case "$package" in + nvidia-graphics-drivers-*-server) + [ -z "$nvidia_server" ] && continue + ;; + nvidia-graphics-drivers-*) + [ -z "$nvidia_desktop" ] && continue + ;; + *) continue ;; + esac + case " $nvidia_ignore " in + *\ $package\ *) continue ;; + esac + + case " $extra " in + *\ signonly\ *) continue ;; + esac + + suffix_minus=$(echo "$package" | sed -e 's/nvidia-graphics-drivers-//') + suffix_under=$(echo "$suffix_minus" | sed -e 's/-/_/g') + suffix_short=$(echo "$suffix_minus" | sed -e 's/-server/srv/g') + + echo "II: build $package for $flavour $archs" + + # debian/rules.gen + { + echo "" + #echo "# $package $version $suffix_minus $suffix_under" + echo "dkms_nvidia_${suffix_under}_version=\$(shell gawk '/^${package} / { print \$\$2; }' debian/dkms-versions)" + echo "nvidia_${suffix_under}_upstream_version=\$(shell echo \"\$(dkms_nvidia_${suffix_under}_version)\" | cut -d '-' -f 1)" + echo "gencontrol_flags += -Vdkms:nvidia-${suffix_minus}-modules=\"nvidia-dkms-${suffix_minus} (= \$(dkms_nvidia_${suffix_under}_version))\"" + echo "gencontrol_flags += -Vnvk:nvidia-${suffix_minus}=\"nvidia-kernel-common-${suffix_minus} (<= \$(nvidia_${suffix_under}_upstream_version)-1), nvidia-kernel-common-${suffix_minus} (>= \$(nvidia_${suffix_under}_upstream_version))\"" + echo "test::" + echo " @echo $package $version $suffix_minus $suffix_under $suffix_short $targets" + echo "$targets::" + echo " rm -rf \$(dkms_dir)/build \$(dkms_dir)/source" + echo " mkdir -p \$(dkms_dir)/build \$(dkms_dir)/source" + echo " install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}" + echo " install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/usr/lib/linux/triggers" + echo " \$(call build_dkms, \$(src_abi)-${flavour}, linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}, \$(CURDIR)/debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/lib/modules/\$(src_abi)-${flavour}/kernel, \"\", nvidia-${suffix_short}, pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-kernel-source-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-dkms-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb)" + echo " \$(call install_control,linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour},${flavour},nvidia,${suffix_short},postinst postrm prerm config templates)" + } >>"debian/rules.gen" + + # debian/control.d/meta-nvidia + cat - >>"debian/control.d/meta-nvidia" < +Architecture: ${archs} +Section: kernel +Provides: \${dkms:nvidia-${suffix_minus}-modules}, nvidia-prebuilt-kernel +Depends: + \${misc:Depends}, + linux-modules-nvidia-${suffix_minus}-@ABI@-${flavour} (= \${binary:Version}), + \${nvk:nvidia-${suffix_minus}} +Description: Extra drivers for nvidia-${suffix_minus} for the ${flavour}\${variant:suffix} flavour + Install extra signed nvidia-${suffix_minus} modules compatible with the ${flavour}\${variant:suffix} flavour. + +EOL + + # debian/control.d/nvidia + cat - >>"debian/control.d/nvidia" < +Architecture: ${archs} +Section: kernel +Priority: optional +Built-Using: \${linux:BuiltUsing} +Depends: + \${misc:Depends}, + \${shlibs:Depends}, + binutils, + linux-image-@ABI@-${flavour} | linux-image-unsigned-@ABI@-${flavour}, +Description: Linux kernel nvidia modules for version @ABI@ + This package contains the Linux kernel nvidia modules for version @ABI@. + . + You likely do not want to install this package directly. Instead, install the + one of the linux-modules-nvidia-${suffix_minus}-${flavour}* meta-packages, + which will ensure that upgrades work correctly, and that supporting packages are + also installed. + +EOL + # debian/control.d/migrate-nvidia + for cmd in $extra + do + case "$cmd" in + transition=*) + from="${cmd#transition=}" + from_minus=$(echo "$from" | sed -e 's/nvidia-graphics-drivers-//') + echo "II: general transition $from -> $package ($from_minus -> $suffix_minus)" + cat - >>"debian/control.d/migrate-nvidia" < linux-modules-nvidia-$to" + cat - >>"debian/control.d/transitionals-local" < X-Patchwork-Id: 1449149 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvM2q6TNNz9sWr; Tue, 9 Mar 2021 02:00:19 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lJHMm-0004xo-4J; Mon, 08 Mar 2021 15:00:16 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMf-0004vb-Pc for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:09 +0000 Received: from mail-wr1-f72.google.com ([209.85.221.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMf-00062t-IG for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:09 +0000 Received: by mail-wr1-f72.google.com with SMTP id g5so4913051wrd.22 for ; Mon, 08 Mar 2021 07:00:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RSGRxdOWoYOhUjb36Y++uUvncisc/+zERV7RMOSmkxk=; b=X5F18lB47QgDK96IUtfW9hOBP3XlHurGGzxuLtVGbk+DfNsYEBjXvsWym5QbGtvqxO U8w/xlNKTcOZzrEfZWYT/oxDTcmYb8D6QC14vez6t//GXfxNY6stSjV3Lk4/4YKfUlpT erXm20zHLvI+awESmI2P4A4B5M8Y9KlVz6BjcRrXy+Lq/8BOGMcnRLnSFT11DhUXP4Uu ukHx9fZjk7hhIQvDp5mAD7r/SJ3Da6Bdk2YSuzcbb4koMaDxhSAy+pbwuM1ShZDnhAVm IHTtbpw0X/Hu9HmP7KQgukbtZJa7oiM7MhH1F+4fYHtzxIl8mPrEXhUxhtV8XR5qaG8x dwZg== X-Gm-Message-State: AOAM533mG8ATYlvh4DZ9iXoRJGyKuIxM1pifD1kv/jjCLT68wKpy9a8o Q9ztAqtGVwezZ4U793sc1fHQRNioaA8CC8SFzr+GeGBNozi8lMrAm036zciY4nRraXsaU8VaPN8 MzQxgsadFW6kUSf3QoDvV5ZhqC+huKx7LcaF5H1A3HA== X-Received: by 2002:adf:dbc2:: with SMTP id e2mr23135309wrj.227.1615215608897; Mon, 08 Mar 2021 07:00:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRpX7GCP6wKAjQkG15uDeE198SNoi3vVr/HcWpupaHYNr+D3BcdzALYbtSR79/+aqwOYhjDQ== X-Received: by 2002:adf:dbc2:: with SMTP id e2mr23135278wrj.227.1615215608576; Mon, 08 Mar 2021 07:00:08 -0800 (PST) Received: from localhost ([2001:470:6973:2:2843:61fd:9f2a:3b98]) by smtp.gmail.com with ESMTPSA id v7sm18780422wme.47.2021.03.08.07.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:00:08 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/9] UBUNTU: [Packaging] gen-rules -- clean up debian/rules fragment Date: Mon, 8 Mar 2021 14:59:57 +0000 Message-Id: <20210308150004.1746089-3-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308150004.1746089-1-apw@canonical.com> References: <20210308150004.1746089-1-apw@canonical.com> 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: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Convert debian/rules fragement to a simple here script in line with the others in this section. Makes the thing simpler to read, to quote for, and more consistent. BugLink: https://bugs.launchpad.net/bugs/1918134 Signed-off-by: Andy Whitcroft --- debian/scripts/gen-rules.lrm | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/debian/scripts/gen-rules.lrm b/debian/scripts/gen-rules.lrm index 19830c0..7dc774e 100755 --- a/debian/scripts/gen-rules.lrm +++ b/debian/scripts/gen-rules.lrm @@ -70,23 +70,23 @@ EOL echo "II: build $package for $flavour $archs" # debian/rules.gen - { - echo "" - #echo "# $package $version $suffix_minus $suffix_under" - echo "dkms_nvidia_${suffix_under}_version=\$(shell gawk '/^${package} / { print \$\$2; }' debian/dkms-versions)" - echo "nvidia_${suffix_under}_upstream_version=\$(shell echo \"\$(dkms_nvidia_${suffix_under}_version)\" | cut -d '-' -f 1)" - echo "gencontrol_flags += -Vdkms:nvidia-${suffix_minus}-modules=\"nvidia-dkms-${suffix_minus} (= \$(dkms_nvidia_${suffix_under}_version))\"" - echo "gencontrol_flags += -Vnvk:nvidia-${suffix_minus}=\"nvidia-kernel-common-${suffix_minus} (<= \$(nvidia_${suffix_under}_upstream_version)-1), nvidia-kernel-common-${suffix_minus} (>= \$(nvidia_${suffix_under}_upstream_version))\"" - echo "test::" - echo " @echo $package $version $suffix_minus $suffix_under $suffix_short $targets" - echo "$targets::" - echo " rm -rf \$(dkms_dir)/build \$(dkms_dir)/source" - echo " mkdir -p \$(dkms_dir)/build \$(dkms_dir)/source" - echo " install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}" - echo " install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/usr/lib/linux/triggers" - echo " \$(call build_dkms, \$(src_abi)-${flavour}, linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}, \$(CURDIR)/debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/lib/modules/\$(src_abi)-${flavour}/kernel, \"\", nvidia-${suffix_short}, pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-kernel-source-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-dkms-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb)" - echo " \$(call install_control,linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour},${flavour},nvidia,${suffix_short},postinst postrm prerm config templates)" - } >>"debian/rules.gen" + cat - >>"debian/rules.gen" <= \$(nvidia_${suffix_under}_upstream_version))" +test:: + @echo $package $version $suffix_minus $suffix_under $suffix_short $targets +$targets:: + rm -rf \$(dkms_dir)/build \$(dkms_dir)/source + mkdir -p \$(dkms_dir)/build \$(dkms_dir)/source + install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour} + install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/usr/lib/linux/triggers + \$(call build_dkms, \$(src_abi)-${flavour}, linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}, \$(CURDIR)/debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/lib/modules/\$(src_abi)-${flavour}/kernel, "", nvidia-${suffix_short}, pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-kernel-source-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-dkms-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb) + \$(call install_control,linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour},${flavour},nvidia,${suffix_short},postinst postrm prerm config templates) +EOL # debian/control.d/meta-nvidia cat - >>"debian/control.d/meta-nvidia" < X-Patchwork-Id: 1449150 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvM2r1N24z9sWw; Tue, 9 Mar 2021 02:00:19 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lJHMm-0004yC-Da; Mon, 08 Mar 2021 15:00:16 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMh-0004wN-2u for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:11 +0000 Received: from mail-wr1-f71.google.com ([209.85.221.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMg-00063C-Rg for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:10 +0000 Received: by mail-wr1-f71.google.com with SMTP id z17so4931618wrv.23 for ; Mon, 08 Mar 2021 07:00:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oi8SOrB5R7iXQgGg7XEklsqy92ZsAeEQbfhw4cn57Tw=; b=GzeLNcmGuzW5rvX8tCK7RpvkyqpSRiy19inyB9avp0gLNgyF+VUbO5wQ146pQdb1zD XGNP2dRDS98WmgAS859InTnRKX9aUhgb5kDIqU8DPZ6Z62y9VDZNOi1Bq4OjtQyjl27e Q7hSDCDMzDb873CLRIn3fsl8ZZs+lZoicy6M/kttXTnow8QjWO6UWQOSECMlOIHLTUeZ youZXErvaleWZ5c8NqCNC3o7XHQo9zxoHnFpUlU8JJ3cu8k4PagQ9WApefkhPpMCXG/C viIb3+lCgLZFzd/L213HBjwg7xSm7CEHl44AkTHqF0lxS+q0lxdkwFah3HG04gXf9Lu6 SVxw== X-Gm-Message-State: AOAM531wSpnei+0fv2UWcEH32YVNA4caPjYDmJEIYBbyNTurJ28xurfM KnurnSADG7n6H8ZsQYB0lq5FtvhEONZzRJtnZy9sfIh/AlyjPFBUMAZpLoH4/T7PUxcxwB4Atm/ 3/DXvCPau0e3gLOwxqkjl0HwrbSLdE2SAU2w3o0B/uw== X-Received: by 2002:a5d:4e83:: with SMTP id e3mr23613920wru.82.1615215610161; Mon, 08 Mar 2021 07:00:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUFjY/wmu9bMFfVcK8+YLHXiSIq0Ojt3RuUUPq0MCZ6bBv6CWmHRHDCPpiBX5UxK6kPAxg+w== X-Received: by 2002:a5d:4e83:: with SMTP id e3mr23613904wru.82.1615215609934; Mon, 08 Mar 2021 07:00:09 -0800 (PST) Received: from localhost ([2001:470:6973:2:2843:61fd:9f2a:3b98]) by smtp.gmail.com with ESMTPSA id 3sm21748732wry.72.2021.03.08.07.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:00:09 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/9] UBUNTU: [Packaging] dkms-build--nvidia-N -- handle symbol versioning being enabled Date: Mon, 8 Mar 2021 14:59:58 +0000 Message-Id: <20210308150004.1746089-4-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308150004.1746089-1-apw@canonical.com> References: <20210308150004.1746089-1-apw@canonical.com> 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: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" We get more linker commands emitted when symbol versioning is enabled. We don't need to replicate these command because we consume the .o files after these have been applied. Elide them from the BUILD/CLEAN helpers. This eliminates some frightening (but actually benign) error messages. BugLink: https://bugs.launchpad.net/bugs/1918134 Signed-off-by: Andy Whitcroft --- debian/scripts/dkms-build--nvidia-N | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/debian/scripts/dkms-build--nvidia-N b/debian/scripts/dkms-build--nvidia-N index bdec782..5f07ef2 100755 --- a/debian/scripts/dkms-build--nvidia-N +++ b/debian/scripts/dkms-build--nvidia-N @@ -36,9 +36,8 @@ mkdir -p "$pkgdir/bits/scripts" # Install the support files we need. cp "$srcdir/scripts/module-common.lds" "$pkgdir/bits/scripts" -grep /usr/bin/ld.bfd "$log" | sed -e "s@$build/@@g" >"$pkgdir/bits/BUILD" -grep /usr/bin/ld.bfd "$log" | sed -e "s@$build/@@g" \ - -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' >"$pkgdir/bits/CLEAN" +grep /usr/bin/ld.bfd "$log" | grep -v scripts/genksyms/genksyms | sed -e "s@$build/@@g" >"$pkgdir/bits/BUILD" +sed -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' <"$pkgdir/bits/BUILD" >"$pkgdir/bits/CLEAN" # As the builds contain the absolute filenames as used. Use RECONSTRUCT to # rebuild the .ko's, sign them, pull off the signatures and then finally clean From patchwork Mon Mar 8 14:59:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 1449151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvM2r5k9Zz9sXN; Tue, 9 Mar 2021 02:00:20 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lJHMn-0004yd-1Y; Mon, 08 Mar 2021 15:00:17 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMi-0004wd-CR for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:12 +0000 Received: from mail-wr1-f72.google.com ([209.85.221.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMi-00063X-4A for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:12 +0000 Received: by mail-wr1-f72.google.com with SMTP id z17so4931647wrv.23 for ; Mon, 08 Mar 2021 07:00:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d0z/BDBbVE2qCD8nkCcMfBIb+FbD8fuy1h0ynSeydRo=; b=CugWsiZ6U8OHQVPh6rJZ6jmvb6s4LF9hHiztsLjBFblAoiVhZQdzLi3Z3Bhdwcsck9 S+yblOssrqCDq/ZglzvtfK67nxJ5HbzZ9Fxc03zv7W1vjo2oRaheFGtI4y73gFpDoWhJ fYgKD9lPO7oZlurzE22ur177UzfB7XMIdDS4L1iodmDGGSub+X/JtTb8Gc6hIWi7cgWq G0k5CHgkNvCjYaeEnuVIon/Uu8xxACbf4v+JAaJUSuovODRNjdNIqKmEc3X05Wl6TOXj gBqeUc/yMe/KNRhSSC7oeY6Sdh8oY2BOdsL2VG56eSJ/3FyNquZTy392W1aEwggk9ov7 ixmg== X-Gm-Message-State: AOAM531f5z75IhqoSZ2FLRYyscmsBcrq9nhidy1034KAempwxO3jW3ZK U50Pm1ACPoZsQTe2xBg2niGHlrEWiCAlMP21jZx+ZdW9k6G2m2upJ32xXGvgP+eUYn7HMiUzj6J GOLP2l7aXT9sq8Vvt4kYSzCOoo+/Lwe2L6op2BNjKnQ== X-Received: by 2002:a5d:6703:: with SMTP id o3mr23181543wru.357.1615215611501; Mon, 08 Mar 2021 07:00:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvKBhYSBdgRgWvqIqXH0TlXIF1qRd+iAJITyalF2JXJDXCF2SrCAea7LpGSP3+uG2gcdHUfQ== X-Received: by 2002:a5d:6703:: with SMTP id o3mr23181517wru.357.1615215611207; Mon, 08 Mar 2021 07:00:11 -0800 (PST) Received: from localhost ([2001:470:6973:2:2843:61fd:9f2a:3b98]) by smtp.gmail.com with ESMTPSA id c35sm17812612wmp.3.2021.03.08.07.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:00:10 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/9] UBUNTU: [Packaging] dkms-build--nvidia-N -- follow changes to lds naming Date: Mon, 8 Mar 2021 14:59:59 +0000 Message-Id: <20210308150004.1746089-5-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308150004.1746089-1-apw@canonical.com> References: <20210308150004.1746089-1-apw@canonical.com> 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: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" In later kernels they have renamed the modules-common.lds file. Handle both the old and new names. We pick up the appropriate file from headers which are available (as they are in preparation) or actually installed as a build-dependency in all contexts. Drop the internal copy of this script and the update-version configuration to keep it up to date. BugLink: https://bugs.launchpad.net/bugs/1918134 Signed-off-by: Andy Whitcroft --- debian/scripts/dkms-build--nvidia-N | 15 ++++++++++++++- scripts/module-common.lds | 26 -------------------------- update-version | 3 +-- 3 files changed, 15 insertions(+), 29 deletions(-) delete mode 100644 scripts/module-common.lds diff --git a/debian/scripts/dkms-build--nvidia-N b/debian/scripts/dkms-build--nvidia-N index 5f07ef2..29e4152 100755 --- a/debian/scripts/dkms-build--nvidia-N +++ b/debian/scripts/dkms-build--nvidia-N @@ -35,7 +35,20 @@ mkdir -p "$pkgdir/bits/scripts" ) # Install the support files we need. -cp "$srcdir/scripts/module-common.lds" "$pkgdir/bits/scripts" +echo "II: copying support files ..." +for lds_src in \ + "$dkms_dir/headers/linux-headers-$abi_flavour/scripts/module.lds" \ + "/usr/src/linux-headers-$abi_flavour/scripts/module.lds" \ + "$dkms_dir/headers/linux-headers-$abi_flavour/scripts/module-common.lds" \ + "/usr/src/linux-headers-$abi_flavour/scripts/module-common.lds" +do + [ ! -f "$lds_src" ] && continue + echo "II: copying support files ... found $lds_src" + cp "$lds_src" "$pkgdir/bits/scripts" + break +done + +# Build helper scripts. grep /usr/bin/ld.bfd "$log" | grep -v scripts/genksyms/genksyms | sed -e "s@$build/@@g" >"$pkgdir/bits/BUILD" sed -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' <"$pkgdir/bits/BUILD" >"$pkgdir/bits/CLEAN" diff --git a/scripts/module-common.lds b/scripts/module-common.lds deleted file mode 100644 index d61b9e8..0000000 --- a/scripts/module-common.lds +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Common module linker script, always used when linking a module. - * Archs are free to supply their own linker scripts. ld will - * combine them automatically. - */ -SECTIONS { - /DISCARD/ : { - *(.discard) - *(.discard.*) - } - - __ksymtab 0 : { *(SORT(___ksymtab+*)) } - __ksymtab_gpl 0 : { *(SORT(___ksymtab_gpl+*)) } - __ksymtab_unused 0 : { *(SORT(___ksymtab_unused+*)) } - __ksymtab_unused_gpl 0 : { *(SORT(___ksymtab_unused_gpl+*)) } - __ksymtab_gpl_future 0 : { *(SORT(___ksymtab_gpl_future+*)) } - __kcrctab 0 : { *(SORT(___kcrctab+*)) } - __kcrctab_gpl 0 : { *(SORT(___kcrctab_gpl+*)) } - __kcrctab_unused 0 : { *(SORT(___kcrctab_unused+*)) } - __kcrctab_unused_gpl 0 : { *(SORT(___kcrctab_unused_gpl+*)) } - __kcrctab_gpl_future 0 : { *(SORT(___kcrctab_gpl_future+*)) } - - .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) } - - __jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) } -} diff --git a/update-version b/update-version index 94a6908..f6d231b 100755 --- a/update-version +++ b/update-version @@ -46,8 +46,7 @@ for thing in \ debian/scripts/misc/git-ubuntu-log \ debian/scripts/dkms-build \ debian/scripts/dkms-build--nvidia-N \ - debian/scripts/fix-filenames.c \ - scripts/module-common.lds + debian/scripts/fix-filenames.c do cp -p "$master_dir/$thing" "$thing" || exit 1 if ! git diff --exit-code -- "$thing" >/dev/null; then From patchwork Mon Mar 8 15:00:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 1449153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvM312cRLz9sWf; Tue, 9 Mar 2021 02:00:29 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lJHMt-00053s-Hb; Mon, 08 Mar 2021 15:00:23 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMj-0004wt-Hj for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:13 +0000 Received: from mail-wm1-f72.google.com ([209.85.128.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMj-00063l-9V for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:13 +0000 Received: by mail-wm1-f72.google.com with SMTP id a3so2145024wmm.0 for ; Mon, 08 Mar 2021 07:00:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SuDoS3aC212S/2QZ3E5x+n5ZbbjPrEVXKijtOXwW+HA=; b=dYK2506vV6xMeD4uiS1kYYhV1j4O8DG6vpaXx2h2eIgQWJVnLythCx4FExLrPFyZZX LZDMHsRXBycPOsEw3pjoXRJrhVVG/T3wxLSPvyHWXoVwAiAGrlnrYMbel2JE3+T7ehmS vD/lbNBAHvKTaW7hd3/qEYNrZAPpBUMXgQKTeMk8YkvBqJ6LHVkZ/zvwhAEgdJGUousA gVozVeJcAG1vlBpgJ17/OdD5I/9y+Qnz2KqYxrIW7dygTW16cg13nrCJf9CYUJvX3FbQ I3mVqvKtVUqFTiHF9WKcmI87HdiDTnpHT7fLQv9PwDyhLCevXfthHya14L2x9gOe+IbV 3tRw== X-Gm-Message-State: AOAM530HvdCilrNwi8T02wEk+7U2vGfKFwT7T1ObqPtIfl9HOq3TrPwd ouLi3+2O0iruTwJndlTeAq5G+PRGsI0azWu0Y3qF7GH0YiAVn3Q0v34hRWv2EKmwgHWfo2EoDf8 wxJpgXwSRS7FWVF0db6aynpkKgK8Wm6hZ4TKeLfF12g== X-Received: by 2002:a5d:6205:: with SMTP id y5mr23066093wru.238.1615215612751; Mon, 08 Mar 2021 07:00:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2f5YVY6wUft7GU8bia1C6bQIMjWNdnbg0BoY9tB8oXHh8YiterYKvuVsc2ebTgJbQfRYMZg== X-Received: by 2002:a5d:6205:: with SMTP id y5mr23066073wru.238.1615215612497; Mon, 08 Mar 2021 07:00:12 -0800 (PST) Received: from localhost ([2001:470:6973:2:2843:61fd:9f2a:3b98]) by smtp.gmail.com with ESMTPSA id b65sm19356119wmh.4.2021.03.08.07.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:00:12 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/9] UBUNTU: [Packaging] dkms-build--nvidia-N -- add unsigned build mode to helpers Date: Mon, 8 Mar 2021 15:00:00 +0000 Message-Id: <20210308150004.1746089-6-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308150004.1746089-1-apw@canonical.com> References: <20210308150004.1746089-1-apw@canonical.com> 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: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" We are going to use the helpers from linux-restricted-generate directly and would like the option there to invoke building of an unsigned .ko set. Add an 'unsigned' parameter to the BUILD helper for this purpose. Switch to that internally as this form is much clearer. BugLink: https://bugs.launchpad.net/bugs/1918134 Signed-off-by: Andy Whitcroft --- debian/scripts/dkms-build--nvidia-N | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/debian/scripts/dkms-build--nvidia-N b/debian/scripts/dkms-build--nvidia-N index 29e4152..b79404b 100755 --- a/debian/scripts/dkms-build--nvidia-N +++ b/debian/scripts/dkms-build--nvidia-N @@ -49,7 +49,10 @@ do done # Build helper scripts. -grep /usr/bin/ld.bfd "$log" | grep -v scripts/genksyms/genksyms | sed -e "s@$build/@@g" >"$pkgdir/bits/BUILD" +cat - <<'EOL' >"$pkgdir/bits/BUILD" +[ "$1" = "unsigned" ] && signed_only=: +EOL +grep /usr/bin/ld.bfd "$log" | grep -v scripts/genksyms/genksyms | sed -e "s@$build/@@g" >>"$pkgdir/bits/BUILD" sed -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' <"$pkgdir/bits/BUILD" >"$pkgdir/bits/CLEAN" # As the builds contain the absolute filenames as used. Use RECONSTRUCT to @@ -57,15 +60,20 @@ sed -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' <"$pkgdir/bits/BUILD" >"$pkgdir/bits/C # up again. ( cd "$pkgdir/bits" || exit 1 - sh ./CLEAN - sh ./BUILD - for ko in *.ko + + # Add .ko handling to the CLEAN/BUILD dance. + for ko in "$pkgdir"/*.ko do - echo "cat '$ko' '$ko.sig' >'../$ko'" >>"$pkgdir/bits/BUILD" - echo "rm -f '$ko'" >>"$pkgdir/bits/BUILD" + ko=$(basename "$ko") + echo "\$signed_only cat '$ko' '$ko.sig' >'../$ko'" >>"$pkgdir/bits/BUILD" + echo "\$signed_only rm -f '$ko'" >>"$pkgdir/bits/BUILD" echo "rm -f '../$ko'" >>"$pkgdir/bits/CLEAN" done + # Clear out anything we are not going to distribute and build unsigned .kos. + sh ./CLEAN + sh ./BUILD unsigned + if [ "$sign" = "--custom" ]; then # We are building for and archive custom signing upload. Keep everything. : From patchwork Mon Mar 8 15:00:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 1449156 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvM351FmPz9sWc; Tue, 9 Mar 2021 02:00:33 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lJHMz-00057n-0Y; Mon, 08 Mar 2021 15:00:29 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMl-0004xg-FN for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:15 +0000 Received: from mail-wr1-f69.google.com ([209.85.221.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMl-00064B-51 for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:15 +0000 Received: by mail-wr1-f69.google.com with SMTP id 75so4910205wrl.3 for ; Mon, 08 Mar 2021 07:00:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0Yvco/Q3Hmw4iWzF5sDTDL/nnCwF469BUl43toPjDHI=; b=nekDLFP8KLv3luvqjmaJ54gJS7jgXknfTrqEALOL/N1eCTK3jldqmdKslnXEJJJLnS QfTnFdLa70Q3+LdaOYzAdvJlTPoollfLgFebZesadAzKaqdQfWbsdgyO/dENZa1LLOS6 M48lqhIj0q2dnTbu2DrHrljgDEwDHO2agWA/GgdCPwsTVH3HUIzZlooyrhm5AP3QJXrR M/YTN1/DCek46SEgkheGTPPRy2/UMzdFyPd4qgwuxC1DsjUOgGZffl9OOsN4nirOTIsR drJH5O91tB7nj6Jja9YXmYoIQG4mNDxGdHXtOrYRe0419/5cVcRW+yhGtQCvjLLMnIBK k3EQ== X-Gm-Message-State: AOAM531GadtZ3WhIVMNFtJq4twKu/EogCnrhZLWLbd1HQrjrhJrMgJ9W SptLNxzbYc+cIaHSNZQAX+gA1olXbpBtKXPy3H8cgrPmTBUFZ/V4JCZgLcufPMFzBHjse89w6JL 13rATxILvvSEx7Zf1CRN7BThVSPNeUhEgwRglx9DNeA== X-Received: by 2002:a05:6000:1001:: with SMTP id a1mr23165482wrx.158.1615215614500; Mon, 08 Mar 2021 07:00:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4OKfulCX66ZOOJLKGS9IxjAWJzVtj6ymqY3Y+dfrUitw5lOJjmRkEoAoA+7sXk/Lama1+dw== X-Received: by 2002:a05:6000:1001:: with SMTP id a1mr23165463wrx.158.1615215614252; Mon, 08 Mar 2021 07:00:14 -0800 (PST) Received: from localhost ([2001:470:6973:2:2843:61fd:9f2a:3b98]) by smtp.gmail.com with ESMTPSA id p17sm17439200wmd.42.2021.03.08.07.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:00:13 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 6/9] UBUNTU: [Packaging] linux-restricted-generate -- generate unsigned modules for signing Date: Mon, 8 Mar 2021 15:00:01 +0000 Message-Id: <20210308150004.1746089-7-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308150004.1746089-1-apw@canonical.com> References: <20210308150004.1746089-1-apw@canonical.com> 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: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Consume the pre-built .o's as generated in linux-restricted-modules via the linux-objects-nvidia-* packages; assembling them as per the end-user system. Form a signing custom binary upload from these and submit for signing. Note that this must be embargoed as it represents fully formed module. BugLink: https://bugs.launchpad.net/bugs/1918134 Signed-off-by: Andy Whitcroft --- debian/rules.lrg | 31 +++++++ debian/scripts/dkms-build--nvidia-N | 1 + debian/scripts/gen-rules | 1 + debian/scripts/gen-rules.lrg | 138 ++++++++++++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100755 debian/rules.lrg create mode 100755 debian/scripts/gen-rules.lrg diff --git a/debian/rules.lrg b/debian/rules.lrg new file mode 100755 index 0000000..e431275 --- /dev/null +++ b/debian/rules.lrg @@ -0,0 +1,31 @@ +##export DH_VERBOSE := 1 + +arch = $(shell dpkg-architecture -qDEB_HOST_ARCH) + +test:: + echo "$(src_version) $(src_main_version)" + +debian/scripts/fix-filenames: debian/scripts/fix-filenames.c + $(CC) -o $@ $^ + +clean:: + rm -rf rm -rf $(dkms_dir) + rm -f debian/scripts/fix-filenames + +%: + dh $@ + +custom_top=debian/custom +custom_dir=$(custom_top)/$(src_version) +custom_tar=$(src_package)_$(src_version)_$(arch).tar.gz +custom-upload: + install -d $(custom_dir)/control + { echo "tarball"; echo "signed-only"; } >$(custom_dir)/control/options + cd $(custom_top) && tar czvf ../../../$(custom_tar) . + dpkg-distaddfile $(custom_tar) raw-signing - + +override_dh_prep: debian/scripts/fix-filenames + dh_prep + +override_dh_auto_install: nvidia-$(arch) custom-upload + dh_install diff --git a/debian/scripts/dkms-build--nvidia-N b/debian/scripts/dkms-build--nvidia-N index b79404b..d37082c 100755 --- a/debian/scripts/dkms-build--nvidia-N +++ b/debian/scripts/dkms-build--nvidia-N @@ -77,6 +77,7 @@ sed -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' <"$pkgdir/bits/BUILD" >"$pkgdir/bits/C if [ "$sign" = "--custom" ]; then # We are building for and archive custom signing upload. Keep everything. : + elif [ "$sign" = "--lrm" ]; then # We are in LRM build the package a copy in any signatures we can # find for them. These will be added after linking. diff --git a/debian/scripts/gen-rules b/debian/scripts/gen-rules index ff91f48..8952f4b 100755 --- a/debian/scripts/gen-rules +++ b/debian/scripts/gen-rules @@ -2,6 +2,7 @@ src_package=$(LC_ALL=C dpkg-parsechangelog -SSource) case "$src_package" in +linux-restricted-generate*) pkg='lrg' ;; linux-restricted-modules*) pkg='lrm' ;; esac diff --git a/debian/scripts/gen-rules.lrg b/debian/scripts/gen-rules.lrg new file mode 100755 index 0000000..1c13885 --- /dev/null +++ b/debian/scripts/gen-rules.lrg @@ -0,0 +1,138 @@ +#!/bin/bash + +# Pick out relevant version and package information including our predecessor +# packages: linux -> linux-restricted-modules-signatures -> linux-restricted-modules +src_package=$(LC_ALL=C dpkg-parsechangelog -SSource) +src_version=$(LC_ALL=C dpkg-parsechangelog -SVersion) +src_abi=$(echo "${src_version}" | sed -ne 's/\([0-9]*\.[0-9]*\.[0-9]*\-[0-9]*\)\..*/\1/p') +src_series=$(LC_ALL=C dpkg-parsechangelog -SDistribution | sed -e 's/-\(security\|updates\|proposed\)$//') + +# linux/5.8.0-41.46 +src_main_package=$(echo "${src_package}" | sed -e 's/-restricted-generate//') +src_main_version=$(echo ${src_version} | sed -e 's/+[0-9][0-9\.]*$//') + +# linux-restricted-generate/5.8.0-41.46[+1] + +# linux-restricted-signatures/5.8.0-41.46[+1] + +# linux-restricted-modules/5.8.0-41.46[+1] +src_lrm_package=$(echo "${src_package}" | sed -e 's/-restricted-generate/-restricted-modules/') +src_lrm_version=${src_version} + +cat - "debian/rules.lrg" >"debian/rules.gen" <"debian/control.interlock-up" + +nvidia_desktop= +nvidia_server= +nvidia_ignore= +while read command arg +do + case "$command" in + option) ;; + suppress) nvidia_ignore="$nvidia_ignore $arg"; continue ;; + *) continue ;; + esac + + case "$arg" in + desktop) nvidia_desktop=y ;; + server) nvidia_server=y ;; + esac +done <"debian/package.config" + +build_archs= +while read command flavour archs +do + case "$command" in + build) ;; + *) continue ;; + esac + + for arch in $archs + do + case " $build_archs " in + *\ $arch\ *) ;; + *) build_archs="$build_archs $arch" ;; + esac + done + + targets=$(echo "$archs" | sed -e 's/\>"debian/control.interlock-up" <= ${src_lrm_version}) [${archs}], +EOL + + # debian/rules.gen + # XXX: BUILD should help us here. + cat - >>"debian/rules.gen" <"debian/control" + +rm -f "debian/control.interlock-up" From patchwork Mon Mar 8 15:00:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 1449152 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvM2y3Lc0z9sWY; Tue, 9 Mar 2021 02:00:26 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lJHMr-00052J-6S; Mon, 08 Mar 2021 15:00:21 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMo-0004zL-AB for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:18 +0000 Received: from mail-wm1-f72.google.com ([209.85.128.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMo-00064a-1q for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:18 +0000 Received: by mail-wm1-f72.google.com with SMTP id n17so2144542wmi.2 for ; Mon, 08 Mar 2021 07:00:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4SSPu3SHjIHWN3QYmd8vTIGEs4TTboH2x9MJVbQvha0=; b=eFITjD+WoAM2/34qNxKsBfW9sYVe5dIun00sZrxxGUZJ09I7ZAhSNT46U9xevd589c NoqY54d5KoWU7GUF41cNkTnE2krqbnieR6tL/BcMyRrya+qQASRAnwIQD8AdgaLQQ8OS yW1eLtP8aprs0zwQq0EgyKl9iNexhsL6KzLeZL+4QTLVpaPdwSnEbYV3OtP5a8Bmkoae zDeECYV3oqp3vXVDJe+zRjiNOzJBt9lKod3ZRAMKToxVj/WZ7Om6ueC7SCQWwTnG411d kQ9wfmriStKqLV6A7lrajYp1Do8ZJSf6MMMcCiFYywzX82UiMl9dKYb3MEweB8XtlI3B Ejbw== X-Gm-Message-State: AOAM533qW6FUSrKmH8joYWNhIpcipLe4jllV1JwzUAHVW79CgAAZLA+L 0WPcBlGNKuIYtO4rsM0SDZ9jdckQG0vNRjclpZB5UGZsa2jqGlaJvWqsrY1SxVqi92YzprEUaA7 BfWbOxJMh4PcdVwJiM/bF30TNFRT4OaPXiY3TvY24NA== X-Received: by 2002:a05:600c:2053:: with SMTP id p19mr22519786wmg.87.1615215617123; Mon, 08 Mar 2021 07:00:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEl4Ym+FkwOxoE7b7Gtmx8hfQtDJeGCrQRgFEXAz7Ry7lG6Ck4uMhOW3iOwk7SyMofvJD5sA== X-Received: by 2002:a05:600c:2053:: with SMTP id p19mr22519758wmg.87.1615215616844; Mon, 08 Mar 2021 07:00:16 -0800 (PST) Received: from localhost ([2001:470:6973:2:2843:61fd:9f2a:3b98]) by smtp.gmail.com with ESMTPSA id h62sm19595988wmf.37.2021.03.08.07.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:00:16 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 7/9] UBUNTU: [Packaging] linux-restricted-signatures -- publish clean signatures Date: Mon, 8 Mar 2021 15:00:02 +0000 Message-Id: <20210308150004.1746089-8-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308150004.1746089-1-apw@canonical.com> References: <20210308150004.1746089-1-apw@canonical.com> 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: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Consume the signatures produced by the signing service from the signing custom binary upload and express those in a linux-signatures-nvidia-* package. These are split by flavour for simplicity of consumption by linux-restricted-modules; consumed via a simple runtime depedency. BugLink: https://bugs.launchpad.net/bugs/1918134 Signed-off-by: Andy Whitcroft --- debian/rules.lrs | 12 +++ debian/scripts/gen-rules | 1 + debian/scripts/gen-rules.lrs | 100 +++++++++++++++++++ download-signed | 183 +++++++++++++++++++++++++++++++++++ 4 files changed, 296 insertions(+) create mode 100755 debian/rules.lrs create mode 100755 debian/scripts/gen-rules.lrs create mode 100755 download-signed diff --git a/debian/rules.lrs b/debian/rules.lrs new file mode 100755 index 0000000..1c22d8e --- /dev/null +++ b/debian/rules.lrs @@ -0,0 +1,12 @@ +##export DH_VERBOSE := 1 + +arch = $(shell dpkg-architecture -qDEB_HOST_ARCH) + +%: + dh $@ + +override_dh_auto_build: + ./download-signed "$(src_genr_package)" "$(src_genr_version)" "$(src_genr_package)" + +override_dh_auto_install: nvidia-$(arch) + dh_install diff --git a/debian/scripts/gen-rules b/debian/scripts/gen-rules index 8952f4b..4894481 100755 --- a/debian/scripts/gen-rules +++ b/debian/scripts/gen-rules @@ -3,6 +3,7 @@ src_package=$(LC_ALL=C dpkg-parsechangelog -SSource) case "$src_package" in linux-restricted-generate*) pkg='lrg' ;; +linux-restricted-signature*) pkg='lrs' ;; linux-restricted-modules*) pkg='lrm' ;; esac diff --git a/debian/scripts/gen-rules.lrs b/debian/scripts/gen-rules.lrs new file mode 100755 index 0000000..8298b0e --- /dev/null +++ b/debian/scripts/gen-rules.lrs @@ -0,0 +1,100 @@ +#!/bin/bash + +# Pick out relevant version and package information including our predecessor +# packages: linux-restricted-generate -> linux-restricted-signatures -> linux-restricted-modules +src_package=$(LC_ALL=C dpkg-parsechangelog -SSource) +src_version=$(LC_ALL=C dpkg-parsechangelog -SVersion) +src_abi=$(echo "${src_version}" | sed -ne 's/\([0-9]*\.[0-9]*\.[0-9]*\-[0-9]*\)\..*/\1/p') +src_series=$(LC_ALL=C dpkg-parsechangelog -SDistribution | sed -e 's/-\(security\|updates\|proposed\)$//') + +# linux/5.8.0-41.46 +src_main_package=$(echo "${src_package}" | sed -e 's/-restricted-signature//') +src_main_version=$(echo ${src_version} | sed -e 's/+[0-9][0-9\.]*$//') + +# linux-restricted-generate/5.8.0-41.46[+1] +src_genr_package=$(echo "${src_package}" | sed -e 's/-restricted-signatures/-restricted-generate/') +src_genr_version=${src_version} + +# linux-restricted-signatures/5.8.0-41.46[+1] + +# linux-restricted-modules/5.8.0-41.46[+1] + +cat - "debian/rules.lrs" >"debian/rules.gen" <"debian/control.interlock-up" + +build_archs= +while read command flavour archs +do + case "$command" in + build) ;; + *) continue ;; + esac + + for arch in $archs + do + case " $build_archs " in + *\ $arch\ *) ;; + *) build_archs="$buildarchs $arch" ;; + esac + done +done <"debian/package.config" + +while read command flavour archs +do + case "$command" in + build) ;; + *) continue ;; + esac + + targets=$(echo "$archs" | sed -e 's/\>"debian/rules.gen" <>debian/linux-signatures-nvidia-${src_abi}-${flavour}.install; \ + done +EOL + + cat - >>"debian/control.signatures" < +Architecture: ${archs} +Section: kernel +Priority: optional +Built-Using: \${linux:BuiltUsing} +Description: Linux kernel signatures for nvidia modules for version ${src_abi}-${flavour} + This package contains the Linux kernel signatures nvidia modules for + version ${src_abi}-${flavour}. + . + You likely do not want to install this package directly. +EOL +done <"debian/package.config" + +cat "debian/control.common" "debian/control.signatures" | sed \ + -e "/@BUILD-INTERLOCK@/{" \ + -e " r debian/control.interlock-up" \ + -e " d" \ + -e " }" \ + -e "s/@SRCPKGNAME@/${src_package}/g" \ + -e "s/@ABI@/${src_abi}/g" \ + -e "s/@SERIES@/${src_series}/g" \ + >"debian/control" + +rm -f "debian/control.interlock-up" "debian/control.signatures" diff --git a/download-signed b/download-signed new file mode 100755 index 0000000..0793696 --- /dev/null +++ b/download-signed @@ -0,0 +1,183 @@ +#! /usr/bin/python3 + +import hashlib +import argparse +import os +import re +import sys +import tarfile +from urllib import request +from urllib.error import HTTPError +from urllib.parse import ( + urlparse, + urlunparse, + ) + +import apt + +# package_name: package containing the objects we signed +# package_version: package version containing the objects we signed +# src_package: source package name in dists +# signed_type: 'signed' or 'uefi' schema in the url + +parser = argparse.ArgumentParser() +parser.add_argument( + "package_name", + help="package containining the objects we signed") +parser.add_argument( + "package_version", + help="package version containing the objects we signed, or 'current'") +parser.add_argument( + "src_package", + help="source package name in dists") +parser.add_argument( + "signed_type", + nargs='?', + default='signed', + help="subdirectory type in the url, 'signed' or 'uefi'") +args = parser.parse_args() + + +class SignedDownloader: + """Download a block of signed information from dists. + + Find a block of signed information as published in dists/*/signed + and download the contents. Use the contained checksum files to + identify the members and to validate them once downloaded. + """ + + def __init__(self, package_name, package_version, src_package, signed_type='signed'): + self.package_name = package_name + self.package_version = package_version + self.src_package = src_package + + # Find the package in the available archive repositories. Use a _binary_ + # package name and version to locate the appropriate archive. Then use the + # URI there to look for and find the appropriate binary. + cache = apt.Cache() + + self.package = None + if self.package_version == "current": + self.package = cache[package_name].candidate + else: + for version in cache[package_name].versions: + if version.version == self.package_version: + self.package = version + break + + if not self.package: + raise KeyError("{0}: package version not found".format(self.package_name)) + + origin = self.package.origins[0] + pool_parsed = urlparse(self.package.uri) + self.package_dir = "%s/%s/%s/%s-%s/%s/" % ( + origin.archive, 'main', signed_type, + self.src_package, self.package.architecture, self.package_version) + + # Prepare the master url stem and pull out any username/password. If present + # replace the default opener with one which offers that password. + dists_parsed_master = list(pool_parsed) + if '@' in dists_parsed_master[1]: + (username_password, host) = pool_parsed[1].split('@', 1) + (username, password) = username_password.split(':', 1) + + dists_parsed_master[1] = host + + # Work out the authentication domain. + domain_parsed = [ dists_parsed_master[0], dists_parsed_master[1], '/', None, None, None ] + auth_uri = urlunparse(domain_parsed) + + # create a password manager + password_mgr = request.HTTPPasswordMgrWithDefaultRealm() + + # Add the username and password. + # If we knew the realm, we could use it instead of None. + password_mgr.add_password(None, auth_uri, username, password) + + handler = request.HTTPBasicAuthHandler(password_mgr) + + # create "opener" (OpenerDirector instance) + opener = request.build_opener(handler) + + # Now all calls to urllib.request.urlopen use our opener. + request.install_opener(opener) + + self.dists_parsed = dists_parsed_master + + def download_one(self, member, filename, hash_factory=None): + directory = os.path.dirname(filename) + if not os.path.exists(directory): + os.makedirs(directory) + + dists_parsed = list(self.dists_parsed) + dists_parsed[2] = re.sub(r"/pool/.*", "/dists/" + self.package_dir + \ + member, dists_parsed[2]) + dists_uri = urlunparse(dists_parsed) + + print("Downloading %s ... " % dists_uri, end='') + sys.stdout.flush() + try: + with request.urlopen(dists_uri) as dists, open(filename, "wb") as out: + hashobj = None + if hash_factory: + hashobj = hash_factory() + for chunk in iter(lambda: dists.read(256 * 1024), b''): + if hashobj: + hashobj.update(chunk) + out.write(chunk) + checksum = True + if hashobj: + checksum = hashobj.hexdigest() + except HTTPError as e: + if e.code == 404: + print("not found") + else: + raise + else: + print("found") + return checksum + return None + + def download(self, base): + """Download an entire signed result from dists.""" + + # Download the checksums and use that to download the contents. + sums = 'SHA256SUMS' + sums_local = os.path.join(base, self.package_version, sums) + if not self.download_one(sums, sums_local): + print('download-signed: {0}: not found'.format(sums)) + sys.exit(1) + + # Read the checksum file and download the files it mentions. + here = os.path.abspath(base) + with open(sums_local) as sfd: + for line in sfd: + line = line.strip() + (checksum_expected, member) = (line[0:64], line[66:]) + filename = os.path.abspath(os.path.join(base, self.package_version, member)) + if not filename.startswith(here): + print('download-signed: {0}: member outside output directory'.format(member)) + sys.exit(1) + + # Download and checksum this member. + checksum_actual = self.download_one(member, filename, hashlib.sha256) + if checksum_expected != checksum_actual: + print('download-signed: {0}: member checksum invalid'.format(member)) + sys.exit(1) + + # If this is a tarball result then extract it. + here = os.path.abspath(os.path.join(base, self.package_version)) + tarball_filename = os.path.join(base, self.package_version, 'signed.tar.gz') + if os.path.exists(tarball_filename): + with tarfile.open(tarball_filename) as tarball: + for tarinfo in tarball: + if not filename.startswith(here): + print('download-signed: {0}: tarball member outside output directory'.format(member)) + sys.exit(1) + for tarinfo in tarball: + print('Extracting {0} ...'.format(tarinfo.name)) + tarball.extract(tarinfo, base) + + +downloader = SignedDownloader(**vars(args)) +downloader.download('.') From patchwork Mon Mar 8 15:00:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 1449154 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvM322NNcz9sWw; Tue, 9 Mar 2021 02:00:30 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lJHMv-00055C-K5; Mon, 08 Mar 2021 15:00:25 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMq-00051W-Up for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:20 +0000 Received: from mail-wr1-f70.google.com ([209.85.221.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMq-00064v-9T for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:20 +0000 Received: by mail-wr1-f70.google.com with SMTP id z6so4930868wrh.11 for ; Mon, 08 Mar 2021 07:00:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BF2Ilc9rZmS9ARh0IVWtfqq3k1FCy2sVetC3Sj2dOQk=; b=GXunpLPmTfTLNPdNB23z2efRn8K6ZyXUQuMzFvxdKlZhUl8tFQCTNLJKv5n3pKtma/ PoWttb4LgM22GwVh+5pT4v8XzEsBOtRmF8GqlVuVsxKnfwf1cIuaNGRCY/BG5a5n6D3i bNe+45bBy7A6eqY6nkgd3u2uGbW9Bti/QZCrb2pDrJEDNIGC4HpWlxeP6I1n3ndwurSK FI0uoGyGx2PwFEfpfC9ezV/BkOS7E84C1fVXh6qWsiHNvZZdL0CXwR2BjuwFUQYwuzgU Fp3QGDuI1q268kmeu7nf8cyWrgQvEBGdr+EZJ0lVIHkjvYnUDp7HybkmotTxN2o20sO+ d3pw== X-Gm-Message-State: AOAM530Ls7Cvo2Qx4gqIVto0r+aO8lA+dvvXUgtvlP+/hlWF0kB1gHHW /2cko2M30AWZyfLx6gCQiWWlH+G9+TMDvOZDW+cygAOsnkSQ0a2sXuIkiQ0PdOs2fP1FdPRZK0S L3tug2VunCMxy8T/r36msU3dL85InNYD0VBVEeBzvpA== X-Received: by 2002:a5d:4523:: with SMTP id j3mr24071129wra.288.1615215618629; Mon, 08 Mar 2021 07:00:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJytWJuvN8jNEFnmd1t7qkpCRVZcPYM6LPvLFC18t+sNm5bxQ11q8lwWv7hB6AnazFwf3tA6VQ== X-Received: by 2002:a5d:4523:: with SMTP id j3mr24071089wra.288.1615215618292; Mon, 08 Mar 2021 07:00:18 -0800 (PST) Received: from localhost ([2001:470:6973:2:2843:61fd:9f2a:3b98]) by smtp.gmail.com with ESMTPSA id u3sm19074559wrt.82.2021.03.08.07.00.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:00:17 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 8/9] UBUNTU: [Packaging] linux-restricted-modules -- consume published signatures Date: Mon, 8 Mar 2021 15:00:03 +0000 Message-Id: <20210308150004.1746089-9-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308150004.1746089-1-apw@canonical.com> References: <20210308150004.1746089-1-apw@canonical.com> 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: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Split our output into a pair of packages. linux-objects-nvidia-* which contain the raw .o files and associated helpers, and linux-modules-nvidia-* which depend both the objects and the signatures packages and include the control files to trigger construction and destruction of the final signed kernel modules on the end-user system. BugLink: https://bugs.launchpad.net/bugs/1918134 Signed-off-by: Andy Whitcroft --- debian/rules.in | 26 +++------ debian/scripts/dkms-build--nvidia-N | 24 ++------- debian/scripts/gen-rules.lrm | 83 +++++++++++++++++++++++------ debian/source/options | 2 +- 4 files changed, 79 insertions(+), 56 deletions(-) diff --git a/debian/rules.in b/debian/rules.in index 16033cb..d61feca 100755 --- a/debian/rules.in +++ b/debian/rules.in @@ -1,18 +1,7 @@ -#! /usr/bin/make -f - ##export DH_VERBOSE := 1 arch = $(shell dpkg-architecture -qDEB_HOST_ARCH) -# Work out the source package name and version. The version -# is identical to this package less any rebuild suffix (+lrmN). -src_package := $(shell LC_ALL=C dpkg-parsechangelog -SSource) -src_fullversion = $(shell LC_ALL=C dpkg-parsechangelog -SVersion) -src_abi = $(shell echo "$(src_fullversion)" | sed -ne 's/\([0-9]*\.[0-9]*\.[0-9]*\-[0-9]*\)\..*/\1/p') -src_version = $(shell echo $(src_fullversion) | sed -e 's/+[0-9][0-9]*$$//') -src_series = $(shell dpkg-parsechangelog -SDistribution | sed -e 's/-\(security\|updates\|proposed\)$$//') -src_kernel = $(shell echo "$(src_package)" | sed -e 's/restricted-modules-//') - # Get variants, assuming primary if debian/variants is not present variants = -- ifneq (,$(wildcard debian/variants)) @@ -28,7 +17,7 @@ endif control_files += $(filter-out $(primary_control_files),$(shell LC_ALL=C ls -d debian/control.d/*)) test:: - echo "$(src_fullversion) $(src_version)" + echo "$(src_version) $(src_main_version)" # We build our control file. This has to be done before dh runs otherwise # we have no binary files and we will not run the appropriate targets. @@ -44,34 +33,31 @@ pre-clean: $(control_files) -e "s/\$${variant:suffix}/$$variant/g" \ -e "s/\(\$${$(tp_key)[^}]*}\)/$${variant_first:+\1}/g" \ <$$i; \ - echo ""; \ variant_first=''; \ done; \ else \ cat $$i; \ - echo ""; \ fi; \ done | sed \ -e "/@BUILD-INTERLOCK@/{" \ - -e " r debian/control.gen" \ + -e " r debian/control.interlock-up" \ -e " d" \ -e " }" \ | sed \ - -e "s/\(\$${$(tp_key)\([^}]*\)}\)/kernel-testing--$(src_kernel)-\1-\2,/g" \ + -e "s/\(\$${$(tp_key)\([^}]*\)}\)/kernel-testing--$(src_main_package)-\1-\2,/g" \ -e "s/@SRCPKGNAME@/$(src_package)/g" \ -e "s/@ABI@/$(src_abi)/g" \ - -e "s/@VERSION@/$(src_version)/g" \ + -e "s/@VERSION@/$(src_main_version)/g" \ -e "s/@SERIES@/$(src_series)/g" \ >debian/control.tmp rm -f debian/control mv debian/control.tmp debian/control - rm -rf ./$(src_version) UNSIGNED SIGNED + rm -rf ./$(src_main_version) UNSIGNED SIGNED rm -f debian/linux-modules-*.install \ debian/linux-modules-*.preinst \ debian/linux-modules-*.prerm \ debian/linux-modules-*.postinst \ debian/linux-modules-*.postrm - rm -rf $(dkms_dir) .PHONY: pre-clean @@ -79,6 +65,8 @@ debian/scripts/fix-filenames: debian/scripts/fix-filenames.c $(CC) -o $@ $^ clean:: pre-clean + rm -f debian/scripts/fix-filenames + rm -rf $(dkms_dir) %: dh $@ diff --git a/debian/scripts/dkms-build--nvidia-N b/debian/scripts/dkms-build--nvidia-N index d37082c..75a16df 100755 --- a/debian/scripts/dkms-build--nvidia-N +++ b/debian/scripts/dkms-build--nvidia-N @@ -79,28 +79,10 @@ sed -e 's/.*-o *\([^ ]*\) .*/rm -f \1/g' <"$pkgdir/bits/BUILD" >"$pkgdir/bits/C : elif [ "$sign" = "--lrm" ]; then - # We are in LRM build the package a copy in any signatures we can - # find for them. These will be added after linking. - base="/usr/lib/linux/$abi_flavour" - - # Check the GCC version we are using against that used in the kernel - # NOTE: that we treat this as only a warning, as if the binaries did come - # out differently then we will actually - echo "II: checking gcc version ..." - cat "$base/compiler" - gcc --version - gcc_was=$(cat "$base/compiler" | sed -e 's/^GCC:/gcc/') - gcc_is=$(gcc --version | head -1) - if [ "$gcc_was" != "$gcc_is" ]; then - echo "WW: gcc version missmatch between linux and linux-restricted-modules" - echo "WW: was: $gcc_was is: $gcc_is" - fi - - # Apply any local signatures. - echo "II: adding signatures from $base ..." - cp "$base/signatures/$package/"*".ko.sig" "$pkgdir/bits" - sha256sum -c "$base/signatures/$package/SHA256SUMS" || exit 1 + # We are in the LRM build; grab sha256 checksums and clean up. + sha256sum -b *.ko >"SHA256SUMS" sh ./CLEAN + else # We are in the main kernel, put the .kos together as we will # on the users machine, sign them, and keep just the signature. diff --git a/debian/scripts/gen-rules.lrm b/debian/scripts/gen-rules.lrm index 7dc774e..a79eef0 100755 --- a/debian/scripts/gen-rules.lrm +++ b/debian/scripts/gen-rules.lrm @@ -1,12 +1,45 @@ #!/bin/bash +# Pick out relevant version and package information including our predecessor +# packages: linux -> linux-restricted-modules-signatures -> linux-restricted-modules +src_package=$(LC_ALL=C dpkg-parsechangelog -SSource) +src_version=$(LC_ALL=C dpkg-parsechangelog -SVersion) +src_abi=$(echo "${src_version}" | sed -ne 's/\([0-9]*\.[0-9]*\.[0-9]*\-[0-9]*\)\..*/\1/p') +src_series=$(LC_ALL=C dpkg-parsechangelog -SDistribution | sed -e 's/-\(security\|updates\|proposed\)$//') + +# linux/5.8.0-41.46 +src_main_package=$(echo "${src_package}" | sed -e 's/-restricted-modules//') +src_main_version=$(echo ${src_version} | sed -e 's/+[0-9][0-9\.]*$//') + +# linux-restricted-generate/5.8.0-41.46[+1] + +# linux-restricted-signatures/5.8.0-41.46[+1] +src_sigs_package=$(echo "${src_package}" | sed -e 's/-restricted-modules/-restricted-signatures/') +src_sigs_version=${src_version} + +# linux-restricted-modules/5.8.0-41.46[+1] + mkdir -p "debian/control.d" -cat "debian/rules.in" >"debian/rules.gen" -: >"debian/control.gen" +: >"debian/control.interlock-up" : >"debian/control.d/meta-nvidia" : >"debian/control.d/nvidia" : >"debian/control.d/migrate-nvidia" : >"debian/control.d/transitionals-local" +: >"debian/control.d/signatures" + +cat - "debian/rules.in" >"debian/rules.gen" <>"debian/control.gen" <= @VERSION@) [${archs}], - linux-buildinfo-@ABI@-${flavour} (>= @VERSION@) [${archs}], + cat - >>"debian/control.interlock-up" <= @VERSION@) [${archs}], EOL while read package version extra @@ -84,12 +116,14 @@ $targets:: mkdir -p \$(dkms_dir)/build \$(dkms_dir)/source install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour} install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/usr/lib/linux/triggers - \$(call build_dkms, \$(src_abi)-${flavour}, linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}, \$(CURDIR)/debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/lib/modules/\$(src_abi)-${flavour}/kernel, "", nvidia-${suffix_short}, pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-kernel-source-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-dkms-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb) \$(call install_control,linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour},${flavour},nvidia,${suffix_short},postinst postrm prerm config templates) + install -d debian/linux-objects-nvidia-${suffix_minus}-\$(src_abi)-${flavour} + \$(call build_dkms, \$(src_abi)-${flavour}, linux-objects-nvidia-${suffix_minus}-\$(src_abi)-${flavour}, \$(CURDIR)/debian/linux-objects-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/lib/modules/\$(src_abi)-${flavour}/kernel, "", nvidia-${suffix_short}, pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-kernel-source-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-dkms-${suffix_minus}_\$(dkms_nvidia_${suffix_under}_version)_\$(arch).deb) EOL # debian/control.d/meta-nvidia cat - >>"debian/control.d/meta-nvidia" < Architecture: ${archs} @@ -97,16 +131,16 @@ Section: kernel Provides: \${dkms:nvidia-${suffix_minus}-modules}, nvidia-prebuilt-kernel Depends: \${misc:Depends}, - linux-modules-nvidia-${suffix_minus}-@ABI@-${flavour} (= \${binary:Version}), - \${nvk:nvidia-${suffix_minus}} + linux-modules-nvidia-${suffix_minus}-${src_abi}-${flavour} (= \${binary:Version}), + \${nvk:nvidia-${suffix_minus}}, Description: Extra drivers for nvidia-${suffix_minus} for the ${flavour}\${variant:suffix} flavour Install extra signed nvidia-${suffix_minus} modules compatible with the ${flavour}\${variant:suffix} flavour. - EOL # debian/control.d/nvidia cat - >>"debian/control.d/nvidia" < Architecture: ${archs} Section: kernel @@ -116,15 +150,34 @@ Depends: \${misc:Depends}, \${shlibs:Depends}, binutils, - linux-image-@ABI@-${flavour} | linux-image-unsigned-@ABI@-${flavour}, -Description: Linux kernel nvidia modules for version @ABI@ - This package contains the Linux kernel nvidia modules for version @ABI@. +Description: Linux kernel nvidia modules for version ${src_abi} (objects) + This package contains the Linux kernel nvidia modules for version ${src_abi}. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-${suffix_minus}-${flavour}* meta-packages, which will ensure that upgrades work correctly, and that supporting packages are also installed. +Package: linux-modules-nvidia-${suffix_minus}-${src_abi}-${flavour} +Build-Profiles: +Architecture: ${archs} +Section: kernel +Priority: optional +Built-Using: \${linux:BuiltUsing} +Depends: + \${misc:Depends}, + \${shlibs:Depends}, + linux-image-${src_abi}-${flavour} | linux-image-unsigned-${src_abi}-${flavour}, + linux-signatures-nvidia-${src_abi}-${flavour} (= ${src_sigs_version}), + linux-objects-nvidia-${suffix_minus}-${src_abi}-${flavour} (= \${binary:Version}), +Description: Linux kernel nvidia modules for version ${src_abi} + This package pulls together the Linux kernel nvidia modules for + version ${src_abi} with the appropriate signatures. + . + You likely do not want to install this package directly. Instead, install the + one of the linux-modules-nvidia-${suffix_minus}-${flavour}* meta-packages, + which will ensure that upgrades work correctly, and that supporting packages are + also installed. EOL # debian/control.d/migrate-nvidia for cmd in $extra @@ -135,13 +188,13 @@ EOL from_minus=$(echo "$from" | sed -e 's/nvidia-graphics-drivers-//') echo "II: general transition $from -> $package ($from_minus -> $suffix_minus)" cat - >>"debian/control.d/migrate-nvidia" < linux-modules-nvidia-$to" cat - >>"debian/control.d/transitionals-local" < X-Patchwork-Id: 1449155 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvM3318z3z9sVv; Tue, 9 Mar 2021 02:00:31 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lJHMw-00055W-BY; Mon, 08 Mar 2021 15:00:26 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMr-00052b-Vp for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:22 +0000 Received: from mail-wm1-f70.google.com ([209.85.128.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lJHMr-000657-ID for kernel-team@lists.ubuntu.com; Mon, 08 Mar 2021 15:00:21 +0000 Received: by mail-wm1-f70.google.com with SMTP id a65so2142922wmh.1 for ; Mon, 08 Mar 2021 07:00:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Lgov7cwOYtzCB4r7E/T8YNK+wKf9+lAokSo2TWhmo/k=; b=njr8M9PtbkKaGNJZsrKlfRTXBwIrD8KYDhK4/YssSPd4Dc+xxnVCxO+WBr7fSS2r+z jGsxyIPgR7k6G6ALXtEAEtMYjxsVCquJCyJB/z0YgLR/FkvQTosUzkYn0JVt4kXtLWEv OX4Hpkr6lC8ZLjaUnVxzsF+AqikWuiGHLVcosOH2PACObW4HeeZuVW2uIU12WfBemdmH 5CJE+NbIcUsYfm9JCgBbAp+7b3hIFlg2nA013uff7QOzxbY2Qas4sJxOXQEFshCbsp44 wEw47G5voRfPClKnY82ubFlCyUi6BhTe1p6LrJULtQlMKxsC7knVKJTDCDSv3udn66Bi HjTg== X-Gm-Message-State: AOAM533w1Y5aH09sQm3QWGw4fNYo/BzUZzxLgs6+ltSsl2zU0/B00YKq pOHA6em6DYHdJ1mL8k1kTDxgs98DCdP/8lJSELRta92bibefkF55g8vYuqm7No8/1HDLVxUbWkN 2qoTV5FpUgK/NBawW09gd1ZgTsUfIONrL1nvxKRyWng== X-Received: by 2002:a1c:1dd5:: with SMTP id d204mr22087036wmd.127.1615215620993; Mon, 08 Mar 2021 07:00:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0/67fW6fYn4rbI/sc2t2jEu1jw80S88qaeHBsuxbU7IRB6XlqlmgSNF6fjYXH17yuM1GB/A== X-Received: by 2002:a1c:1dd5:: with SMTP id d204mr22087006wmd.127.1615215620742; Mon, 08 Mar 2021 07:00:20 -0800 (PST) Received: from localhost ([2001:470:6973:2:2843:61fd:9f2a:3b98]) by smtp.gmail.com with ESMTPSA id p10sm19716020wrw.33.2021.03.08.07.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 07:00:20 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 9/9] UBUNTU: [Packaging] update-version -- handle forward-backport versioning Date: Mon, 8 Mar 2021 15:00:04 +0000 Message-Id: <20210308150004.1746089-10-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210308150004.1746089-1-apw@canonical.com> References: <20210308150004.1746089-1-apw@canonical.com> 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: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" We use versions linux 5.8.0-14.15+20.04.1 for the main kernel in forward-backport kernels. Therefore our version could be further suffixed: 5.8.0-14.15+20.04.1+1. Ensure we grab the final variant component only. BugLink: https://bugs.launchpad.net/bugs/1918134 Signed-off-by: Andy Whitcroft --- update-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-version b/update-version index f6d231b..4ee5c34 100755 --- a/update-version +++ b/update-version @@ -66,7 +66,7 @@ if dpkg --compare-versions "$here_version" lt "$master_version"; then elif dpkg --compare-versions "$here_version" eq "$master_version"; then here_newversion="$master_version+1" else - minor=$(( ${here_version#*+} + 1 )) + minor=$(( ${here_version##*+} + 1 )) here_newversion="$master_version+$minor" fi