From patchwork Tue Feb 28 09:49:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1749382 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=oB1Y6Yae; 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 4PQt0W2J7nz1yWy for ; Tue, 28 Feb 2023 20:50:51 +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 1pWwd6-0001yS-F2; Tue, 28 Feb 2023 09:50:40 +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 1pWwd2-0001sC-JB for kernel-team@lists.ubuntu.com; Tue, 28 Feb 2023 09:50:36 +0000 Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (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 5353A3F11D for ; Tue, 28 Feb 2023 09:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1677577836; bh=R3IiTDFsYljbTwpXtQiHjP0elQ7sBUxJv0tkeUXFwio=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oB1Y6YaeyIwdIVbVh/oGkxcT7B+cov1l5mFoHeCxq7+BrhZvrlgL1qZjMuw75FmUI n+XNgin++OKNafSCeISq3eGQXXfVXjwYVK6aRMqK3HCL4qJ6d86MsFm/2x7JJ05ok1 WVnJJi3T9uDWlLPeggaVI5oE1OY+OLW4RiBbTKBWOYnu/Xa4Ag+KOgLGa+P5YUi9qv 2f2TcnDvH4KCMWu55FlEt/PiT5TCB+y0Wc4+P6EO/4FD8ZbCLBTAk/oRlwYbBMqBM8 96ZfwWNybt1OumpD2RTIVWq6OrmgT0ABr08kibIPCtYMdyGVnP7dA9GCFf280ZXhqW IQ0LlPohPBnUQ== Received: by mail-pj1-f72.google.com with SMTP id q61-20020a17090a1b4300b00237d2fb8400so4263416pjq.0 for ; Tue, 28 Feb 2023 01:50:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677577834; 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=R3IiTDFsYljbTwpXtQiHjP0elQ7sBUxJv0tkeUXFwio=; b=7pls5I1uujSHfvdN+gr6zExt2Z4IVUZfx1Jl7iBjO8gao6oKnfrqGhAFMAzqk9e3w+ CRWUVIvktmCcA3i84h/XSDuBE3JaBUXB5RaXamoX3VKGpIe+2rFeHw9GuylSURUs9WCN BPEzvIUnVu+Cngn2rGJLgL48W13xWFewhJCVFuUXjwe6rGQj4fwtQDA5yRMIitpPTL+M /W4/XfDqoQ0JxaLbAnxkXT7UEJmjWWKmVhTJdA/UCKeIOddWBx1ax7lo07j22XURVY2j m9qvs1DKyAd8Lwxx/NGvew8iTBnxR4EXasEE1rX7lJa1jxtPAtmwWck8XHM7njRjvquB Z55Q== X-Gm-Message-State: AO0yUKWeH70xEEFODAMP8Gpf9Fs/OvNWOnJHC64StsOlN5rV5MzSGQWJ cRBpCXBrevyoDnD01odApFSctUkE808SIt3dVvWMaMS3mMI8N6lZo7pYqEOujyz52YE+by6hjaW knvXmdW29CNtsva8h1E9G5msXf6ULInYKU4t5pD7Dd7ZjRdE= X-Received: by 2002:a05:6a20:6997:b0:cd:b1f:1b86 with SMTP id t23-20020a056a20699700b000cd0b1f1b86mr3997739pzk.61.1677577834763; Tue, 28 Feb 2023 01:50:34 -0800 (PST) X-Google-Smtp-Source: AK7set9Q/xogX1oqbTF4ErwjPj0J51DT/I2t8RcdK4eMK1HJIZ+OUx+l2eEwzaypJCTrmGDcKOVZrg== X-Received: by 2002:a05:6a20:6997:b0:cd:b1f:1b86 with SMTP id t23-20020a056a20699700b000cd0b1f1b86mr3997723pzk.61.1677577834487; Tue, 28 Feb 2023 01:50:34 -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.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 01:50:34 -0800 (PST) From: Masahiro Yamada To: kernel-team@lists.ubuntu.com Subject: [RFC/upstream:linux 1/5] kbuild: snap-pkg: make it work on Ubuntu 20.04 or later Date: Tue, 28 Feb 2023 18:49:45 +0900 Message-Id: <20230228094949.2660702-2-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" 'make snap-pkg' works on Ubuntu 18.04, but not on 20.04 or later. Add 'build-base' to meet the current requirement. As documented in the snapcraft document [1], the kernel plugin is only available on core and core18 based snaps. Specify 'build-base: core18' to use the kbuild plugin. Another change in snapcraft is that it tries to build the snap in a multipass VM by default, then it fails to find the source tar in the host file system. Pass SNAPCRAFT_BUILD_ENVIRONMENT=host to build it in the destructive mode. [1]: https://snapcraft.io/docs/kernel-plugin Signed-off-by: Masahiro Yamada --- scripts/Makefile.package | 2 +- scripts/package/snapcraft.template | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index b941e6341b36..3058d0cdb578 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -143,7 +143,7 @@ snap-pkg: $(srctree)/scripts/package/snapcraft.template > \ $(objtree)/snap/snapcraft.yaml cd $(objtree)/snap && \ - snapcraft --target-arch=$(UTS_MACHINE) + SNAPCRAFT_BUILD_ENVIRONMENT=host snapcraft --target-arch=$(UTS_MACHINE) # dir-pkg tar*-pkg - tarball targets # --------------------------------------------------------------------------- diff --git a/scripts/package/snapcraft.template b/scripts/package/snapcraft.template index 626d278e4a5a..9835bf4c3194 100644 --- a/scripts/package/snapcraft.template +++ b/scripts/package/snapcraft.template @@ -5,6 +5,7 @@ description: The upstream Linux kernel grade: stable confinement: strict type: kernel +build-base: core18 parts: kernel: From patchwork Tue Feb 28 09:49:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1749383 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=qvTFm7B2; 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 4PQt0b6LRMz1yWy for ; Tue, 28 Feb 2023 20:50:55 +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 1pWwd9-00023r-Jm; Tue, 28 Feb 2023 09:50:43 +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 1pWwd4-0001vV-Ge for kernel-team@lists.ubuntu.com; Tue, 28 Feb 2023 09:50:38 +0000 Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (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 0E2013F59C for ; Tue, 28 Feb 2023 09:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1677577838; bh=jz7tfN8G6RHWgfsUefycnAvdui5d+sAW1gNqfD3QioQ=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qvTFm7B2v/tE17J9BpPi5vVLpE041kfEPTxOt+JTGr5Ji9IXfLETI1pckpmYsEJp2 UcCUE3FSHhUv0CRYvtImBohgUJJHU8KxNXDhbh3yinLebuGjQKI25AEdVzwP4YjUwY t1OEzj8kkenYTZ2Lx90xdK5kCj/blLfAibZSxZGU5OsAKPuWIBZ8xMpRd+eaGkVOmZ V8BkldQa8gPvpr8gAZsWpvLvaMSnExMfgPnI/568wwG1nsVYC4MYR3IwLY/pSsypNl I1xiV2v37z06IXhGHkKD6G6APxdsIlPFcjsj11RrUdujOfJ4VmTgLrbJ9dhaZ7haSO daF8itwvv2jfA== Received: by mail-pj1-f72.google.com with SMTP id d3-20020a17090acd0300b00237659aae8dso6597981pju.1 for ; Tue, 28 Feb 2023 01:50:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677577836; 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=jz7tfN8G6RHWgfsUefycnAvdui5d+sAW1gNqfD3QioQ=; b=sUDh+5QQrkC6kvaFG9bbGRaS/+c+8ihtyRj5QjmisbUi5Ba7LwrlHlVuL9IzNS47M2 wY1wmTVTHnjxFQNt7dk2kiquMhAxcVl1R0PEUKwY+g3fxFM+n9M6z3LtZWj5Br/LKkRi YkqGLwg8Aj4NxBKcG9bZY5swOJBDGSionrR+ivI4SYK1p9X1xEyvJZ2O4bvODO06qMHm RAAZ9jPaURzGMmz2gS0CHRr8vDtKTHZQfTBW4IX1DY1xhOpmOSIBd9Mohdrese+YSxKU DRtkjcD9usTbD96szQeeR6sUghyA9oBKZLRZo4XfCN4q7K9NYwZhVQHJVSxZYFrggnK/ a6BQ== X-Gm-Message-State: AO0yUKUS/qI6yM3406g9NMWhkeCAVa1Bxi00y3v9C3HR8+yA54V1izu9 SnkupXFrQO8+N6BoXwrQB410TH4Dfmaa1QaPJS+JOGBHEqyJTezCHfevDDsSZvaXw5bMDnt0eWR p5AO+B9AM1bJ4dmhxIcvZB86QH2ziXx0EAbNZdl09mMudrfM= X-Received: by 2002:a62:6456:0:b0:5a8:beb3:d55f with SMTP id y83-20020a626456000000b005a8beb3d55fmr1619481pfb.32.1677577836093; Tue, 28 Feb 2023 01:50:36 -0800 (PST) X-Google-Smtp-Source: AK7set9g00zFKON7d4LIGSPOkomUjiZhcqr1TN/kuauKzi0/CLy6GaCWl2ZjXqDNG7t/bfZQxUGhRw== X-Received: by 2002:a62:6456:0:b0:5a8:beb3:d55f with SMTP id y83-20020a626456000000b005a8beb3d55fmr1619471pfb.32.1677577835771; Tue, 28 Feb 2023 01:50:35 -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.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 01:50:35 -0800 (PST) From: Masahiro Yamada To: kernel-team@lists.ubuntu.com Subject: [RFC/upstream:linux 2/5] kbuild: snap-pkg: cut too long version property Date: Tue, 28 Feb 2023 18:49:46 +0900 Message-Id: <20230228094949.2660702-3-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" $(KERNELVERSION) can become longer than the 32-chars limit, then the following error occurs: Issues while validating snapcraft.yaml: The 'version' property does not match the required schema: '6.2.0-rc8-00151-g925cf0457d7e-dirty' is too long (maximum length is 32) Signed-off-by: Masahiro Yamada --- scripts/Makefile.package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 3058d0cdb578..037d42db0b55 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -138,7 +138,7 @@ snap-pkg: mkdir $(objtree)/snap $(MAKE) clean $(call cmd,src_tar,$(KERNELPATH)) - sed "s@KERNELRELEASE@$(KERNELRELEASE)@; \ + sed "s@KERNELRELEASE@$$(echo $(KERNELRELEASE) | cut -b -32)@; \ s@SRCTREE@$(shell realpath $(KERNELPATH).tar.gz)@" \ $(srctree)/scripts/package/snapcraft.template > \ $(objtree)/snap/snapcraft.yaml From patchwork Tue Feb 28 09:49:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1749384 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=cFEz7he5; 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 4PQt0d6BB8z1yWy for ; Tue, 28 Feb 2023 20:50:57 +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 1pWwdD-0002Br-JS; Tue, 28 Feb 2023 09:50:47 +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 1pWwd5-0001xQ-Hk for kernel-team@lists.ubuntu.com; Tue, 28 Feb 2023 09:50:39 +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 443443F11D for ; Tue, 28 Feb 2023 09:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1677577839; bh=ysU+wnSpYy0SViBx8ri7epgWTYBeyTsFCmCTgf7Dv4Q=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cFEz7he5FJH1992jQT+FxVyp/4hkAps+4R9oTdTHVwFCV8mcAwQYdPkPAkjEQu7IM +eaci1ENpHKi1ENURUYLwRw0ThSZ9eXgXXf9pZ8BR3SjmkNBUKjgfSvEFpvE2U9uU/ Ry0Jg6aoLe/3YCLmzgieRg8gltTwliAs1sugTtFDsYY824pBjm8NABES4pDeC7UTas XWWyD2D2hVqUEoOoM9fmY8OwJ6JNILagKWpShjvQNVqFgY8ndgdqUXHMRXzChP0pM7 Tl4B/JQnsiVCeVmp41a8ptnKLV0OThHbyJz4uSHzZHJdrsFAlRMWYvaTTlZyvvPlBi jee3Vg14iVq4Q== Received: by mail-pl1-f200.google.com with SMTP id iw4-20020a170903044400b0019ccafc1fbeso5040795plb.3 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=1677577837; 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=ysU+wnSpYy0SViBx8ri7epgWTYBeyTsFCmCTgf7Dv4Q=; b=y6ubLNi5pOYIVPkg7f1CEr5cHtzZmbyIWOJLi/sSQG184i5Qe1qro5/10fs6WhNr+E Pmf7rFKeOOocZZFPFNAunYvnMt/xLAdSFL+PC5k1hJ9HWfFjoogec9eqntLO/rsrLiEm ncDC7XJ1R8pUB3QsMJrvBNiIBrpefzCzLRc7m6VeyAq7TTCT3JX2bAb3g/4mC3karfc9 wYTpkj1eLMU1yk9yhxohwB28u7KlDd8pv8l4SdDXVgrfT+Ro/IK4MgNw1+njj4HIESC4 nVv/G2ffDwaYXZoeY1vYD7txXyQnJv/m/iodEtMjRxMdvxncjyOmkDpkcFZ0W749n7bF as7A== X-Gm-Message-State: AO0yUKXOjkVfTof1miP1JpRD8IgbawxAysRhzfh7oU1IWAzoAKxNvmAK ftrVP41RV7W2JOw2jTgLJIFA+M1Ix9tUYZFkgLOnogHs1LF/Bex4ObLbUs9yGHdnF4LdJh86ngE 9UZ0cbsQSxGDWIy3txU9yFXB2Dl14RAtEkb5GY0BQRN7YA/Q= X-Received: by 2002:aa7:960d:0:b0:5d4:e4c8:2ef5 with SMTP id q13-20020aa7960d000000b005d4e4c82ef5mr1946328pfg.33.1677577837317; Tue, 28 Feb 2023 01:50:37 -0800 (PST) X-Google-Smtp-Source: AK7set9MMHSrzdVw3Q52cCnW+KC7Wz2DBUva44RHqzLSb6d3k+VKTeXXc7alDc8VSg/uZ1ah9CKLXg== X-Received: by 2002:aa7:960d:0:b0:5d4:e4c8:2ef5 with SMTP id q13-20020aa7960d000000b005d4e4c82ef5mr1946316pfg.33.1677577836982; Tue, 28 Feb 2023 01:50:36 -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.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 01:50:36 -0800 (PST) From: Masahiro Yamada To: kernel-team@lists.ubuntu.com Subject: [RFC/upstream:linux 3/5] kbuild: snap-pkg: build in-place to achieve incremental builds Date: Tue, 28 Feb 2023 18:49:47 +0900 Message-Id: <20230228094949.2660702-4-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" Currently, the source tree is passed as a tarball, but it is very slow, and there is no reason to do so. Use the local source-type to skip the tarball creation. The kernel is built in snap/parts/kerenl/build, which does not reuse the objects in the tree. Make parts/kernel/build a symlink to the top of objtree. This is a trick to build in-place. There is no need to replicate the entire tree to parts/kernel/src since we build the kernel in-place. Just let it copy an empty directory. Signed-off-by: Masahiro Yamada --- scripts/Makefile.package | 6 ++---- scripts/package/snapcraft.template | 11 +++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index 037d42db0b55..0b99e4aaead1 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -136,12 +136,10 @@ PHONY += snap-pkg snap-pkg: rm -rf $(objtree)/snap mkdir $(objtree)/snap - $(MAKE) clean - $(call cmd,src_tar,$(KERNELPATH)) - sed "s@KERNELRELEASE@$$(echo $(KERNELRELEASE) | cut -b -32)@; \ - s@SRCTREE@$(shell realpath $(KERNELPATH).tar.gz)@" \ + 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) diff --git a/scripts/package/snapcraft.template b/scripts/package/snapcraft.template index 9835bf4c3194..fd91ac9c2ca3 100644 --- a/scripts/package/snapcraft.template +++ b/scripts/package/snapcraft.template @@ -10,6 +10,13 @@ build-base: core18 parts: kernel: plugin: kernel - source: SRCTREE - source-type: tar + source: dummy + source-type: local kernel-with-firmware: false + override-build: | + # build in-place + cd .. + rm -rf build + ln -s ../../.. build + cd build + snapcraftctl build 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 # --------------------------------------------------------------------------- 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 ..