Use in-kernel debian package target

This commit is contained in:
Maximilian Luz 2020-01-19 23:57:45 +01:00
parent 46266d8a39
commit b6a8f377c4
No known key found for this signature in database
GPG key ID: 70EC0937F6C26F02
4 changed files with 10547 additions and 30 deletions

View file

@ -2,6 +2,7 @@ on:
push:
branches:
- feature/pkg
- feature/pkg-deb
# tags:
# - 'test'
# - 'v*+'
@ -81,48 +82,47 @@ jobs:
apt-get -y install build-essential fakeroot rsync git wget python3-debian dpkg-sig
apt-get -y build-dep linux
- name: Build
- name: Fetch kernel source
env:
KERNEL_VERSION: 5.4.12
# sid:5.4.12
COMMIT: 003b2879ed30cb75647fd54153acc8e03838cdf9
KERNEL_VERSION: 5.4.13
run: |
cd pkg/debian
export FLAVOR=amd64_none_amd64
export LOCALVERSION="-surface"
pushd pkg/debian
# download sources
wget https://cdn.kernel.org/pub/linux/kernel/v${KERNEL_VERSION%%.*}.x/linux-$KERNEL_VERSION.tar.xz
wget https://salsa.debian.org/kernel-team/linux/-/archive/$COMMIT/linux-$COMMIT.tar
tar xf linux-$COMMIT.tar
mv linux-$COMMIT linux
tar xf linux-$KERNEL_VERSION.tar.xz
mv linux-$KERNEL_VERSION linux
cd linux
popd
# disable debug-info because we don't want a 800MB image
sed --in-place 's/debug-info: true/debug-info: false/' debian/config/defines
sed --in-place 's/debug-info: true/debug-info: false/' debian/config/amd64/defines
- name: Apply patches
run: |
pushd pkg/debian/linux
# apply debian patches
debian/bin/genorig.py ../linux-$KERNEL_VERSION.tar.xz
debian/rules orig
# apply build patches
for PATCH in ./*.patch; do patch -p1 < ${PATCH}; done
# because debian knows better and intentionally raises an error, we
# have to bypass it. *sigh*
debian/rules debian/control || true
# apply patches
# apply surface patches
for PATCH in ../../../patches/${KERNEL_VERSION%.*}/*.patch; do patch -p1 < ${PATCH}; done
# run the setup to generate the base config
fakeroot make -f debian/rules.gen setup_$FLAVOR
popd
# merge configs
./scripts/kconfig/merge_config.sh -O debian/build/build_$FLAVOR -m debian/build/build_$FLAVOR/.config ../surface.config
- name: Configure
run: |
pushd pkg/debian/linux
# build!
fakeroot make -f debian/rules.gen binary-arch_$FLAVOR -j2
# copy config
cp ../debian.config .config
# update config
make olddefconfig
popd
- name: Build
run: |
export LOCALVERSION="-surface"
make bindeb-pkg -j2
- name: Prepare release
run: |

View file

@ -0,0 +1,69 @@
From 95afee22fd12b5d38d7f575941909c108a6f3156 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sun, 19 Jan 2020 22:50:24 +0100
Subject: [PATCH] Version changes for linux-surface debian package
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
---
scripts/package/builddeb | 7 ++++---
scripts/package/mkdebian | 8 +++++---
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index c4c580f547ef..7cf52de71cf9 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -47,13 +47,14 @@ create_package() {
}
version=$KERNELRELEASE
+featureset=$(echo "$version" | sed -E 's/[0-9]+\.[0-9]+\.[0-9]+-(.*)/\1/')
tmpdir="$objtree/debian/tmp"
kernel_headers_dir="$objtree/debian/hdrtmp"
libc_headers_dir="$objtree/debian/headertmp"
dbg_dir="$objtree/debian/dbgtmp"
-packagename=linux-image-$version
-kernel_headers_packagename=linux-headers-$version
-libc_headers_packagename=linux-libc-dev
+packagename=linux-image-$featureset
+kernel_headers_packagename=linux-headers-$featureset
+libc_headers_packagename=linux-libc-dev-$featureset
dbg_packagename=$packagename-dbg
if [ "$ARCH" = "um" ] ; then
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index e0750b70453f..7978f62cbcde 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -86,6 +86,7 @@ set_debarch() {
# Some variables and settings used throughout the script
version=$KERNELRELEASE
+featureset=$(echo "$version" | sed -E 's/[0-9]+\.[0-9]+\.[0-9]+-(.*)/\1/')
if [ -n "$KDEB_PKGVERSION" ]; then
packageversion=$KDEB_PKGVERSION
revision=${packageversion##*-}
@@ -94,8 +95,9 @@ else
packageversion=$version-$revision
fi
sourcename=$KDEB_SOURCENAME
-packagename=linux-image-$version
-kernel_headers_packagename=linux-headers-$version
+packagename=linux-image-$featureset
+kernel_headers_packagename=linux-headers-$featureset
+libc_headers_packagename=linux-libc-dev-$featureset
dbg_packagename=$packagename-dbg
debarch=
set_debarch
@@ -190,7 +192,7 @@ Description: Linux kernel headers for $version on $debarch
.
This is useful for people who need to build external modules
-Package: linux-libc-dev
+Package: $libc_headers_packagename
Section: devel
Provides: linux-kernel-headers
Architecture: $debarch
--
2.25.0

10449
pkg/debian/debian.config Normal file

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
../../surface.config