summaryrefslogtreecommitdiffstats
path: root/scripts/package/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/package/Makefile')
-rw-r--r--scripts/package/Makefile26
1 files changed, 23 insertions, 3 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index c23534925b38..9fbcf5ed0ca7 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -32,10 +32,14 @@ MKSPEC := $(srctree)/scripts/package/mkspec
quiet_cmd_src_tar = TAR $(2).tar.gz
cmd_src_tar = \
+set -e; \
if test "$(objtree)" != "$(srctree)"; then \
- echo "Building source tarball is not possible outside the"; \
- echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
- echo "binrpm-pkg or bindeb-pkg target instead."; \
+ echo >&2; \
+ echo >&2 " ERROR:"; \
+ echo >&2 " Building source tarball is not possible outside the"; \
+ echo >&2 " kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
+ echo >&2 " binrpm-pkg or bindeb-pkg target instead."; \
+ echo >&2; \
false; \
fi ; \
$(srctree)/scripts/setlocalversion --save-scmversion; \
@@ -94,6 +98,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
# ---------------------------------------------------------------------------
@@ -138,6 +157,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'