* [PATCH 1/4] Makefile: add kernelarch rule that prints the kernel architecture and localversion
2019-02-07 16:40 RFC: refactoring the deb build Enrico Weigelt, metux IT consult
@ 2019-02-07 16:40 ` Enrico Weigelt, metux IT consult
2019-02-07 16:40 ` [PATCH 2/4] scripts: mkdebian: allow renaming generated debian/rules Enrico Weigelt, metux IT consult
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-02-07 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-kbuild, kernel-janitors, yamada.masahiro, michal.lkml
trivial rule to print out the kernel arch and localversion, so external tools,
like distro packagers, can easily get it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
Makefile | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Makefile b/Makefile
index 3142e67..2719907 100644
--- a/Makefile
+++ b/Makefile
@@ -1664,6 +1664,12 @@ kernelrelease:
kernelversion:
@echo $(KERNELVERSION)
+kernellocalversion:
+ @$(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree) | sed -e 's~^\-~~'
+
+kernelarch:
+ @echo $(ARCH)
+
image_name:
@echo $(KBUILD_IMAGE)
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/4] scripts: mkdebian: allow renaming generated debian/rules
2019-02-07 16:40 RFC: refactoring the deb build Enrico Weigelt, metux IT consult
2019-02-07 16:40 ` [PATCH 1/4] Makefile: add kernelarch rule that prints the kernel architecture and localversion Enrico Weigelt, metux IT consult
@ 2019-02-07 16:40 ` Enrico Weigelt, metux IT consult
2019-02-07 16:40 ` [PATCH 3/4] scripts: mkdebian: fix dependencies Enrico Weigelt, metux IT consult
2019-02-07 16:40 ` [PATCH 4/4] debian: add generic rule file Enrico Weigelt, metux IT consult
3 siblings, 0 replies; 5+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-02-07 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-kbuild, kernel-janitors, yamada.masahiro, michal.lkml
Add new environment variable KDEB_RULES for controlling where the
generated debian rules are written to. By defaults, it's debian/rules,
but packagers might override it for providing their own rules file.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
scripts/package/mkdebian | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index edcad61..ff226be 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -99,6 +99,9 @@ kernel_headers_packagename=linux-headers-$version
dbg_packagename=$packagename-dbg
debarch=
set_debarch
+if [ -z "$KDEB_RULES" ]; then
+ KDEB_RULES=debian/rules
+fi
if [ "$ARCH" = "um" ] ; then
packagename=user-mode-linux-$version
@@ -202,7 +205,7 @@ Description: Linux kernel debugging symbols for $version
all the necessary debug symbols for the kernel and its modules.
EOF
-cat <<EOF > debian/rules
+cat <<EOF > $KDEB_RULES
#!$(command -v $MAKE) -f
build:
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/4] scripts: mkdebian: fix dependencies
2019-02-07 16:40 RFC: refactoring the deb build Enrico Weigelt, metux IT consult
2019-02-07 16:40 ` [PATCH 1/4] Makefile: add kernelarch rule that prints the kernel architecture and localversion Enrico Weigelt, metux IT consult
2019-02-07 16:40 ` [PATCH 2/4] scripts: mkdebian: allow renaming generated debian/rules Enrico Weigelt, metux IT consult
@ 2019-02-07 16:40 ` Enrico Weigelt, metux IT consult
2019-02-07 16:40 ` [PATCH 4/4] debian: add generic rule file Enrico Weigelt, metux IT consult
3 siblings, 0 replies; 5+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-02-07 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-kbuild, kernel-janitors, yamada.masahiro, michal.lkml
We missed some build dependencies in the generated debian/control file.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
scripts/package/mkdebian | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index ff226be..1caaf0b 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -173,7 +173,7 @@ Source: $sourcename
Section: kernel
Priority: optional
Maintainer: $maintainer
-Build-Depends: bc, kmod, cpio
+Build-Depends: bc, kmod, cpio, bison, libelf-dev, libssl-dev, flex
Homepage: http://www.kernel.org/
Package: $packagename
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 4/4] debian: add generic rule file
2019-02-07 16:40 RFC: refactoring the deb build Enrico Weigelt, metux IT consult
` (2 preceding siblings ...)
2019-02-07 16:40 ` [PATCH 3/4] scripts: mkdebian: fix dependencies Enrico Weigelt, metux IT consult
@ 2019-02-07 16:40 ` Enrico Weigelt, metux IT consult
3 siblings, 0 replies; 5+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-02-07 16:40 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-kbuild, kernel-janitors, yamada.masahiro, michal.lkml
Adding a generic debian rule file, so we can build the directly
via usual Debian package build tools (eg. git-buildpackage,
dck-buildpackage, etc). It expects the .config file already
placed in the source tree.
The rule file contains a rule for creating debian/control and
other metadata - this is done similar to the 'deb-pkg' make rule,
scripts/packaging/mkdebian.
---
.gitignore | 1 +
debian/rules | 26 ++++++++++++++++++++++++++
2 files changed, 27 insertions(+)
create mode 100755 debian/rules
diff --git a/.gitignore b/.gitignore
index a20ac26..2d8081f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,6 +68,7 @@ modules.builtin
# Debian directory (make deb-pkg)
#
/debian/
+!/debian/rules
#
# Snap directory (make snap-pkg)
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..eeb58f7
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,26 @@
+#!/usr/bin/make -f
+
+export MAKE
+export KERNELARCH = $(shell $(MAKE) kernelarch)
+export KERNELRELEASE = $(shell $(MAKE) kernelrelease)
+export KBUILD_DEBARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
+export KBUILD_BUILD_VERSION = $(shell $(MAKE) kernellocalversion)
+export KDEB_RULES = debian/rules.auto
+export KDEB_SOURCENAME = linux-source
+export ARCH = $(KERNELARCH)
+
+debian/control debian/changelong debian/arch debian/copyright:
+debian/control:
+ ./scripts/package/mkdebian
+
+build: debian/control
+ $(MAKE) KERNELRELEASE=$(KERNELRELEASE) ARCH=$(KERNELARCH) KBUILD_BUILD_VERSION=$(KBUILD_BUILD_VERSION) KBUILD_SRC=
+
+binary-arch: debian/control
+ $(MAKE) KERNELRELEASE=$(KERNELRELEASE) ARCH=$(KERNELARCH) KBUILD_BUILD_VERSION=$(KBUILD_BUILD_VERSION) KBUILD_SRC= intdeb-pkg
+
+clean:
+ rm -rf debian/*tmp debian/files debian/changelog debian/control debian/copyright debian/rules.auto debian/arch
+ $(MAKE) clean
+
+binary: binary-arch
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread