Commit daa35046 authored by Martin Kepplinger's avatar Martin Kepplinger
Browse files

Merge branch '5.13.1/librem5_deb' into 5.13.1/librem5__integration_byzantium

parents c0ac6ae6 682cb68a
......@@ -75,7 +75,8 @@ modules.order
#
# Debian directory (make deb-pkg)
#
/debian/
/debian/*tmp/
/debian/files
#
# Snap directory (make snap-pkg)
......
......@@ -3,11 +3,14 @@ variables:
DEPS: >
build-essential gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf make device-tree-compiler
bison flex bc libssl-dev
WORKING_DIR: $CI_PROJECT_DIR/debian/output
before_script:
- echo "man-db man-db/auto-update boolean false" | debconf-set-selections
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install $DEPS
- apt-get -y build-dep .
- apt-get -y install build-essential devscripts
.tags: &tags
tags:
......@@ -30,13 +33,20 @@ build:aarch64:
- modules/
expire_in: 1 week
build:armhf:
<<: *tags
build:deb:
tags:
- librem5:arm64
stage: build
variables:
CROSS_BUILD: "ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-"
script:
- make ${CROSS_BUILD} nitrogen6x-max_defconfig
- make -j 4 ${CROSS_BUILD} Image dtbs modules
- make -j 4 ${CROSS_BUILD} INSTALL_MOD_PATH=modules/ modules_install
- git clean -dfx
- git checkout -f
- rm -f ../* || true
- rm -rf "${WORKING_DIR}"; mkdir -p "${WORKING_DIR}"
- debian/rules debian/control
- dch -l +gitlabci "Gitlab ci build of ${CI_COMMIT_SHA}"
- dpkg-buildpackage -j4 -uc -us -B --host-arch=arm64
- cp -l ../*.deb ../*.changes ../*.buildinfo "${WORKING_DIR}/"
artifacts:
paths:
- "${WORKING_DIR}"
expire_in: 1 week
This should help getting started with working on the Purism downstream
kernel tree currently running by default on the Librem 5 devkit and phones.
Imagine this kernel tree to be a downstream "development tree" for inclusion
into the mainline Linux kernel. Ideally, the patchset it consists of
will shrink over time and (other than minor things like Debian packaging)
will go away at some point.
We build only one kernel image that runs on the devkit and all revisions
of the phone. Hardware differences are taken into account by using
the correct devicetree binary (dtb). All needed ones are being built.
Downloading the sources
-----------------------
Our kernel tree is hosted at https://source.puri.sm/Librem5/linux-next
where you can clone it from. The default branch is called
'pureos/amber-phone'.
How to build the kernel
-----------------------
This package is maintained with git-buildpackage(1).
It is recommended to build the package with pbuilder using:
gbp builpackage --git-pbuilder
or
dpkg-buildpackage -uc -us -B --host-arch=arm64
For information on how to set up a pbuilder environment see the
git-pbuilder(1) manpage.
- To build a kernel without the meta package use the package
name 'linux-next-librem5' in *debian/changelog*
- To build the kernel meta package switch the source
package name in *debian/changelog* to 'linux-librem5'.
then run 'debian/rules debian/control' and commit the result.
- To switch the kernel/ABI version change 'KREL' in
*debian/rules* then run 'debian/rules debian/control'
and commit the result.
- To create tags use 'gbp tag'. Read on for how this is used in order
to create the kernel releases for the PureOS archives.
How to install
--------------
dpkg -i linux-image...
How to report bugs
------------------
Please search https://source.puri.sm/Librem5/linux-next/-/issues for an
issue that describes your problem and create a new one if it doesn't
exist.
How to submit patches
---------------------
Ideally, fork the kernel tree on Gitlab, work on a branch, push it to
your forked kernel tree and create a Merge Request on Gitlab against the
default branch. Changes are then being discussed and reviewed. If you
can't for some reason do it this way, you are free to send patches to
kernel@puri.sm via email too. Similar rules like upstream apply, see
https://www.kernel.org/doc/html/latest/process/submitting-patches.html
Also, kernel coding standards (checkpatch.pl, ...) apply and it is desired
to actually submit patches upstream too.
Release process
---------------
Changes that are merged into the default branch 'pureos/amber-phone'
in general can be released (=tagged) at any point in time. In this case a
new version of the 'linux-librem5' package gets created. In case no ABI change
is to be expected (the usual case), only the versions' last digit
is being incremented.
The changelog is generated using "gbp dch" so if you submit any
changes don't bother to add changelog entries but rather provide
a nice git commit message that can then end up in the changelog.
gbp dch --git-log=--ancestry-path --since=<latest existing tag name>
--ignore-branch --multimaint-merge --id-length=7
If an upstream stable kernel release has been merged too, use the
upstream version first though, and use '1' as the last digit again,
see below.
Versioning
----------
The kernel image's Debian package name contains a version in order to be
able to create an entirely new package when the ABI to userspace
changes (should be avoided though) or we update to a new major version
of the kernel, see below. That number (name) is defined in debian/rules, for
example 'KREL=5.11.0-1-librem5'. After changing this, regenerate
debian/control too by running 'debian/rules debian/control'.
The actual version of that Debian package is defined in debian/changelog.
First, use the upstream version that the tree is based on, for example
'5.11.0~rc4pureos0' for a tree based on v5.11-rc4 or
'5.11.3pureos0' for a tree based on v5.11.3. When doing a release
that doesn't include an update from upstream, then just increment the last
digit: '5.11.3pureos1'.
Update process
--------------
Since the goal is to have the needed changes in the mainline kernel tree,
we need to update the downstream changes to the latest upstream tree
regularly. stable tags from upstream
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
can be merged through a Merge Request as usual. For updating to a
new major version tagged at
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
things are currently a bit more complicated:
In an ideal world, an update from one Linux major version to the next
would similarly be a merge and some semi-automated testing of all needed
functionality. The world is not ideal yet though, so when a new
major kernel version is tagged upstream (usually an "rc" tag already)
we rebase our changes onto it, test as much as we reasonably can
(see below) and tag a release of the 'linux-next-librem5' Debian package
for wider testing. That new tree is being prepared (and rebased) on the
'next/amber-phone' branch. It should have the same functionality
as the default 'pureos/amber-phone' branch, only rebased
(and cleaned up) onto a newer mainline release.
Testing
-------
Automated tests are collected in the 'pytests' directory of the
https://source.puri.sm/Librem5/librem5-devkit-tools repository. Install
, 'sudo apt -y install librem5-check' and run them: 'sudo librem5-check'.
If you can reproduce a bugfix or test a driver functionality without user
interaction, please add a test to that repository.
TODO properly collect some interactive tests:
* phone calls
* sms
* usb-dp
* charging
* wifi
* bt
* sd-card PM
* gpu/cpu PM
PureOS distributions
--------------------
This kernel is released to the amber-phone PureOS distribution (based on
Debian buster) and to the byzantium PureOS distribution (based on bullseye).
As suggested by the default branch, changes are usually merged into
pureos/amber-phone first. There is also the pureos/byzantium branch that
can contain changes that depend on having the newer userspace environment.
Other than that, the kernels are the same but the respective branches
are of course used to release to the distributions.
For amber-phone, append "~amberN" to the version number.
This diff is collapsed.
Source: linux-next-librem5
Section: kernel
Priority: optional
Maintainer: Purism Kernel Team <kernel@puri.sm>
Uploaders:
Angus Ainslie (Purism) <angus@akkea.ca>,
Guido Günther <agx@sigxcpu.org>,
Martin Kepplinger <martin.kepplinger@puri.sm>,
Build-Depends:
bc,
bison,
cpio,
debhelper-compat (=12),
flex | flex:native,
gcc-aarch64-linux-gnu,
kmod,
libssl-dev:native,
rsync,
Standards-Version: 4.4.0
Homepage: https://source.puri.sm/Librem5/linux-next
Vcs-Git: https://source.puri.sm/Librem5/linux-next.git
Vcs-Browser: https://source.puri.sm/Librem5/linux-next
Package: linux-image-5.12.0-1-librem5
Architecture: arm64
Depends:
flash-kernel,
initramfs-tools,
kmod,
linux-base,
Breaks:
gstreamer1.0-plugins-bad (<< 1.18.4-3pureos1),
librem5-devkit-base (<< 0.0.10),
librem5-base-defaults (<< 36pureos1),
Description: Linux 5.12 for the Librem 5 and its devkit
The linux kernel, modules and corresponding other files for the Librem 5 and
the Librem 5 devkit.
Package: linux-headers-5.12.0-1-librem5
Architecture: arm64
Description: Linux kernel headers for librem5 on arm64
This package provides kernel header files for the Librem5 kernel.
.
This is useful for people who need to build external modules
Package: linux-libc-dev
Section: devel
Provides: linux-kernel-headers
Architecture: arm64
Description: Linux support headers for userspace development
This package provides userspaces headers from the Linux kernel. These headers
are used by the installed headers for GNU glibc and other system libraries.
Multi-Arch: same
Package: linux-image-5.12.0-1-librem5-dbg
Section: debug
Architecture: arm64
Description: Linux kernel debugging symbols for librem5
This package will come in handy if you need to debug the kernel. It provides
all the necessary debug symbols for the kernel and its modules.
Package: linux-image-librem5
Architecture: arm64
Section: kernel
Provides: wireguard-modules (= 1.0.0)
Depends:
linux-image-5.12.0-1-librem5 (>= ${binary:Version}),
Description: Linux kernel for the Librem 5 and its devkit
This packages sole purpose is to depend on the latest Linux kernel and modules
for use on the Librem5 and the Librem5 devkit.
Source: %DEB_SOURCE%
Section: kernel
Priority: optional
Maintainer: Purism Kernel Team <kernel@puri.sm>
Uploaders:
Angus Ainslie (Purism) <angus@akkea.ca>,
Guido Günther <agx@sigxcpu.org>,
Martin Kepplinger <martin.kepplinger@puri.sm>,
Build-Depends:
bc,
bison,
cpio,
debhelper-compat (=12),
flex | flex:native,
gcc-aarch64-linux-gnu,
kmod,
libssl-dev:native,
rsync,
Standards-Version: 4.4.0
Homepage: https://source.puri.sm/Librem5/linux-next
Vcs-Git: https://source.puri.sm/Librem5/linux-next.git
Vcs-Browser: https://source.puri.sm/Librem5/linux-next
Package: linux-image-%KREL%
Architecture: arm64
Depends:
flash-kernel,
initramfs-tools,
kmod,
linux-base,
Breaks:
gstreamer1.0-plugins-bad (<< 1.18.4-3pureos1),
librem5-devkit-base (<< 0.0.10),
librem5-base-defaults (<< 36pureos1),
Description: Linux %KREL_MAJOR% for the Librem 5 and its devkit
The linux kernel, modules and corresponding other files for the Librem 5 and
the Librem 5 devkit.
Package: linux-headers-%KREL%
Architecture: arm64
Description: Linux kernel headers for librem5 on arm64
This package provides kernel header files for the Librem5 kernel.
.
This is useful for people who need to build external modules
Package: linux-libc-dev
Section: devel
Provides: linux-kernel-headers
Architecture: arm64
Description: Linux support headers for userspace development
This package provides userspaces headers from the Linux kernel. These headers
are used by the installed headers for GNU glibc and other system libraries.
Multi-Arch: same
Package: linux-image-%KREL%-dbg
Section: debug
Architecture: arm64
Description: Linux kernel debugging symbols for librem5
This package will come in handy if you need to debug the kernel. It provides
all the necessary debug symbols for the kernel and its modules.
Package: linux-image-librem5
Architecture: arm64
Section: kernel
Provides: wireguard-modules (= 1.0.0)
Depends:
linux-image-%KREL% (>= ${binary:Version}),
Description: Linux kernel for the Librem 5 and its devkit
This packages sole purpose is to depend on the latest Linux kernel and modules
for use on the Librem5 and the Librem5 devkit.
This is a packacked upstream version of the Linux kernel.
The sources may be found at most Linux archive sites, including:
https://www.kernel.org/pub/linux/kernel
Copyright: 1991 - 2018 Linus Torvalds and others.
The git repository for Librem 5 kernel development is at:
https://source.puri.sm/Librem5/linux-next
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.
On Debian GNU/Linux systems, the complete text of the GNU General Public
License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
[DEFAULT]
debian-branch = imx8-current-librem5
debian-tag = pureos/%(version)s
debian-tag-msg = %(pkg)s v%(version)s
[dch]
multimaint-merge = True
[tag]
sign-tags = true
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
srctree ?= .
KREL=5.12.0-1-librem5
KREL_MAJOR=$(shell echo "${KREL}" | sed 's/\([0-9].[0-9]\+\).*/\1/')
BUILD=$(MAKE) KERNELRELEASE=$(KREL) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
BUILD += -j$(NUMJOBS)
endif
ifeq ($(DEB_SOURCE), linux-librem5)
BUILD_LIBC_PKG=1
export BUILD_LIBC_PKG
endif
debian/control: debian/control.in
sed -e 's/\%KREL\%/$(KREL)/g' \
-e 's/\%DEB_SOURCE\%/$(DEB_SOURCE)/g' \
-e 's/\%KREL_MAJOR\%/$(KREL_MAJOR)/g' \
debian/control.in > debian/control.tmp
mv debian/control.tmp debian/control
.config: arch/arm64/configs/librem5_defconfig
$(BUILD) librem5_defconfig
build: .config
$(BUILD) -f $(srctree)/Makefile
binary-indep:
binary-arch: debian/control
$(BUILD) -f $(srctree)/Makefile intdeb-pkg
ifeq ($(DEB_SOURCE), linux-librem5)
dh_installdeb -plinux-image-librem5
dh_gencontrol -plinux-image-librem5
dh_install -plinux-image-librem5
dh_installdocs -plinux-image-librem5
dh_installchangelogs -plinux-image-librem5
dh_compress -plinux-image-librem5
dh_builddeb -plinux-image-librem5
endif
clean: debian/control
ifeq ($(DEB_SOURCE), linux-librem5)
dh_clean -plinux-image-librem5
endif
rm -rf debian/*tmp debian/files
$(MAKE) clean
binary: binary-arch
......@@ -208,7 +208,7 @@ EOF
chmod 755 "$tmpdir/DEBIAN/$script"
done
if [ "$ARCH" != "um" ]; then
if [ "$ARCH" != "um" ] && [ -n "${BUILD_LIBC_PKG}" ]; then
if is_enabled CONFIG_MODULES; then
deploy_kernel_headers debian/linux-headers
create_package linux-headers-$version debian/linux-headers
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment