From patchwork Fri Jun 17 15:09:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1644881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=D7I5Aivy; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LPjC718Qbz9sG0 for ; Sat, 18 Jun 2022 01:10:11 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1o2Dbn-0007mW-Ka; Fri, 17 Jun 2022 15:10:03 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1o2Dbl-0007lO-7X for kernel-team@lists.ubuntu.com; Fri, 17 Jun 2022 15:10:01 +0000 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 860103F11D for ; Fri, 17 Jun 2022 15:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1655478600; bh=vVdUX92eUKQCaVDnpTtahZHe81x3j/O9TZKHU7erXXM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=D7I5Aivyn0Ihs5acxTsVl9izcvSl5zdWt0gDXCuZVibYIMbWAmD4iwLIsNmM8E7Tr NY1mvA/bxTDGvCD5esm7Z807/fHydwJNCvqqb+Xhgh0mYdC2gyKuplDSEPCmStuW1l S71jQfJYpvH6b1NATO4MGK5ZQNZCmxn/Ctqjn39H9uRy2+KAGqqjkxRxGaj9zrfBwd esFobUuRENYljkk8yzgH3bo1IkFDru3KBqGim/7ymFsY0BQKxGq2hmLQEWK38tX0w8 TNyR6raEOVjrRmsfkqf+Vif6PGeHxbnB/OrSvkg/jNRVCiVpLKVg4Iyk/KsYDzLMkO tGoCnOTZwfwhw== Received: by mail-wm1-f71.google.com with SMTP id k5-20020a05600c0b4500b003941ca130f9so1637263wmr.0 for ; Fri, 17 Jun 2022 08:10:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=vVdUX92eUKQCaVDnpTtahZHe81x3j/O9TZKHU7erXXM=; b=18B/LDjHEjYc2jqFVb5fPfEsbdb8LeMq9p111Y4bqu98kOHw1c34voOTgkoGKFUmfO Wr5LxrNEfcjPFXLbeX53MUhwqHYRnPCY5rmjzC49F9ERVLhO1BkuF70MBw/Wsx+gQ+Oa KRyu8FZVsJOfJpmDO4FJL+m1/48X2RwYg4wIca7lgsTNLG4RFRG6kvNitwGRW6ptkZRG Bv3pFqV9aJ8evy+0Vd1FOFd+dkkdZKwMQzpdAVNaIDSTyMYs1b0evRDuaPST05byuTnZ H0MgvhbF5HntIKW5EFjre+GGVFtc8RbcVhhWHUkpaS9oa2lHCy5E9+z/dkeGtfnNbjYu JfnQ== X-Gm-Message-State: AJIora/nGWoniSr+SilH/+XOZcECz5AsmGcL3kU4OKUFhD5/9h14JHyh vq7qGgZlNkGqVZmk+ojZlntYoOINMqjjwz31v/2uE1d+KH37RWj1v1EeLWoR/i1ANGz6lJKxD1O 3RjGI0T2Bfn5hYfe0R+hJE1v7HC6y/TP5BeZu7cnK0A== X-Received: by 2002:a05:600c:2e48:b0:39c:55ba:e4e9 with SMTP id q8-20020a05600c2e4800b0039c55bae4e9mr10602526wmf.180.1655478599802; Fri, 17 Jun 2022 08:09:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vo7QkbuQtGBLFERWbu8rqTwQwa29N9rZ7y+EsBGGVLVcLZ77RHh7VybtocghhquiQt31Ae+A== X-Received: by 2002:a05:600c:2e48:b0:39c:55ba:e4e9 with SMTP id q8-20020a05600c2e4800b0039c55bae4e9mr10602493wmf.180.1655478599431; Fri, 17 Jun 2022 08:09:59 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:9cce:a6ab:7f23:ac52]) by smtp.gmail.com with ESMTPSA id d3-20020adffbc3000000b0020e6ce4dabdsm4984411wrs.103.2022.06.17.08.09.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 08:09:58 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [JAMMY/linux-restricted-modules-oem-5.17|intel-iotg][PATCH] UBUNTU: [Packaging] LRMv6: add multi-architecture support Date: Fri, 17 Jun 2022 16:09:57 +0100 Message-Id: <20220617150957.75257-1-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1968774 Signed-off-by: Dimitri John Ledkov Acked-by: Tim Gardner --- This patch upgrades LRMv5.2 to LRMv6.0 in: - jammy/linux-restricted-modules-oem-5.17 - jammy/linux-restricted-modules-intel-iotg To update packaging to feature parity with LRM jammy generic. debian/lrm-version | 2 +- debian/scripts/gen-rules | 1 + debian/scripts/gen-rules.lrg | 43 ++++++++++++++++++++++++++--- debian/scripts/gen-rules.lrm | 53 ++++++++++++++++++++++++++++++------ debian/scripts/gen-rules.lrs | 12 ++++++++ 5 files changed, 97 insertions(+), 14 deletions(-) diff --git a/debian/lrm-version b/debian/lrm-version index ef425ca982..e0ea36feef 100644 --- a/debian/lrm-version +++ b/debian/lrm-version @@ -1 +1 @@ -5.2 +6.0 diff --git a/debian/scripts/gen-rules b/debian/scripts/gen-rules index 48944818a8..c5c36a60e8 100755 --- a/debian/scripts/gen-rules +++ b/debian/scripts/gen-rules @@ -1,4 +1,5 @@ #!/bin/bash +set -e src_package=$(LC_ALL=C dpkg-parsechangelog -SSource) case "$src_package" in diff --git a/debian/scripts/gen-rules.lrg b/debian/scripts/gen-rules.lrg index 61ad057804..db613272ae 100755 --- a/debian/scripts/gen-rules.lrg +++ b/debian/scripts/gen-rules.lrg @@ -1,4 +1,15 @@ #!/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 @@ -58,6 +69,7 @@ do *) continue ;; esac + validate_unique "archs" "$archs" for arch in $archs do case " $build_archs " in @@ -66,8 +78,6 @@ do esac done - targets=$(echo "$archs" | sed -e 's/\>"debian/control.interlock-up" <= ${src_lrm_version}) [${archs}], + linux-objects-nvidia-${suffix_minus}-${src_abi}-${flavour} (>= ${src_lrm_version}) [${pkg_archs}], EOL # debian/rules.gen diff --git a/debian/scripts/gen-rules.lrm b/debian/scripts/gen-rules.lrm index 574a00ec3a..223918f50a 100755 --- a/debian/scripts/gen-rules.lrm +++ b/debian/scripts/gen-rules.lrm @@ -1,4 +1,15 @@ #!/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 @@ -70,8 +81,7 @@ do *) continue ;; esac - targets=$(echo "$archs" | sed -e 's/\>"debian/control.interlock-up" <= @VERSION@) [${archs}], EOL @@ -95,11 +105,36 @@ EOL *\ 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" < -Architecture: ${archs} +Architecture: ${pkg_archs} Section: kernel Provides: \${dkms:nvidia-${suffix_minus}-modules}, nvidia-prebuilt-kernel Depends: @@ -142,7 +177,7 @@ EOL Package: linux-objects-nvidia-${suffix_minus}-${src_abi}-${flavour} Build-Profiles: -Architecture: ${archs} +Architecture: ${pkg_archs} Section: kernel Priority: optional Built-Using: \${linux:BuiltUsing} @@ -160,7 +195,7 @@ Description: Linux kernel nvidia modules for version ${src_abi} (objects) Package: linux-modules-nvidia-${suffix_minus}-${src_abi}-${flavour} Build-Profiles: -Architecture: ${archs} +Architecture: ${pkg_archs} Section: kernel Priority: optional Built-Using: \${linux:BuiltUsing} @@ -187,11 +222,11 @@ EOL transition=*) from="${cmd#transition=}" from_minus=$(echo "$from" | sed -e 's/nvidia-graphics-drivers-//') - echo "II: general transition $from -> $package ($from_minus -> $suffix_minus)" + echo "II: general transition $from -> $package ($from_minus -> $suffix_minus) $pkg_archs" cat - >>"debian/control.d/migrate-nvidia" < linux-modules-nvidia-$to" + echo "II: manual transition linux-modules-nvidia-$from -> 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 @@ -57,6 +68,7 @@ do *) continue ;; esac + validate_unique "archs" "$archs" targets=$(echo "$archs" | sed -e 's/\