Received: by 10.223.164.202 with SMTP id h10csp1459898wrb; Mon, 27 Nov 2017 03:09:49 -0800 (PST) X-Google-Smtp-Source: AGs4zMY5I8larfXOHlu4DAWOMTtkS1Kzz7VtGZawH0My8sogFrhTr/oLSn1CKLBxpA4DPiQqdsOo X-Received: by 10.98.72.69 with SMTP id v66mr22274884pfa.135.1511780989716; Mon, 27 Nov 2017 03:09:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511780989; cv=none; d=google.com; s=arc-20160816; b=D2CmwPwwC70wnc+Qj7MKVTEfJnL8+gUFGS4d7SXiqO6YhJJM1C6pQDf0qxy0PnYj// RzVfRwKeRQMOrdKFxmvBy/rRdwgqSOLXl4SxfFBTlUOerpd5zc07AKnO9ZMFKvlA4A6I oBs6R6+3sHdIcIoainFZfLAznKhOZm5YYqA6/xUGmjg6mHmag/r6Givx7k6M6WHgdj9F cMama3l+ziA8Qs+PisuhGZ8Zxf14LMC5IEsFROPE43ksYbadINzRu09s4LvpL3YwfIZX Vn7O8rF0oBzu1OhM4dWR9ib59kFAB2aS2bhNbSzDMwabluc2C+XRGUFiOpvXEw3In/gI IYsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:arc-authentication-results; bh=midEUPH4eMuUXdqKCigtQEwby4Z4CnVj2AQ0CNxaOoo=; b=zNuVRDqcH4crXiKJkNihELMnQeIjlMjZ15IRBRH7DksrRKHZ1s0mK1LyWxn2jDmzCV QMFSzdW+cqZ06W3AF0/OWlNyGjO0AFxYN56qQvArQa2nYwDNkwdTw/h6hPan3zxmyWa3 +zzuimVE3Lbk/neRRm5ACFnaHSmRt4SosMFOxnMPXw3rCteg2CE1NBsisEZtRmUM3iET ABgVIMx9RL4t9+fFR6cbrZEfKLlT7N5goGNq2RUmKgeYlG/bjg9/nBUBYdZuJ6VKpqug JuAuFODvrvH64Atq/s7NFJIrO2wxhDnvgH4yzUNJH6DFl2+1OxQtLZXH+F8tyHTSS8DK txzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o72si18366363pfa.375.2017.11.27.03.09.38; Mon, 27 Nov 2017 03:09:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751670AbdK0LHl (ORCPT + 78 others); Mon, 27 Nov 2017 06:07:41 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:57119 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbdK0LHk (ORCPT ); Mon, 27 Nov 2017 06:07:40 -0500 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 1eJHGB-0007DG-3n; Mon, 27 Nov 2017 11:07:35 +0000 From: Paolo Pisati To: Masahiro Yamada , Michal Marek , Behan Webster , Matthias Kaehlcke , =?UTF-8?q?Vin=C3=ADcius=20Tinti?= , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] scripts/package: snap-pkg target Date: Mon, 27 Nov 2017 12:07:34 +0100 Message-Id: <1511780854-7213-1-git-send-email-paolo.pisati@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20171114123834.xsjiy2ynvott4gae@brain> References: <20171114123834.xsjiy2ynvott4gae@brain> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Following in footsteps of other targets like 'deb-pkg, 'rpm-pkg' and 'tar-pkg', this patch adds a 'snap-pkg' target for the creation of a Linux kernel snap package using the kbuild infrastructure. A snap, in its general form, is a self contained, sandboxed, universal package and it is intended to work across multiple distributions and/or devices. A snap package is distributed as a single compressed squashfs filesystem. A kernel snap is a snap package carrying the Linux kernel, kernel modules, accessory files (DTBs, System.map, etc) and a manifesto file. The purpose of a kernel snap is to carry the Linux kernel during the creation of a system image, eg. Ubuntu Core, and its subsequent upgrades. For more information on snap packages: https://snapcraft.io/docs/ Signed-off-by: Paolo Pisati --- Changes since v2: - use a tarball to instead of cloning the src tree via git - set 'kernel-with-firmware: false' to accomodate for 'firmware_install' removal Changes since v1: - slightly improve the messaging --- .gitignore | 5 +++++ scripts/package/Makefile | 16 ++++++++++++++++ scripts/package/snapcraft.template | 14 ++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 scripts/package/snapcraft.template diff --git a/.gitignore b/.gitignore index f6050b8..705e099 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,11 @@ modules.builtin /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 9ed96aef..5996300 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -95,6 +95,21 @@ bindeb-pkg: FORCE clean-dirs += $(objtree)/debian/ +# snap-pkg +# --------------------------------------------------------------------------- +snap-pkg: FORCE + rm -rf $(objtree)/snap + mkdir $(objtree)/snap + $(MAKE) clean + $(call cmd,src_tar,$(KERNELPATH)) + sed "s@KERNELRELEASE@$(KERNELRELEASE)@; \ + s@SRCTREE@$(shell realpath $(KERNELPATH).tar.gz)@" \ + $(srctree)/scripts/package/snapcraft.template > \ + $(objtree)/snap/snapcraft.yaml + cd $(objtree)/snap && \ + snapcraft --target-arch=$(UTS_MACHINE) + +clean-dirs += $(objtree)/snap/ # tarball targets # --------------------------------------------------------------------------- @@ -139,6 +154,7 @@ help: FORCE @echo ' binrpm-pkg - Build only the binary kernel RPM package' @echo ' deb-pkg - Build both source and binary deb kernel packages' @echo ' bindeb-pkg - Build only the binary kernel deb package' + @echo ' snap-pkg - Build only the binary kernel snap package (will connect to external hosts)' @echo ' tar-pkg - Build the kernel as an uncompressed tarball' @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' diff --git a/scripts/package/snapcraft.template b/scripts/package/snapcraft.template new file mode 100644 index 0000000..626d278e --- /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: tar + kernel-with-firmware: false -- 2.7.4 From 1585216858192008112@xxx Mon Nov 27 11:03:23 +0000 2017 X-GM-THRID: 1578328285370326982 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread