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. :