diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/changelog linux-restricted-signatures-azure-5.19-5.19.0/debian/changelog --- linux-restricted-signatures-azure-5.19-5.19.0/debian/changelog 2023-01-28 22:17:56.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/changelog 2023-02-10 18:35:54.000000000 +0000 @@ -1,37 +1,26 @@ -linux-restricted-signatures-azure-5.19 (5.19.0-1020.21~22.04.1) jammy; urgency=medium - - * Master version: 5.19.0-1020.21~22.04.1 - - * Miscellaneous Ubuntu changes - - debian/tracking-bug -- update from master +linux-restricted-signatures-azure-5.19 (5.19.0-1021.22~22.04.1) jammy; urgency=medium - -- Tim Gardner Sat, 28 Jan 2023 15:17:56 -0700 + * Master version: 5.19.0-1021.22~22.04.1 -linux-restricted-modules-azure-5.19 (5.19.0-1019.20~22.04.1) jammy; urgency=medium + * Packaging resync (LP: #1786013) + - debian/dkms-versions -- update from kernel-versions (main/2023.01.30) - * Master version: 5.19.0-1019.20~22.04.1 + * LRMv7: Enable the open NVIDIA kernel modules (LP: #1988836) + - [Packaging] convert to direct ancillaries + - [Packaging] convert to v7.1 autogen form + - [Packaging] convert to v7.2 autogen form * Miscellaneous Ubuntu changes - - [Packaging] Suppress building nvidia-418-server - debian/tracking-bug -- update from master - -- Stefan Bader Wed, 25 Jan 2023 15:30:13 +0100 + -- Tim Gardner Fri, 10 Feb 2023 11:35:54 -0700 -linux-restricted-modules-azure-5.19 (5.19.0-1018.19~22.04.1) jammy; urgency=medium - - * Master version: 5.19.0-1018.19~22.04.1 +linux-restricted-signatures-azure-5.19 (5.19.0-1020.21~22.04.1) jammy; urgency=medium - * Packaging resync (LP: #1786013) - - [Packaging] update variants - - debian/dkms-versions -- update from kernel-versions (main/2023.01.02) + * Master version: 5.19.0-1020.21~22.04.1 * Miscellaneous Ubuntu changes - debian/tracking-bug -- update from master - -- Tim Gardner Mon, 16 Jan 2023 14:11:23 -0700 - -linux-restricted-modules-azure-5.19 (5.19.0-1000.0) jammy; urgency=medium - - * Dummy entry + -- Tim Gardner Sat, 28 Jan 2023 15:17:56 -0700 - -- John Cabaj Wed, 04 Jan 2023 11:15:50 -0600 diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/control linux-restricted-signatures-azure-5.19-5.19.0/debian/control --- linux-restricted-signatures-azure-5.19-5.19.0/debian/control 2023-01-28 22:17:56.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/control 2023-02-10 18:35:54.000000000 +0000 @@ -9,22 +9,43 @@ curl, dkms, gawk, - linux-restricted-generate-azure-5.19 (= 5.19.0-1020.21~22.04.1), + linux-restricted-generate-azure-5.19 (= 5.19.0-1021.22~22.04.1), + linux-objects-nvidia-525-open-5.19.0-1021-azure (>= 5.19.0-1021.22~22.04.1) [amd64 arm64 ], lsb-release, python3, python3-apt, Standards-Version: 3.9.4 Vcs-Git: git://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-restricted-modules-azure/+git/jammy -Package: linux-signatures-nvidia-5.19.0-1020-azure +Package: linux-signatures-nvidia-5.19.0-1021-azure Build-Profiles: Architecture: amd64 arm64 Section: kernel Priority: optional -Depends: linux-image-5.19.0-1020-azure | linux-image-unsigned-5.19.0-1020-azure, +Depends: linux-image-5.19.0-1021-azure | linux-image-unsigned-5.19.0-1021-azure, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel signatures for nvidia modules for version 5.19.0-1020-azure +Description: Linux kernel signatures for nvidia modules for version 5.19.0-1021-azure This package contains the Linux kernel signatures nvidia modules for - version 5.19.0-1020-azure. + version 5.19.0-1021-azure. . You likely do not want to install this package directly. + +Package: linux-modules-nvidia-525-open-5.19.0-1021-azure +Build-Profiles: +Architecture: amd64 arm64 +Section: kernel +Priority: optional +Built-Using: ${dkms:nvidia-525-open-modules} +Depends: + ${misc:Depends}, + ${shlibs:Depends}, + linux-image-5.19.0-1021-azure | linux-image-unsigned-5.19.0-1021-azure, + ${nvk:nvidia-525-open}, +Description: Linux kernel nvidia modules for version 5.19.0-1021 + This package pulls together the Linux kernel nvidia modules for + version 5.19.0-1021 with the appropriate signatures. + . + You likely do not want to install this package directly. Instead, install the + one of the linux-modules-nvidia-525-open-azure* meta-packages, + which will ensure that upgrades work correctly, and that supporting packages are + also installed. diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/dkms-versions linux-restricted-signatures-azure-5.19-5.19.0/debian/dkms-versions --- linux-restricted-signatures-azure-5.19-5.19.0/debian/dkms-versions 2023-01-28 22:17:56.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/dkms-versions 2023-02-10 18:35:54.000000000 +0000 @@ -2,9 +2,10 @@ nvidia-graphics-drivers-470 470.161.03-0ubuntu0.22.04.1 arch=amd64 transition=nvidia-graphics-drivers-465 transition=nvidia-graphics-drivers-460 transition=nvidia-graphics-drivers-455 transition=nvidia-graphics-drivers-450 transition=nvidia-graphics-drivers-440 transition=nvidia-graphics-drivers-435 nvidia-graphics-drivers-510 510.108.03-0ubuntu0.22.04.1 arch=amd64 arch=arm64 transition=nvidia-graphics-drivers-495 nvidia-graphics-drivers-515 515.86.01-0ubuntu0.22.04.1 arch=amd64 arch=arm64 -nvidia-graphics-drivers-525 525.78.01-0ubuntu0.22.04.1 arch=amd64 arch=arm64 transition=nvidia-graphics-drivers-520 +nvidia-graphics-drivers-525 525.85.05-0ubuntu0.22.04.1 arch=amd64 arch=arm64 transition=nvidia-graphics-drivers-520 +nvidia-graphics-drivers-525 525.85.05-0ubuntu0.22.04.1 arch=amd64 arch=arm64 variant=open nvidia-graphics-drivers-418-server 418.226.00-0ubuntu4 arch=amd64 nvidia-graphics-drivers-450-server 450.216.04-0ubuntu0.22.04.1 arch=amd64 transition=nvidia-graphics-drivers-440-server nvidia-graphics-drivers-470-server 470.161.03-0ubuntu0.22.04.1 arch=amd64 transition=nvidia-graphics-drivers-460-server -nvidia-graphics-drivers-515-server 515.86.01-0ubuntu0.22.04.1 arch=amd64 arch=arm64 transition=nvidia-graphics-drivers-510-server -nvidia-graphics-drivers-525-server 525.60.13-0ubuntu0.22.04.1 arch=amd64 arch=arm64 +nvidia-graphics-drivers-515-server 515.86.01-0ubuntu0.22.04.2 arch=amd64 arch=arm64 transition=nvidia-graphics-drivers-510-server +nvidia-graphics-drivers-525-server 525.85.12-0ubuntu0.22.04.1 arch=amd64 arch=arm64 diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/lrm-version linux-restricted-signatures-azure-5.19-5.19.0/debian/lrm-version --- linux-restricted-signatures-azure-5.19-5.19.0/debian/lrm-version 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/lrm-version 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -6.0 diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/rules linux-restricted-signatures-azure-5.19-5.19.0/debian/rules --- linux-restricted-signatures-azure-5.19-5.19.0/debian/rules 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/rules 2023-02-10 18:35:54.000000000 +0000 @@ -1,7 +1,7 @@ #! /usr/bin/make -f clean: - ./debian/scripts/gen-rules + ./debian/scripts/generate-rules $(MAKE) -f debian/rules.gen clean %: diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.in linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.in --- linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.in 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.in 2023-02-10 17:50:36.000000000 +0000 @@ -2,98 +2,19 @@ arch = $(shell dpkg-architecture -qDEB_HOST_ARCH) -# Get variants, assuming primary if debian/variants is not present -variants = -- -ifneq (,$(wildcard debian/variants)) - variants := $(shell cat debian/variants) -endif - -control_files := debian/control.common -# control files only wanted for the primary variant -primary_control_files := $(shell LC_ALL=C ls -d debian/control.d/transitionals-* 2>/dev/null) -ifneq ($(filter --, $(variants)),) - control_files += $(primary_control_files) -endif -control_files += $(filter-out $(primary_control_files),$(shell LC_ALL=C ls -d debian/control.d/*)) - -test:: - 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. -pre-clean: tp_key=test:provides\(-full\|-image\|-headers\|-modules-extra\) -pre-clean: $(control_files) - rm -f debian/control.tmp - for i in $^; do \ - if grep -q "{variant:" $$i; then \ - variant_first='yes'; \ - for variant in $(variants); do \ - variant="$$(echo "$$variant" | sed -e 's/--//')"; \ - sed \ - -e "s/\$${variant:suffix}/$$variant/g" \ - -e "s/\(\$${$(tp_key)[^}]*}\)/$${variant_first:+\1}/g" \ - <$$i; \ - variant_first=''; \ - done; \ - else \ - cat $$i; \ - fi; \ - done | sed \ - -e "/@BUILD-INTERLOCK@/{" \ - -e " r debian/control.interlock-up" \ - -e " d" \ - -e " }" \ - | sed \ - -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_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_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 - -.PHONY: pre-clean - -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 $@ -# Ensure the directory prefix is exactly 100 characters long so pathnames are the -# exact same length in any binary files produced by the builds. These will be -# commonised later. -dkms_20d=.................... -dkms_100d=$(dkms_20d)$(dkms_20d)$(dkms_20d)$(dkms_20d)$(dkms_20d) -dkms_100c=$(shell echo '$(dkms_100d)' | sed -e 's/\./_/g') -#dkms_dir=$(shell echo '$(CURDIR)/$(dkms_100c)' | \ -# sed -e 's/\($(dkms_100d)\).*/\1/' -e 's/^\(.*\)....$$/\1dkms/') -define dkms_dir_prefix = -$(strip $(shell echo '$(1)/$(dkms_100c)' | \ - sed -e 's/\($(dkms_100d)\).*/\1/' -e 's/^\(.*\)....$$/\1dkms/')) -endef -dkms_dir=$(call dkms_dir_prefix,$(CURDIR)) +override_dh_auto_build: + ./download-signed "$(src_genr_package)" "$(src_genr_version)" "$(src_genr_package)" -define build_dkms = - $(SHELL) debian/scripts/dkms-build $(dkms_dir) $(1) --lrm $(2) $(3) $(4) $(5) $(6) -endef +override_dh_auto_install: nvidia-$(arch) + dh_install + +override_dh_gencontrol: + dh_gencontrol -- $(gencontrol_flags) -ifeq ($(arch),ppc64el) -instfile=vmlinux -else -instfile=vmlinuz -endif +gencontrol_flags := define install_control = for which in $(5); \ @@ -107,21 +28,3 @@ <"$$template" >"$$script"; \ done endef - -signatures=$(wildcard /usr/lib/linux/$(src_abi)-*) - -prepare-dkms: - mkdir -p $(dkms_dir) - ln -s /usr/src $(dkms_dir)/headers - -override_dh_prep: debian/scripts/fix-filenames - dh_prep - -override_dh_auto_install: prepare-dkms nvidia-$(arch) - dh_install - -override_dh_gencontrol: - dh_gencontrol -- $(gencontrol_flags) - -gencontrol_flags := - diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.lrg linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.lrg --- linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.lrg 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.lrg 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -##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 -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.lrs linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.lrs --- linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.lrs 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/rules.lrs 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -##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 -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/dkms-build linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/dkms-build --- linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/dkms-build 2023-01-18 16:56:33.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/dkms-build 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ -#!/bin/sh -set -e - -dkms_dir="$1" -abi_flavour="$2" -sign="$3" -pkgname="$4" -pkgdir="$5" -dbgpkgdir="$6" -package="$7" -shift 7 - -here=$(dirname "$(readlink -f "${0}")") - -srcdir=$(pwd) -cd "$dkms_dir" || exit 1 - -built_using_record() -{ - local subst="$1" - local built_using="$2" - if [ ! -f "$subst" ]; then - touch "$subst" - fi - if ! grep -q -s "^linux:BuiltUsing=" "$subst"; then - echo "linux:BuiltUsing=" >>"$subst" - fi - sed -i -e "s/^\(linux:BuiltUsing=.*\)/\1$built_using, /" "$subst" -} - -# ABI: returns present in $? and located path in lpackage_path when found. -package_present() -{ - for lpackage_path in "$1"_*.deb - do - break - done - [ -f "$lpackage_path" ] -} - -# Download and extract the DKMS package -- note there may be more -# than one package to install. -for package_path in "$@" -do - package_file=$(basename "$package_path") - echo "II: dkms-build downloading $package ($package_file)" - rpackage=$( echo "$package_path" | sed -e 's@.*/@@' -e 's@_.*@@' ) - lpackage=$( echo "$rpackage" | sed -e 's@=.*@@' ) - - while true - do - if package_present "$lpackage"; then - break - fi - case "$package_path" in - pool/*) - # Attempt download from the launchpad librarian first. - "$here/file-downloader" "https://launchpad.net/ubuntu/+archive/primary/+files/$package_file" || true - if package_present "$lpackage"; then - break - fi - - # Download from the available pools. - for pool in $( grep -h '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | awk '{print $2}' | sort -u ) - do - if package_present "$lpackage"; then - break - fi - url="$pool/$package_path" - "$here/file-downloader" "$url" && break || true - # No components in PPAs. - url=$(echo "$url" | sed -e 's@/pool/[^/]*/@/pool/main/@') - "$here/file-downloader" "$url" && break || true - done - ;; - http*:*) - "$here/file-downloader" "$package_path" - ;; - */*) - cp -p "$package_path" . - ;; - *) - apt-get download "$rpackage" - ;; - esac - break - done - if ! package_present "$lpackage"; then - echo "EE: $lpackage not found" - exit 1 - fi - - dpkg -x "$lpackage"_*.deb "$package" - - lversion=$( echo "$lpackage_path" | sed -e 's@.*/@@' -e 's@_[^_]*$@@' -e 's@.*_@@') - #built_using_record "$srcdir/debian/$pkgname.substvars" "$built_using$lpackage (= $lversion)" -done - -# Pick out the package/version from the dkms.conf. -for dkms_conf in "$package/usr/src"/*/"dkms.conf" -do - break -done - -# It seems some packages have a # in the name which works fine if the -# package is installed directly, but not so much if we build it out -# of the normal location. -sed -i -e '/^PACKAGE_NAME=/ s/#//g' "$dkms_conf" - -# Run any dkms-package specfic configuration steps -dkms_config_specific="$srcdir/$0-configure--$package" -dkms_config_generic=$(echo "$dkms_config_specific" | sed -e 's/-[0-9][0-9]*$/-N/') -for dkms_config in "$dkms_config_specific" "$dkms_config_generic" -do - if [ -z "$dkms_config" -o ! -e "$dkms_config" ]; then - continue - fi - echo "II: dkms-build-configure $(basename "$dkms_config") found, executing" - "$dkms_config" \ - "$srcdir" \ - "$dkms_conf" \ - "$dkms_dir" \ - "$abi_flavour" \ - "$sign" \ - "$pkgname" \ - "$pkgdir" \ - "$dbgpkgdir" \ - "$package" \ - "$@" || exit 1 - break -done - -cat - <<'EOF' >>"$dkms_conf" -POST_BUILD="ubuntu-save-objects ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/objects $POST_BUILD" -EOF -ubuntu_script="$(dirname "$dkms_conf")/ubuntu-save-objects" -cat - <<'EOF' >"$ubuntu_script" -#!/bin/sh -from="$1" -to="$2" -script="$3" -shift 2 - -# Copy the objects. -echo "II: copying objects to '$to'" -mkdir -p "$to" -(cd "$from" && find -name \*.o -o -name \*.o.ur-\* -o -name \*.mod | cpio -Lpd "$to") - -# Call the original post_install script if there is one. -[ "$script" = '' ] && exit 0 - -shift -exec "$(dirname "$0")/$script" "$@" -EOF -chmod +x "$ubuntu_script" -dkms_package=$( sed -ne 's/PACKAGE_NAME="\(.*\)"/\1/p' "$dkms_conf" ) -dkms_version=$( sed -ne 's/PACKAGE_VERSION="\(.*\)"/\1/p' "$dkms_conf" ) - -# Build the DKMS binaries. -echo "II: dkms-build building $package" -fakeroot="" -[ $(id -u) -ne 0 ] && fakeroot="/usr/bin/fakeroot" -rc=0 -$fakeroot /usr/sbin/dkms build --no-prepare-kernel --no-clean-kernel \ - -k "$abi_flavour" ${ARCH:+-a $ARCH} \ - --sourcetree "$dkms_dir/source" \ - --dkmstree "$dkms_dir/build" \ - --kernelsourcedir "$dkms_dir/headers/linux-headers-$abi_flavour" \ - "$dkms_conf" || rc=1 - -# Find the log and add it to our own. -for log in "$dkms_dir/build/$dkms_package/$dkms_version/$abi_flavour"/*/"log/make.log" "$dkms_dir/build/$dkms_package/$dkms_version/build/make.log" -do - [ -f "$log" ] && break -done -sed -e "s@$dkms_dir@<>@g" <"$log" - -# If this build failed then exit here. -[ "$rc" != 0 ] && exit "$rc" - -# Install the modules with debug symbols we possibly built, -# and strip the original modules for the next install step. -if [ -n "$dbgpkgdir" ]; then - dbgpkgdir="$dbgpkgdir/$package" - echo "II: dkms-build installing $package into $dbgpkgdir (debug symbols)" - install -d "$dbgpkgdir" - find "$dkms_dir/build/$dkms_package/$dkms_version/$abi_version" -name \*.ko | - while read module; do - vmodule=$( basename "$module" ) - - # Check for '.debug_info' section in order to copy module. - # Useful if debug symbols are requested but not built for - # any reason (including not yet supported by DKMS package). - # Strip module just in case even if section isn't present. - if ${CROSS_COMPILE}objdump -h -j '.debug_info' "$module" >/dev/null 2>&1 - then - echo "copying $vmodule" - cp "$module" "$dbgpkgdir" - else - echo "ignoring $vmodule (missing debug symbols)" - fi - - # Just 'strip -g' as '/usr/sbin/dkms' does. - echo "stripping $vmodule" - strip -g "$module" - done -fi - -# Install and optionally sign the modules we have built. -pkgdir="$pkgdir/$package" -echo "II: dkms-build installing $package into $pkgdir" -install -d "$pkgdir" -find "$dkms_dir/build/$dkms_package/$dkms_version/$abi_version" -name \*.ko | -while read module; do - vmodule=$( basename "$module" ) - case "$sign" in - --*) - echo "copying $vmodule" - cp "$module" "$pkgdir" - ;; - *) - echo "signing $vmodule" - $sign "$module" "$pkgdir/$vmodule" - ;; - esac -done - -find "$dkms_dir/build/$dkms_package/$dkms_version/objects" -name \*.o -print | \ -while read object -do - "$srcdir/debian/scripts/fix-filenames" "$object" "$dkms_dir" -done - -# This assumes that .mod files are in the top level build tree -# If there are ever .mod files in sub-directories, the dirname of objectlist needs to be stripped as well -find "$dkms_dir/build/$dkms_package/$dkms_version/objects" -name \*.mod -print | \ -while read objectlist -do - sed "s|^$dkms_dir/build/$dkms_package/$dkms_version/build/||" -i $objectlist -done - -# Finally see if there is a dkms-package specific post processor present. Hand -# it the original source directory, destination package directory, the objects -# as squirreled away, and the log in case it is useful. Finally pass a formed -# signing command line in case we need to do that. -dkms_build_specific="$srcdir/$0--$package" -dkms_build_generic=$(echo "$dkms_build_specific" | sed -n -e 's/-[0-9][0-9]*[a-z]*$/-N/p') -for dkms_build in "$dkms_build_specific" "$dkms_build_generic" -do - if [ -z "$dkms_build" -o ! -e "$dkms_build" ]; then - continue - fi - echo "II: dkms-build override $(basename "$dkms_build") found, executing" - "$dkms_build" \ - "$srcdir" \ - "$dkms_dir/build/$dkms_package/$dkms_version/objects" \ - "$log" \ - "$dkms_dir" \ - "$abi_flavour" \ - "$sign" \ - "$pkgname" \ - "$pkgdir" \ - "$dbgpkgdir" \ - "$package" \ - "$@" || exit 1 - break -done - -echo "II: dkms-build build $package complete" diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/dkms-build--nvidia-N linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/dkms-build--nvidia-N --- linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/dkms-build--nvidia-N 2023-01-18 16:56:33.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/dkms-build--nvidia-N 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -#!/bin/sh -set -e - -srcdir="$1" -objects="$2" -log="$3" -shift 3 - -dkms_dir="$1" -abi_flavour="$2" -sign="$3" -pkgname="$4" -pkgdir="$5" -dbgpkgdir="$6" -package="$7" -shift 7 - -build="$( dirname "$objects" )/build" - -# Copy over the objects ready for reconstruction. The objects copy contains -# the *.o files and the *.o-ur* retpoline files to allow the kernel to track -# any retpoline sequences therein. For our purposes we only want the *.o -# files, elide the rest. And .mod files for ld linking in recentish kernels. -mkdir -p "$pkgdir/bits/scripts" -( - gcc_variant1=$(gcc --version | head -1 | sed -e 's/^gcc/GCC:/') - gcc_variant2=$(gcc --version | head -1 | sed -e 's/^\(gcc\) \((.*)\) \(.*\)$/\1 version \3 \2/') - cd "$objects" || exit 1 - find -name \*.o -o -name \*.mod | \ - while read file - do - cp --parents "$file" "$pkgdir/bits" - "$srcdir/debian/scripts/fix-filenames" "$pkgdir/bits/$file" "$gcc_variant1" - "$srcdir/debian/scripts/fix-filenames" "$pkgdir/bits/$file" "$gcc_variant2" - done -) - -# Install the support files we need. -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. -cat - <<'EOL' >"$pkgdir/bits/BUILD" -[ "$1" = "unsigned" ] && { signed_only=:; shift; } -[ "$1" = "nocheck" ] && { check_only=:; shift; } -EOL -grep /usr/bin/ld.bfd "$log" | grep -v scripts/genksyms/genksyms | grep -v "warning:\|NOTE:" | 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 -# up again. -( - cd "$pkgdir/bits" || exit 1 - - # Add checksum check. - echo "\$check_only sha256sum -c SHA256SUMS || exit 1" >>"$pkgdir/bits/BUILD" - - # Add .ko handling to the CLEAN/BUILD dance. - for ko in "$pkgdir"/*.ko - do - 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 nocheck - - if [ "$sign" = "--custom" ]; then - # We are building for and archive custom signing upload. Keep everything. - : - elif [ "$sign" = "--lrm" ]; then - # 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. - : >"SHA256SUMS" - for ko in *.ko - do - echo "detached-signature $ko" - $sign "$ko" "$ko.signed" - length=$( stat --format %s "$ko" ) - dd if="$ko.signed" of="$ko.sig" bs=1 skip="$length" 2>/dev/null - - rm -f "$ko.signed" - # Keep a checksum of the pre-signed object so we can check it is - # built correctly in LRM. - sha256sum -b "$ko" >>"SHA256SUMS" - done - - # Clean out anything which not a signature. - mv "$pkgdir/bits/"*.sig "$pkgdir" - mv "$pkgdir/bits/SHA256SUMS" "$pkgdir" - find "$pkgdir" -name \*.sig -prune -o -name SHA256SUMS -prune -o -type f -print | xargs rm -f - find "$pkgdir" -depth -type d -print | xargs rmdir --ignore-fail-on-non-empty - fi -) || exit "$?" diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/file-downloader linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/file-downloader --- linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/file-downloader 2023-01-18 16:56:33.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/file-downloader 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#!/bin/sh - -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " 1>&2 - exit 1 -fi -url="$1" - -to=$(basename "$url") - -count=0 -what='fetching' -while : -do - if [ "$count" -eq 20 ]; then - echo "EE: excessive redirects" 1>&2 - exit 1 - fi - count=$(($count+1)) - - echo "II: $what $url" - - curl --silent --fail --show-error "$url" -o "$to" -D "$to.hdr" || exit 1 - redirect=$(awk '/^Location: / {gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2); print $2;}' "$to.hdr") - [ -z "$redirect" ] && break - what=' following' - - url=$(echo "$redirect" | sed -e 's@https://launchpadlibrarian.net/@http://launchpadlibrarian.net/@') - if [ "$redirect" != "$url" ]; then - echo "II: fixing $redirect" - fi -done - -exit 0 diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/fix-filenames.c linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/fix-filenames.c --- linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/fix-filenames.c 2023-01-05 19:50:00.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/fix-filenames.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/* - * fix-filenames: find a specified pathname prefix and remove it from - * C strings. - * - * Copyright (C) 2018 Canonical Ltd. - * Author: Andy Whitcroft - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int -main(int argc, char *argv[]) -{ - int rc; - char *in_name; - char *prefix; - int prefix_len; - int in_fd; - struct stat in_info; - char *in; - off_t size; - int length; - - if (argc != 3) { - fprintf(stderr, "Usage: %s \n", argv[0]); - exit(1); - } - in_name = argv[1]; - prefix = argv[2]; - prefix_len = strlen(prefix); - - in_fd = open(in_name, O_RDWR); - if (in_fd < 0) { - perror("open input failed"); - exit(1); - } - - rc = fstat(in_fd, &in_info); - if (rc < 0) { - perror("fstat input failed"); - exit(1); - } - size = in_info.st_size; - - in = mmap((void *)0, size, PROT_READ|PROT_WRITE, MAP_SHARED, in_fd, (off_t)0); - if (!in) { - perror("mmap failed"); - exit(1); - } - - for (; size > 0; size--, in++) { - if (*in != *prefix) - continue; - if (strncmp(in, prefix, prefix_len) != 0) - continue; - /* In the case of an exact match there there is nothing to move. */ - if (in[prefix_len] == '\0') - length = 0; - /* If this is a filename, strip the leading slash. */ - else if (in[prefix_len] == '/') - length = strlen(in + prefix_len + 1) + 1; - /* Otherwise just keep the suffix. */ - else - length = strlen(in + prefix_len) + 1; - - /* - * Copy the suffix portion down to the start and clear - * the remainder of the space to 0. - */ - memmove(in, in + prefix_len + 1, length); - memset(in + length, '\0', prefix_len); - } -} diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/generate-rules linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/generate-rules --- linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/generate-rules 1970-01-01 00:00:00.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/generate-rules 2023-02-10 17:50:36.000000000 +0000 @@ -0,0 +1,256 @@ +#!/bin/bash +set -e + +validate_unique() +{ + [ "$#" = "2" ] + local duplicates=$(echo $2 | tr " " "\n" | sort | uniq -d) + if [ "$duplicates" ]; then + echo "EE: duplicate values in $1" 1>&2 + exit 1 + fi +} + +# 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] +src_lrm_package=$(echo "${src_package}" | sed -e 's/-restricted-signatures/-restricted-modules/') +src_lrm_version=${src_version} + +cat - "debian/rules.in" >"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 + + validate_unique "archs" "$archs" + 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 +Depends: linux-image-${src_abi}-${flavour} | linux-image-unsigned-${src_abi}-${flavour}, +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" + +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" + +: >"debian/control.open" +while read command flavour archs +do + case "$command" in + build) ;; + *) continue ;; + esac + + validate_unique "archs" "$archs" + + 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 + + # If package specifies arch= keys, only build it on + # the intersection of kernel flavour arches & the + # package arches, otherwise build for all kernel + # flavour arches. + pkg_archs= + variant= + for cmd in $extra + do + case "$cmd" in + arch=*) pkg_archs="$pkg_archs ${cmd#arch=}" ;; + variant=*) variant="-${cmd#variant=}" ;; + esac + done + + if [ "$variant" != "-open" ]; then + continue + fi + + # No package arches set, build for everything + if [ -z "$pkg_archs" ]; then + pkg_archs=$archs + else + # Package arches set, build for intersection + validate_unique "pkg_archs" "$pkg_archs" + pkg_archs=$(sort <(echo $archs | tr " " "\n") <(echo $pkg_archs | tr " " "\n") | uniq -d | tr "\n" " ") + # No intersection, skip + if [ -z "$pkg_archs" ]; then + continue + fi + fi + + targets=$(echo "$pkg_archs" | sed -e 's/\>"debian/control.interlock-up" <= ${src_lrm_version}) [${pkg_archs}], +EOL + + # debian/rules.gen + cat - >>"debian/rules.gen" <= \$(nvidia_${suffix_under}_upstream_version))" +test:: + @echo $package $version $suffix_minus $suffix_under $suffix_short $targets +$targets:: + 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 install_control,linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour},${flavour},open,${suffix_short},postinst postrm); \\ + stream="${src_genr_version}/${src_abi}-${flavour}/open/nvidia-${suffix_minus}"; \\ + nvidia=\$\$(basename "\$\$stream"); \\ + install -d debian/linux-modules-nvidia-${suffix_minus}-\$(src_abi)-${flavour}/lib/modules/kernel/\$\$nvidia; \\ + for sig in \$\$stream/*.ko.sig; \\ + do \\ + ko=\$\$(basename "\$\$sig" ".sig"); \\ + cat "/lib/modules/${src_abi}-${flavour}/kernel/\$\$nvidia/\$\$ko" "\$\$sig" >"\$\$stream/\$\$ko"; \\ + echo "\$\$stream/\$\$ko /lib/modules/${src_abi}-${flavour}/kernel/\$\$nvidia" >>debian/linux-modules-nvidia-${suffix_minus}-${src_abi}-${flavour}.install; \\ + done +EOL + + # debian/control.d/nvidia + cat - >>"debian/control.open" < +Architecture: ${pkg_archs} +Section: kernel +Priority: optional +Built-Using: \${dkms:nvidia-${suffix_minus}-modules} +Depends: + \${misc:Depends}, + \${shlibs:Depends}, + linux-image-${src_abi}-${flavour} | linux-image-unsigned-${src_abi}-${flavour}, + \${nvk:nvidia-${suffix_minus}}, +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 + + done <"debian/dkms-versions" +done <"debian/package.config" + +cat "debian/control.common" "debian/control.signatures" "debian/control.open" | 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" "debian/control.open" diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules --- linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#!/bin/bash -set -e - -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 - -exec "$0.$pkg" "$@" diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules.lrg linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules.lrg --- linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules.lrg 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules.lrg 1970-01-01 00:00:00.000000000 +0000 @@ -1,172 +0,0 @@ -#!/bin/bash -set -e - -validate_unique() -{ - [ "$#" = "2" ] - local duplicates=$(echo $2 | tr " " "\n" | sort | uniq -d) - if [ "$duplicates" ]; then - echo "EE: duplicate values in $1" 1>&2 - exit 1 - fi -} - -# 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 - - validate_unique "archs" "$archs" - for arch in $archs - do - case " $build_archs " in - *\ $arch\ *) ;; - *) build_archs="$build_archs $arch" ;; - esac - done - - 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 - - # If package specifies arch= keys, only build it on - # the intersection of kernel flavour arches & the - # package arches, otherwise build for all kernel - # flavour arches. - pkg_archs= - for cmd in $extra - do - case "$cmd" in - arch=*) pkg_archs="$pkg_archs ${cmd#arch=}" ;; - esac - done - # No package arches set, build for everything - if [ -z "$pkg_archs" ]; then - pkg_archs=$archs - else - # Package arches set, build for intersection - validate_unique "pkg_archs" "$pkg_archs" - pkg_archs=$(sort <(echo $archs | tr " " "\n") <(echo $pkg_archs | tr " " "\n") | uniq -d | tr "\n" " ") - # No intersection, skip - if [ -z "$pkg_archs" ]; then - continue - fi - fi - - targets=$(echo "$pkg_archs" | sed -e 's/\>"debian/control.interlock-up" <= ${src_lrm_version}) [${pkg_archs}], -EOL - - # debian/rules.gen - # XXX: BUILD should help us here. - cat - >>"debian/rules.gen" <"debian/control" - -rm -f "debian/control.interlock-up" diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules.lrm linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules.lrm --- linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules.lrm 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/gen-rules.lrm 1970-01-01 00:00:00.000000000 +0000 @@ -1,262 +0,0 @@ -#!/bin/bash -set -e - -validate_unique() -{ - [ "$#" = "2" ] - local duplicates=$(echo $2 | tr " " "\n" | sort | uniq -d) - if [ "$duplicates" ]; then - echo "EE: duplicate values in $1" 1>&2 - exit 1 - fi -} - -# 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" -: >"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.interlock-up" <= @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 - - # If package specifies arch= keys, only build it on - # the intersection of kernel flavour arches & the - # package arches, otherwise build for all kernel - # flavour arches. - pkg_archs= - for cmd in $extra - do - case "$cmd" in - arch=*) pkg_archs="$pkg_archs ${cmd#arch=}" ;; - esac - done - # No package arches set, build for everything - if [ -z "$pkg_archs" ]; then - pkg_archs=$archs - else - # Package arches set, build for intersection - validate_unique "pkg_archs" "$pkg_archs" - pkg_archs=$(sort <(echo $archs | tr " " "\n") <(echo $pkg_archs | tr " " "\n") | uniq -d | tr "\n" " ") - # No intersection, skip - if [ -z "$pkg_archs" ]; then - continue - fi - fi - - targets=$(echo "$pkg_archs" | sed -e 's/\>"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 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: ${pkg_archs} -Section: kernel -Provides: \${dkms:nvidia-${suffix_minus}-modules}, nvidia-prebuilt-kernel -Depends: - \${misc:Depends}, - 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: ${pkg_archs} -Section: kernel -Priority: optional -Built-Using: \${linux:BuiltUsing} -Depends: - \${misc:Depends}, - \${shlibs:Depends}, - binutils, -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: ${pkg_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}), - \${nvk:nvidia-${suffix_minus}}, -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 - 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) $pkg_archs" - cat - >>"debian/control.d/migrate-nvidia" < linux-modules-nvidia-$to $archs" - cat - >>"debian/control.d/transitionals-local" <&2 - exit 1 - fi -} - -# 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 - - validate_unique "archs" "$archs" - 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 -Depends: linux-image-${src_abi}-${flavour} | linux-image-unsigned-${src_abi}-${flavour}, -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 -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/misc/git-ubuntu-log linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/misc/git-ubuntu-log --- linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/misc/git-ubuntu-log 2022-10-08 12:32:46.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/scripts/misc/git-ubuntu-log 1970-01-01 00:00:00.000000000 +0000 @@ -1,166 +0,0 @@ -#!/usr/bin/python3 - -import sys - -import codecs -import urllib.request -import json - -import textwrap - -sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach()) -sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) - -entries = [] - - -def add_entry(entry): - if entry and 'ignore' not in entry: - combo = [] - for bug in set(entry.get('bugs', [])): - combo.append(bug) - for cve in set(entry.get('cves', [])): - combo.append(cve) - combo = sorted(combo) - - if len(combo) == 0: - if entry.get('subject', "").startswith('UBUNTU'): - combo = '__packaging__' - else: - combo = '__mainline__' - else: - if entry.get('subject', "") == 'UBUNTU: link-to-tracker: update tracking bug': - # Construct a key with '__trackingbug__' on the first position - # and the tracking bug number afterwards - combo.insert(0, '__trackingbug__') - # Tracking bug goes at the top - keys.insert(0, combo) - else: - if combo not in keys: - keys.append(combo) - - entry['key'] = combo - entries.append(entry) - - -# Suck up the git log output and extract the information we need. -keys = [] -entry = None -subject_wait = False -for line in sys.stdin: - if line.startswith('commit '): - add_entry(entry) - entry = {} - subject_wait = True - - elif line.startswith('Author: '): - bits = line.strip().split(maxsplit=1) - entry['author'] = bits[1] - - elif subject_wait and line.startswith(' '): - subject_wait = False - entry['subject'] = line.strip() - - elif line.startswith(' BugLink: '): - bits = line.strip().split(maxsplit=2) - if len(bits) > 2: - # There is text after the URL, so use that (after stripping the - # enclosing characters) - entry.setdefault('bugs', []).append(bits[2][1:-1]) - elif 'launchpad.net' in bits[1]: - # Extract the bug number from the launchpad URL - bits = bits[1].split('/') - entry.setdefault('bugs', []).append(bits[-1]) - - elif line.startswith(' CVE-'): - entry.setdefault('cves', []).append(line.strip()) - - elif line.startswith(' Ignore:'): - entry['ignore'] = True - - elif line.startswith(' Properties:'): - for prop in line.strip().split()[1:]: - if prop in ('ignore', 'no-changelog'): - entry['ignore'] = True - -add_entry(entry) - -entries.reverse() - -# Go through the entries and clear out authors for upstream commits. -for entry in entries: - if entry['subject'].startswith('UBUNTU:'): - entry['subject'] = entry['subject'][7:].strip() - else: - del entry['author'] - -# Lump everything without a bug at the bottom. -keys.append('__packaging__') -keys.append('__mainline__') - -emit_nl = False -for key in keys: - if key == '__packaging__': - title_set = ['Miscellaneous Ubuntu changes'] - elif key == '__mainline__': - title_set = ['Miscellaneous upstream changes'] - else: - title_set = [] - for bug in key: - if bug.startswith('CVE-'): - title_set.append(bug) - elif bug == '__trackingbug__': - # Look for the tracking bug number on the second - # position of the key - continue - elif bug.isdigit(): - # Assume that it is an LP bug number if 'bug' contains only digits - bug_info = None - - try: - # urllib.request.urlcleanup() - request = urllib.request.Request('https://api.launchpad.net/devel/bugs/' + bug) - request.add_header('Cache-Control', 'max-age=0') - with urllib.request.urlopen(request) as response: - data = response.read() - bug_info = json.loads(data.decode('utf-8')) - - title = bug_info['title'] - if 'description' in bug_info: - for line in bug_info['description'].split('\n'): - if line.startswith('Kernel-Description:'): - title = line.split(' ', 1)[1] - - except urllib.error.HTTPError: - title = 'INVALID or PRIVATE BUG' - - title += ' (LP###' + bug + ')' - title_set.append(title) - else: - # Finally treat 'bug' itself as the title - title_set.append(bug) - - emit_title = True - for entry in entries: - if entry['key'] != key: - continue - - if emit_title: - if emit_nl: - print('') - emit_nl = True - - title_lines = textwrap.wrap('#// '.join(title_set), 76) - print(' * ' + title_lines[0].replace('LP###', 'LP: #').replace('#//', ' //')) - for line in title_lines[1:]: - line = line.replace('LP###', 'LP: #').replace('#//', ' //') - print(' ' + line) - - emit_title = False - - if key[0] != '__trackingbug__': - title_lines = textwrap.wrap(entry['subject'], 76) - print(' - ' + title_lines[0]) - for line in title_lines[1:]: - line = line.replace('LP###', 'LP: #') - print(' ' + line) diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/templates/nvidia.config.in linux-restricted-signatures-azure-5.19-5.19.0/debian/templates/nvidia.config.in --- linux-restricted-signatures-azure-5.19-5.19.0/debian/templates/nvidia.config.in 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/templates/nvidia.config.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -#!/bin/sh -set -e - -# Must load the confmodule for our template to be installed correctly. -. /usr/share/debconf/confmodule - -db_version 2.0 - -if [ "configure" = "$1" -o "reconfigure" = "$1" ]; then - # Load the current value if it is specified. - latelink= - [ -f /etc/default/linux-modules-nvidia ] && . /etc/default/linux-modules-nvidia - case "$latelink" in - true|false|'') ;; - *) echo "linux-modules-nvidia: latelink specifier invalid, ignored" 1>&2 - latelink='' - ;; - esac - if [ "$latelink" != '' ]; then - db_set linux/nvidia/latelink "$latelink" - fi - db_input low linux/nvidia/latelink || [ "$?" = "30" ] - db_go -fi - -exit 0 diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/debian/templates/nvidia.postinst.in linux-restricted-signatures-azure-5.19-5.19.0/debian/templates/nvidia.postinst.in --- linux-restricted-signatures-azure-5.19-5.19.0/debian/templates/nvidia.postinst.in 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/debian/templates/nvidia.postinst.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -#!/bin/sh -set -e - -version=@abiname@@localversion@ -image_path=/boot/@image-stem@-$version - -bits=/lib/modules/$version/kernel/nvidia-@nvidia-ver@/bits - -if [ "$1" != configure ]; then - exit 0 -fi - -ubiquity_live() { - if [ -n "${UBIQUITY_FRONTEND}" ] && ! systemd-detect-virt --chroot; then - return 0 - else - return 1 - fi -} -# Must load the confmodule for our template to be installed correctly. -if ! ubiquity_live; then - . /usr/share/debconf/confmodule -fi - -conf=/etc/default/linux-modules-nvidia -latelink='' -[ -f "$conf" ] && . "$conf" -case "$latelink" in -true|false|'') ;; -*) echo "linux-modules-nvidia: latelink specifier invalid, ignored" 1>&2 - latelink='' - ;; -esac - -mkdir -p /usr/lib/linux -if ubiquity_live; then - RET=false -else - db_get linux/nvidia/latelink -fi -# If the value is changed write it back. -if [ "$RET" != "$latelink" ]; then - if [ ! -f "$conf" ]; then - cat - >"$conf" </usr/lib/linux/triggers/$version </dev/null || true -# -# See the commentary on extra.postrm.in for why this is disabled. -# -#if [ -d /etc/kernel/postinst.d ]; then -# # We want to behave as if linux-image (without us) was installed, therefore -# # we do not want the postinst support to know we are being removed, claim -# # this is an installation event. -# cat - >/usr/lib/linux/triggers/$version </usr/lib/linux/triggers/$version </dev/null || true +# +# See the commentary on extra.postrm.in for why this is disabled. +# +#if [ -d /etc/kernel/postinst.d ]; then +# # We want to behave as if linux-image (without us) was installed, therefore +# # we do not want the postinst support to know we are being removed, claim +# # this is an installation event. +# cat - >/usr/lib/linux/triggers/$version <]" - 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 - s[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" -git_base="$remote_name/$sru_cycle" - -# 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 -} - -# 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="$remote_name/master" ;; - *) 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_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_base)" \ - -m "BugLink: https://bugs.launchpad.net/bugs/1786013" \ - -s -- "$thing" -else - echo "$thing: no changes from kernel-versions" -fi - -exit 0 diff -Nru linux-restricted-signatures-azure-5.19-5.19.0/update-version linux-restricted-signatures-azure-5.19-5.19.0/update-version --- linux-restricted-signatures-azure-5.19-5.19.0/update-version 2023-01-05 19:50:31.000000000 +0000 +++ linux-restricted-signatures-azure-5.19-5.19.0/update-version 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ -#!/bin/bash - -here=$(dirname $(readlink -f "$0")) - -tag_prefix=`dpkg-parsechangelog -S Source | sed 's/linux-restricted-modules/Ubuntu/'`- - -commit=: -no_update=false -master_version= -master_dir= -while : -do - if [ "$1" = "--commit" ]; then - shift - commit= - - elif [ "$1" = "--no-update" ]; then - shift - no_update=true - - elif [ "$1" = "--master-version" ]; then - master_version="$2" - shift 2 - - else - break - fi -done - -if [ "$master_version" = "" ]; then - if [ "$#" -ne 1 ]; then - echo "Usage: $0 " 1>&2 - exit 1 - fi - master_dir="$1" - - # Work out the master kernel version. - if [ -f "$master_dir/debian/debian.env" ]; then - branch=`sed -ne 's/DEBIAN=//p' <"$master_dir/debian/debian.env"` - changelog="-l$branch/changelog" - else - changelog="" - fi - master_version=`(cd "$master_dir" && LC_ALL=C dpkg-parsechangelog -SVersion $changelog)` -else - no_update=true -fi - -# Work out our current version taking into account closed sections. -here_series=$( LC_ALL=C dpkg-parsechangelog -S Distribution ) -if [ "$here_series" = "UNRELEASED" ]; then - here_version=$( LC_ALL=C dpkg-parsechangelog -o 1 -S Version ) - here_series=$( LC_ALL=C dpkg-parsechangelog -c 1 -S Distribution ) -else - here_version=$( LC_ALL=C dpkg-parsechangelog -S Version ) -fi - -# Ensure we have the appropriate tag. -here_tagversion=$( echo "$tag_prefix$here_version" | sed -e 's/~/_/g' ) -count=$( git for-each-ref "refs/tags/$here_tagversion" | wc -l ) -if [ "$count" != 1 ]; then - echo "$0: $here_tagversion: tag not found" 1>&2 - exit 1 -fi - -update_file() -{ - local src="$1" - local dst="$2" - cp -p "$src" "$dst" || exit 1 - if ! git diff --exit-code -- "$dst" >/dev/null; then - git commit -m "UBUNTU: $dst -- update from master" -s -- "$dst" - else - echo "$dst: no changes from master" - fi -} - -# Update things from the primary package. -if [ "$no_update" = 'false' ]; then - update_file "$master_dir/$branch/tracking-bug" "debian/tracking-bug" - "$here/update-dkms-versions" || exit 1 - for master_file in \ - debian/scripts/misc/git-ubuntu-log \ - debian/scripts/dkms-build \ - debian/scripts/dkms-build--nvidia-N \ - debian/scripts/fix-filenames.c - do - update_file "$master_dir/$master_file" "$master_file" - done -fi -#echo "here_version<$here_version>" -#echo "master_version<$master_version>" - -# Work out a sensible new version based on the primary kernel version. -if dpkg --compare-versions "$here_version" lt "$master_version"; then - here_newversion="$master_version" - -elif dpkg --compare-versions "$here_version" eq "$master_version"; then - here_newversion="$master_version+1" -else - minor=$(( ${here_version##*+} + 1 )) - here_newversion="$master_version+$minor" -fi - -# First insert any primary changes. -marker="__CHANGELOG_FRAGMENT_MARKER__" -dch --newversion "$here_newversion" "$marker" - -# Prepare the blank changelog. -tmp="/tmp/$$.msg" - -# Note we are being synced to the master version. -if dpkg --compare-versions "$here_version" lt "$master_version"; then - echo "Updated to version: $master_version" - [ -f "$tmp" ] && echo "" >>"$tmp" - echo " * Master version: $master_version" >>"$tmp" -fi - -# Format any existing commits. -count=$( git log --oneline "$here_tagversion".. | wc -l ) -if [ "$count" != 0 ]; then - [ -f "$tmp" ] && echo "" >>"$tmp" - git log "$here_tagversion".. | "debian/scripts/misc/git-ubuntu-log" >>"$tmp" -fi - -# Insert official changelog fragment. -sed -i -e '/^ \* '"$marker"'/{ -r '"$tmp"' -d -}' debian/changelog -rm -f "$tmp" - -# Close this changelog entry. -dch --distribution "$here_series" --release '' - -# Emit final closing commands. -echo "git commit -s -m 'UBUNTU: $tag_prefix$here_newversion' debian/changelog" -$commit git commit -s -m "UBUNTU: $tag_prefix$here_newversion" debian/changelog -here_tagversion=$( echo "$tag_prefix$here_newversion" | sed -e 's/~/_/g' ) -echo "git tag -s -m '$tag_prefix$here_newversion' '$here_tagversion'" -$commit git tag -s -m "$tag_prefix$here_newversion" "$here_tagversion"