Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scripts/package: snap-pkg target

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 <paolo.pisati@canonical.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

authored by

Paolo Pisati and committed by
Masahiro Yamada
5704d455 ae64f9bd

+35
+5
.gitignore
··· 66 66 /debian/ 67 67 68 68 # 69 + # Snap directory (make snap-pkg) 70 + # 71 + /snap/ 72 + 73 + # 69 74 # tar directory (make tar*-pkg) 70 75 # 71 76 /tar-install/
+16
scripts/package/Makefile
··· 94 94 95 95 clean-dirs += $(objtree)/debian/ 96 96 97 + # snap-pkg 98 + # --------------------------------------------------------------------------- 99 + snap-pkg: FORCE 100 + rm -rf $(objtree)/snap 101 + mkdir $(objtree)/snap 102 + $(MAKE) clean 103 + $(call cmd,src_tar,$(KERNELPATH)) 104 + sed "s@KERNELRELEASE@$(KERNELRELEASE)@; \ 105 + s@SRCTREE@$(shell realpath $(KERNELPATH).tar.gz)@" \ 106 + $(srctree)/scripts/package/snapcraft.template > \ 107 + $(objtree)/snap/snapcraft.yaml 108 + cd $(objtree)/snap && \ 109 + snapcraft --target-arch=$(UTS_MACHINE) 110 + 111 + clean-dirs += $(objtree)/snap/ 97 112 98 113 # tarball targets 99 114 # --------------------------------------------------------------------------- ··· 153 138 @echo ' binrpm-pkg - Build only the binary kernel RPM package' 154 139 @echo ' deb-pkg - Build both source and binary deb kernel packages' 155 140 @echo ' bindeb-pkg - Build only the binary kernel deb package' 141 + @echo ' snap-pkg - Build only the binary kernel snap package (will connect to external hosts)' 156 142 @echo ' tar-pkg - Build the kernel as an uncompressed tarball' 157 143 @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' 158 144 @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'
+14
scripts/package/snapcraft.template
··· 1 + name: kernel 2 + version: KERNELRELEASE 3 + summary: Linux kernel 4 + description: The upstream Linux kernel 5 + grade: stable 6 + confinement: strict 7 + type: kernel 8 + 9 + parts: 10 + kernel: 11 + plugin: kernel 12 + source: SRCTREE 13 + source-type: tar 14 + kernel-with-firmware: false