From patchwork Tue Feb 28 09:49:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1749385 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=SLgypzJn; 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 4PQt0m4PHrz1yWy for ; Tue, 28 Feb 2023 20:51:04 +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 1pWwdJ-0002Oq-Up; Tue, 28 Feb 2023 09:50:54 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pWwd7-0001z5-WB for kernel-team@lists.ubuntu.com; Tue, 28 Feb 2023 09:50:42 +0000 Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (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-0.canonical.com (Postfix) with ESMTPS id 0DC293F59C for ; Tue, 28 Feb 2023 09:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1677577840; bh=KU5SdTZT4xYntueNIyXz/wD5UwQvmUr52CTa6ZhsZW8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SLgypzJn2rfpcmzTWK6JmSWxhu6fePHJGy8pZgvdYjWE0pIudepXZpMXUi3E5gMes AFPh86ZGS+zkJ+U77sCd/e+sn4qhjUJ2faGpbuIrUNd7gOG5yYOScz3h03DIZ5TzAm V9jvfVbIgEiIbE0ZHjBlJK5sTWIoz2ZEW/R1r2Sie5GB7cSSCT1G/SoVINeehxDGn8 zlE0K/ge9OY5hBmoqDjwdQ2rDeUKvgZSb/QxWvpuYNmEl8HzwscyFbHAx+FOEZZkcU ijOlh8CfnyRlBFODu4WtWC0LKoGC/NLDLa0x9osPzspUHjpT0HiTmlmQD9BaMyk+ZU ID5N9B1zL8yiw== Received: by mail-pl1-f199.google.com with SMTP id l10-20020a17090270ca00b0019caa6e6bd1so5041613plt.2 for ; Tue, 28 Feb 2023 01:50:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677577838; 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=KU5SdTZT4xYntueNIyXz/wD5UwQvmUr52CTa6ZhsZW8=; b=4s2/kogpeIjlUsbtmI4pyfUHH1nL7+DsN636cS9Ns8we+na38qoSwGESyUJSCe4RzU 2Sd0AbTFU3ZTgufFOdzy3zyY/Q4K2PZamvIOW/X7a1lTCp6TU4S/S2aMfQqzHd8gOhQf MfHhMvz1eAbgTd0oNUpZs8CSapHT0VQwYxgvkWxWa/+9ksvcCsWll4EuGxIkOXs36/vm go4Bd7vj6tD/9JYBfUGMl0PYVE3XesRcedATFE2eZBchTr/tlk8E6OjInlzGmtAlZK3Z G8Y3euZPIq21kh8wUAz19THaO1fCDzFt2MrGGmd5/94hQv4It+NLiyCtpLkYavf/eq1y ygcQ== X-Gm-Message-State: AO0yUKWCGXffHHsOzkIfxj+yq82zHQsiuJN/XC+NIHDaTXq+hQvo8+FM KFUSgbRarTy9SqMx7gZURWEf3vrBBvQZQc2a/ntQF0X5jgOKdg7dG8vrbuZS4CPZ+K4TemUKRW+ 5kq/XHo0Pqkr2HpSVZzEKeMVZ0haoPX6b4WoWJpyRAhNw5Fc= X-Received: by 2002:a05:6a21:78a5:b0:c7:2542:ba43 with SMTP id bf37-20020a056a2178a500b000c72542ba43mr3072791pzc.47.1677577838525; Tue, 28 Feb 2023 01:50:38 -0800 (PST) X-Google-Smtp-Source: AK7set8Kb+xLh9vcElfYqXIFi7bqlDIOsjHDtkhxYcQdEunF+QaDzYXN+CGNK2zXBWmOq+ZRYDdV/g== X-Received: by 2002:a05:6a21:78a5:b0:c7:2542:ba43 with SMTP id bf37-20020a056a2178a500b000c72542ba43mr3072775pzc.47.1677577838229; Tue, 28 Feb 2023 01:50:38 -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.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 01:50:38 -0800 (PST) From: Masahiro Yamada To: kernel-team@lists.ubuntu.com Subject: [RFC/upstream:linux 4/5] kbuild: snap-pkg: rafactor the build rule slightly Date: Tue, 28 Feb 2023 18:49:48 +0900 Message-Id: <20230228094949.2660702-5-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" Split it into two rules, to generate snapcraft.yaml and run snapcraft. Signed-off-by: Masahiro Yamada --- scripts/Makefile.package | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 0b99e4aaead1..5a1ffd343651 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -132,16 +132,18 @@ intdeb-pkg: # snap-pkg # --------------------------------------------------------------------------- -PHONY += snap-pkg -snap-pkg: - rm -rf $(objtree)/snap - mkdir $(objtree)/snap - sed "s@KERNELRELEASE@$$(echo $(KERNELRELEASE) | cut -b -32)@" \ - $(srctree)/scripts/package/snapcraft.template > \ - $(objtree)/snap/snapcraft.yaml - mkdir -p snap/dummy - cd $(objtree)/snap && \ - SNAPCRAFT_BUILD_ENVIRONMENT=host snapcraft --target-arch=$(UTS_MACHINE) + +quiet_cmd_gen_snapcraft = GEN $@ + cmd_gen_snapcraft = \ + rm -rf $(dir $@); \ + mkdir -p snap/dummy; \ + sed "s/KERNELRELEASE/$$(echo $(KERNELRELEASE) | cut -b -32)/" $< > $@ + +snap/snapcraft.yaml: scripts/package/snapcraft.template FORCE + $(call cmd,gen_snapcraft) + +snap-pkg: snap/snapcraft.yaml + +$(Q)cd snap && SNAPCRAFT_BUILD_ENVIRONMENT=host snapcraft --target-arch=$(UTS_MACHINE) # dir-pkg tar*-pkg - tarball targets # ---------------------------------------------------------------------------