diff mbox series

[RFC/upstream:linux,2/5] kbuild: snap-pkg: cut too long version property

Message ID 20230228094949.2660702-3-masahiro.yamada@canonical.com
State New
Headers show
Series kbuild: snap-pkg: make 'make snap-pkg' comple on Ubuntu 20.04 | expand

Commit Message

Masahiro Yamada Feb. 28, 2023, 9:49 a.m. UTC
$(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 <masahiro.yamada@canonical.com>
---
 scripts/Makefile.package | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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