From patchwork Tue Feb 28 09:49:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1749386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.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=irmJQePd; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PQt0s6ZgRz1yWy for ; Tue, 28 Feb 2023 20:51:09 +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 1pWwdQ-0002cx-A9; Tue, 28 Feb 2023 09:51:00 +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 1pWwd9-00022Z-M8 for kernel-team@lists.ubuntu.com; Tue, 28 Feb 2023 09:50:43 +0000 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) (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 4C7213F11D for ; Tue, 28 Feb 2023 09:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1677577841; bh=/gYlxA0LX43L0j5JA55yp/Aek4uTto+nwM6wc+2idzI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=irmJQePdagZehG5B9PX5KJwV6Ff7h05cCEFlx+gcGK79KrzQtFod5J0od8FgiWKk5 0XSVtsQMZKO68PA0mbNISKP59MeVsyznYpUgmAiHa2HP6pnd/0ADu9fqdTmtYhlSQf ITpMJUoSq7YsrrjxF6qhYlhQpmgL81Gf2wxOVoH9RMYbNvT5NsdIp7wQSnd06xfm60 oqDEK9iqwnQOF1sZ2UC0uCtq0/oipSRBoiYqyLgN0Gr+5nwe6RK9eiExV1M+45+e35 tPu8gt5cEMiZykRAF7Y0iFckxkm9nMyHwtS3IQh7QWhjuGWhOKynf9G76FmSf8Xpg4 S8hyPvSXLIMag== Received: by mail-pl1-f200.google.com with SMTP id ki15-20020a170903068f00b0019ce282dc68so5022217plb.6 for ; Tue, 28 Feb 2023 01:50:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677577840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/gYlxA0LX43L0j5JA55yp/Aek4uTto+nwM6wc+2idzI=; b=NZNxM7YJMcMXH7JkHpKnw2JFZldikAeuJXFiG324LZ002+huYajzDD8+4HuE80J0y2 WYPRXvgxE4zni2rWFggKbR5uE5Z2z9Z4jrwVfNdJSuWgcUPjE2blLbEBrVTtzpXqmIvL TwTz7fG0WuQ9vywknVszy1Lj3Mv6IrHZnsK1sj2bloQkxySO+TTb5RzB94naKPcIa/26 688ARDNIkEgB7w3AzU1NTbYq2YNwfMmVkdjdtFSCmBDtbL/XMDh38GnFa7Xh4VDDWPoj P6bkWFbS5AlT/XR8ZRYRy+Am6M68eZnwT5hhBC6Ge7hAC/kAWTSMBCpGDEFrM5kv4Z+a 3TwQ== X-Gm-Message-State: AO0yUKW4Sqg4UZB8T4Bjeh/HJcGBFOt+jUMipAUNTdNZMl6Ykenwi1f3 SCnTQSmJg5LhMxoEhldx0nUkV6Ry2qLlIx5LgaY3AnZ11LxN+EieuF+Iz0d8cwEJxf4dIqxLLz6 MyMBoTUvWeQJg/AlnWCt+RssxRGkL6rYWzOGK43wIJh85W5Q= X-Received: by 2002:a62:4dc1:0:b0:5f2:104b:4c46 with SMTP id a184-20020a624dc1000000b005f2104b4c46mr1921756pfb.2.1677577839875; Tue, 28 Feb 2023 01:50:39 -0800 (PST) X-Google-Smtp-Source: AK7set9Fl3ZxW3iSjRtiIBZ9dkwP0IYA9T50qW1fCihmq6Tfz5a7gQ622eJvEDGpW2o8fPmLyxsDyQ== X-Received: by 2002:a62:4dc1:0:b0:5f2:104b:4c46 with SMTP id a184-20020a624dc1000000b005f2104b4c46mr1921747pfb.2.1677577839650; Tue, 28 Feb 2023 01:50:39 -0800 (PST) Received: from zoe.localdomain ([2001:f74:8f00:c00:6aff::1005]) by smtp.gmail.com with ESMTPSA id s11-20020aa7828b000000b0059435689e36sm5811112pfm.170.2023.02.28.01.50.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 01:50:39 -0800 (PST) From: Masahiro Yamada To: kernel-team@lists.ubuntu.com Subject: [RFC/upstream:linux 5/5] kbuild: snap-pkg: avoid downloading os.snap again Date: Tue, 28 Feb 2023 18:49:49 +0900 Message-Id: <20230228094949.2660702-6-masahiro.yamada@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230228094949.2660702-1-masahiro.yamada@canonical.com> References: <20230228094949.2660702-1-masahiro.yamada@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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" snapcraft downloads os.snap every time. Reuse local os.snap in snap/parts/kernel/src/. Signed-off-by: Masahiro Yamada --- scripts/Makefile.package | 5 ++++- scripts/package/snapcraft.template | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 5a1ffd343651..f202bddcd5df 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -135,8 +135,11 @@ intdeb-pkg: quiet_cmd_gen_snapcraft = GEN $@ cmd_gen_snapcraft = \ - rm -rf $(dir $@); \ mkdir -p snap/dummy; \ + if [ -f snap/parts/kernel/src/os.snap ]; then \ + cp snap/parts/kernel/src/os.snap snap/; \ + fi; \ + rm -rf snap/parts snap/prime snap/stage; \ sed "s/KERNELRELEASE/$$(echo $(KERNELRELEASE) | cut -b -32)/" $< > $@ snap/snapcraft.yaml: scripts/package/snapcraft.template FORCE diff --git a/scripts/package/snapcraft.template b/scripts/package/snapcraft.template index fd91ac9c2ca3..3de8bcdfdcd9 100644 --- a/scripts/package/snapcraft.template +++ b/scripts/package/snapcraft.template @@ -13,6 +13,14 @@ parts: source: dummy source-type: local kernel-with-firmware: false + override-pull: | + ls + pwd + if [ -r ../../../os.snap ]; then + cp ../../../os.snap . + else + snapcraftctl pull + fi override-build: | # build in-place cd ..