From patchwork Tue Jun 27 11:13:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 781164 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3wxjvv0nZvz9s75; Tue, 27 Jun 2017 21:13:15 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1dPoQi-00068d-Et; Tue, 27 Jun 2017 11:13:12 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1dPoQc-00067N-D1 for kernel-team@lists.ubuntu.com; Tue, 27 Jun 2017 11:13:06 +0000 Received: from 1.general.ppisati.uk.vpn ([10.172.193.134] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1dPoQc-0003ez-3V for kernel-team@lists.ubuntu.com; Tue, 27 Jun 2017 11:13:06 +0000 From: Paolo Pisati To: kernel-team@lists.ubuntu.com Subject: [PATCH] make snap-pkg support Date: Tue, 27 Jun 2017 13:13:05 +0200 Message-Id: <1498561985-10413-2-git-send-email-paolo.pisati@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498561985-10413-1-git-send-email-paolo.pisati@canonical.com> References: <1498561985-10413-1-git-send-email-paolo.pisati@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com BugLink: http://bugs.launchpad.net/bugs/1700747 This patch integrates snapcraft in the kbuild environment of the Linux kernel. To use it: make defconfig make snap-pkg or in case of cross-compilation (e.g. arm): export ARCH=arm; export CROSS_COMPILE=arm-linux-gnueabihf- make defconfig make snap-pkg The resulting kernel snap will be generated in $(objtree)/snap Signed-off-by: Paolo Pisati Acked-by: Stefan Bader Acked-by: Thadeu Lima de Souza Cascardo --- .gitignore | 5 +++++ scripts/package/Makefile | 13 +++++++++++++ scripts/package/snapcraft.template | 14 ++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 scripts/package/snapcraft.template diff --git a/.gitignore b/.gitignore index e78c8c2..efdd5ab 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,11 @@ Module.symvers #/debian/ # +# Snap directory (make snap-pkg) +# +/snap/ + +# # tar directory (make tar*-pkg) # /tar-install/ diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 493e226..3b08e1b 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -99,6 +99,19 @@ bindeb-pkg: FORCE clean-dirs += $(objtree)/debian/ +# snap-pkg +# --------------------------------------------------------------------------- +snap-pkg: FORCE + rm -rf $(objtree)/snap + mkdir $(objtree)/snap + sed "s@KERNELRELEASE@$(KERNELRELEASE)@; \ + s@SRCTREE@$(shell realpath $(srctree))@" \ + $(srctree)/scripts/package/snapcraft.template > \ + $(objtree)/snap/snapcraft.yaml + cd $(objtree)/snap && \ + snapcraft --target-arch=$(UTS_MACHINE) + +clean-dirs += $(objtree)/snap/ # tarball targets # --------------------------------------------------------------------------- diff --git a/scripts/package/snapcraft.template b/scripts/package/snapcraft.template new file mode 100644 index 0000000..2e7ffc8 --- /dev/null +++ b/scripts/package/snapcraft.template @@ -0,0 +1,14 @@ +name: kernel +version: KERNELRELEASE +summary: Linux kernel +description: The upstream Linux kernel +grade: stable +confinement: strict +type: kernel + +parts: + kernel: + plugin: kernel + source: SRCTREE + source-type: git + kconfigfile: SRCTREE/.config