* [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules
@ 2018-02-08 15:05 Jan Kiszka
2018-02-08 15:05 ` [PATCH 1/8] Forward proxy settings to dpkg build Jan Kiszka
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Jan Kiszka @ 2018-02-08 15:05 UTC (permalink / raw)
To: isar-users
This is now finally the promised patches to provide simple patterns for
building custom kernels for Isar images that replace the distro kernels.
It also provids the same pattern for custom out-of-tree kernel modules.
Along come two fixes, one to respect proxies during dpkg builds, the
other to adjust isar-apt repo prio.
Furthermore, I'm proposing to rename "SRC_DIR" to OE-standard "S".
This series is also available at
https://github.com/siemens/isar jan/kernel-build
Jan
Jan Kiszka (8):
Forward proxy settings to dpkg build
Prioritize isar-apt repo over all others
Replace SRC_DIR with S
Install kernel via replaceable recipe
Provide include file for easy custom kernel builds
Add custom kernel examples
Provide include file for easy custom module builds
Add exemplary kernel module
doc/user_manual.md | 6 +-
meta-isar/conf/distro/debian-jessie.conf | 2 +
meta-isar/conf/distro/debian-stretch.conf | 2 +
meta-isar/conf/distro/debian-wheezy.conf | 2 +
meta-isar/conf/distro/raspbian-jessie.conf | 2 +
meta-isar/conf/local.conf.sample | 2 +-
meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 3 +-
meta-isar/conf/multiconfig/qemuarm-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemuarm-stretch.conf | 3 +-
meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 2 +-
meta-isar/conf/multiconfig/qemui386-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemui386-stretch.conf | 3 +-
meta-isar/conf/multiconfig/rpi-jessie.conf | 3 +-
.../recipes-app/example-hello/example-hello.bb | 2 +-
meta-isar/recipes-app/libhello/libhello.bb | 2 +-
.../recipes-core/images/files/multistrap.conf.in | 1 +
meta-isar/recipes-core/images/isar-image-base.bb | 6 +-
.../example-module/example-module.bb | 5 +
.../example-module/files/src/Makefile | 11 +
.../example-module/files/src/example-module.c | 19 ++
meta-isar/recipes-kernel/linux/files/defconfig | 308 +++++++++++++++++++++
meta-isar/recipes-kernel/linux/linux-cip_4.4.bb | 10 +
.../recipes-kernel/linux/linux-mainline_4.14.17.bb | 8 +
meta/classes/dpkg.bbclass | 3 +-
meta/recipes-devtools/buildchroot/buildchroot.bb | 4 +-
.../buildchroot/files/isar-apt-prefs | 3 +
.../buildchroot/files/multistrap.conf.in | 1 +
.../linux-module/files/debian/changelog | 5 +
.../linux-module/files/debian/compat | 1 +
.../linux-module/files/debian/control | 11 +
.../recipes-kernel/linux-module/files/debian/rules | 8 +
meta/recipes-kernel/linux-module/module.inc | 17 ++
meta/recipes-kernel/linux/linux-custom.inc | 91 ++++++
meta/recipes-kernel/linux/linux-distro.bb | 14 +
35 files changed, 549 insertions(+), 17 deletions(-)
create mode 100644 meta-isar/recipes-kernel/example-module/example-module.bb
create mode 100644 meta-isar/recipes-kernel/example-module/files/src/Makefile
create mode 100644 meta-isar/recipes-kernel/example-module/files/src/example-module.c
create mode 100644 meta-isar/recipes-kernel/linux/files/defconfig
create mode 100644 meta-isar/recipes-kernel/linux/linux-cip_4.4.bb
create mode 100644 meta-isar/recipes-kernel/linux/linux-mainline_4.14.17.bb
create mode 100644 meta/recipes-devtools/buildchroot/files/isar-apt-prefs
create mode 100644 meta/recipes-kernel/linux-module/files/debian/changelog
create mode 100644 meta/recipes-kernel/linux-module/files/debian/compat
create mode 100644 meta/recipes-kernel/linux-module/files/debian/control
create mode 100755 meta/recipes-kernel/linux-module/files/debian/rules
create mode 100644 meta/recipes-kernel/linux-module/module.inc
create mode 100644 meta/recipes-kernel/linux/linux-custom.inc
create mode 100644 meta/recipes-kernel/linux/linux-distro.bb
--
2.13.6
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/8] Forward proxy settings to dpkg build
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
@ 2018-02-08 15:05 ` Jan Kiszka
2018-02-08 15:05 ` [PATCH 2/8] Prioritize isar-apt repo over all others Jan Kiszka
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2018-02-08 15:05 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
Required when the package needs to install build dependencies.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/dpkg.bbclass | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index c10f5ba..9cd4403 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -5,5 +5,6 @@ inherit dpkg-base
# Build package from sources using build script
dpkg_runbuild() {
- sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
+ E="${@ bb.utils.export_proxies(d)}"
+ sudo -E chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
}
--
2.13.6
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/8] Prioritize isar-apt repo over all others
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
2018-02-08 15:05 ` [PATCH 1/8] Forward proxy settings to dpkg build Jan Kiszka
@ 2018-02-08 15:05 ` Jan Kiszka
2018-02-08 15:05 ` [PATCH 3/8] Replace SRC_DIR with S Jan Kiszka
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2018-02-08 15:05 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
This ensures that we can override packages from upstream Debian or other
external sources with our self-built versions. We achieve this for now
by asking multistrap to drop a preferences file for the buildchroot so
that dependency installations use the right priority. For the image
build, this does not work because all packages are pull during the
bootstrap. Therefore, we set aptdefaultrelease to isar to ensure that
our repo gets the higher priority.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta-isar/recipes-core/images/files/multistrap.conf.in | 1 +
meta-isar/recipes-core/images/isar-image-base.bb | 1 +
meta/recipes-devtools/buildchroot/buildchroot.bb | 4 +++-
meta/recipes-devtools/buildchroot/files/isar-apt-prefs | 3 +++
meta/recipes-devtools/buildchroot/files/multistrap.conf.in | 1 +
5 files changed, 9 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-devtools/buildchroot/files/isar-apt-prefs
diff --git a/meta-isar/recipes-core/images/files/multistrap.conf.in b/meta-isar/recipes-core/images/files/multistrap.conf.in
index 432b6af..2ab7eab 100644
--- a/meta-isar/recipes-core/images/files/multistrap.conf.in
+++ b/meta-isar/recipes-core/images/files/multistrap.conf.in
@@ -10,6 +10,7 @@ aptsources=##DISTRO_MULTICONF_APTSOURCES##
configscript=##CONFIG_SCRIPT##
setupscript=##SETUP_SCRIPT##
hookdir=##DIR_HOOKS##
+aptdefaultrelease=isar
[base]
source=##DISTRO_APT_SOURCE##
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index 8ddbabb..e54b9a6 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -53,6 +53,7 @@ do_rootfs() {
-e 's|##IMAGE_INSTALL##|${IMAGE_INSTALL}|g' \
-e 's|##DEPLOY_DIR_APT##|copy:///${DEPLOY_DIR_APT}/${DISTRO}|g' \
-e 's|##ISAR_DISTRO_SUITE##|${DEBDISTRONAME}|g' \
+ -e 's|##APT_PREFS##|./'"$WORKDIR_REL"'/isar-apt-prefs|g' \
"${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
# Do not use bitbake flag [dirs] here because this folder should have
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
index df9df19..bf80114 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
@@ -12,7 +12,8 @@ FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:"
SRC_URI = "file://multistrap.conf.in \
file://configscript.sh \
file://setup.sh \
- file://build.sh"
+ file://build.sh \
+ file://isar-apt-prefs"
PV = "1.0"
BUILDCHROOT_PREINSTALL ?= "gcc \
@@ -58,6 +59,7 @@ do_build() {
-e 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/configscript.sh|g' \
-e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \
-e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
+ -e 's|##APT_PREFS##|./'"$WORKDIR_REL"'/isar-apt-prefs|g' \
"${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
do_setup_mounts
diff --git a/meta/recipes-devtools/buildchroot/files/isar-apt-prefs b/meta/recipes-devtools/buildchroot/files/isar-apt-prefs
new file mode 100644
index 0000000..2db40e5
--- /dev/null
+++ b/meta/recipes-devtools/buildchroot/files/isar-apt-prefs
@@ -0,0 +1,3 @@
+Package: *
+Pin: release n=isar,c=main
+Pin-Priority: 1001
diff --git a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in b/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
index 480a4b8..89c4968 100644
--- a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
+++ b/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
@@ -10,6 +10,7 @@ aptsources=isar-apt ##DISTRO_MULTICONF_APTSOURCES##
configscript=##CONFIG_SCRIPT##
setupscript=##SETUP_SCRIPT##
hookdir=##DIR_HOOKS##
+aptpreferences=##APT_PREFS##
[base]
source=##DISTRO_APT_SOURCE##
--
2.13.6
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/8] Replace SRC_DIR with S
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
2018-02-08 15:05 ` [PATCH 1/8] Forward proxy settings to dpkg build Jan Kiszka
2018-02-08 15:05 ` [PATCH 2/8] Prioritize isar-apt repo over all others Jan Kiszka
@ 2018-02-08 15:05 ` Jan Kiszka
2018-02-08 15:05 ` [PATCH 4/8] Install kernel via replaceable recipe Jan Kiszka
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2018-02-08 15:05 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
This aligns us with OE/bitbake style.
Along updating the manual, also fix SRC_REV -> SRCREV.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
doc/user_manual.md | 6 +++---
meta-isar/recipes-app/example-hello/example-hello.bb | 2 +-
meta-isar/recipes-app/libhello/libhello.bb | 2 +-
meta/classes/dpkg.bbclass | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/doc/user_manual.md b/doc/user_manual.md
index 969f6d2..0771d1e 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -513,7 +513,7 @@ PV = "1.0"
SRC_URI = "git://github.com/ilbers/hello.git"
SRCREV = "ad7065ecc4840cc436bfcdac427386dbba4ea719"
-SRC_DIR = "git"
+S = "git"
inherit dpkg
```
@@ -531,8 +531,8 @@ This approach prevents duplication of the license files in different packages.
- `PV` - Package version.
- `SRC_URI` - The link where to fetch application source. Please check the BitBake user manual for supported download formats.
- - `SRC_DIR` - The directory name where application sources will be unpacked. For `git` repositories, it should be set to `git`. Please check the BitBake user manual for supported download formats.
- - `SRC_REV` - Source code revision to fetch. Please check the BitBake user manual for supported download formats.
+ - `S` - The directory name where application sources will be unpacked. For `git` repositories, it should be set to `git`. Please check the BitBake user manual for supported download formats.
+ - `SRCREV` - Source code revision to fetch. Please check the BitBake user manual for supported download formats.
The last line in the example above adds recipe to the Isar work chain.
diff --git a/meta-isar/recipes-app/example-hello/example-hello.bb b/meta-isar/recipes-app/example-hello/example-hello.bb
index 9d83e4c..73cca0a 100644
--- a/meta-isar/recipes-app/example-hello/example-hello.bb
+++ b/meta-isar/recipes-app/example-hello/example-hello.bb
@@ -17,6 +17,6 @@ DEPENDS += "libhello"
SRC_URI = "git://github.com/ilbers/hello.git;protocol=https"
SRCREV = "86cc719b3359adc3c4e243387feba50360a860f3"
-SRC_DIR = "git"
+S = "git"
inherit dpkg
diff --git a/meta-isar/recipes-app/libhello/libhello.bb b/meta-isar/recipes-app/libhello/libhello.bb
index df5793e..1875831 100644
--- a/meta-isar/recipes-app/libhello/libhello.bb
+++ b/meta-isar/recipes-app/libhello/libhello.bb
@@ -13,6 +13,6 @@ PV = "0.1-98f2e41"
SRC_URI = "git://github.com/ilbers/libhello.git;protocol=https"
SRCREV = "98f2e41e7d05ab8d19b0c5d160b104b725c8fd93"
-SRC_DIR = "git"
+S = "git"
inherit dpkg
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 9cd4403..06f0579 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -6,5 +6,5 @@ inherit dpkg-base
# Build package from sources using build script
dpkg_runbuild() {
E="${@ bb.utils.export_proxies(d)}"
- sudo -E chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
+ sudo -E chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${S}
}
--
2.13.6
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/8] Install kernel via replaceable recipe
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
` (2 preceding siblings ...)
2018-02-08 15:05 ` [PATCH 3/8] Replace SRC_DIR with S Jan Kiszka
@ 2018-02-08 15:05 ` Jan Kiszka
2018-02-08 15:05 ` [PATCH 5/8] Provide include file for easy custom kernel builds Jan Kiszka
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2018-02-08 15:05 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
This simplifies the common task of using a custom kernel instead of the
pre-selected disto variant: Move the kernel installation into a dummy
dpkg-raw recipe that only has the kernel package as dependency.
Which recipe is used for providing the kernel can now be selected via
the well-know PREFERRED_PROVIDER_virtual/kernel, just like in OE.
The kernel package name is derived from the KERNEL_ARCH variable which
is communicated from the target multiconfig file to the linux-distro
recipe.
Based on an idea of Henning Schild.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta-isar/conf/distro/debian-jessie.conf | 2 ++
meta-isar/conf/distro/debian-stretch.conf | 2 ++
meta-isar/conf/distro/debian-wheezy.conf | 2 ++
meta-isar/conf/distro/raspbian-jessie.conf | 2 ++
meta-isar/conf/multiconfig/qemuamd64-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 3 ++-
meta-isar/conf/multiconfig/qemuarm-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemuarm-stretch.conf | 3 ++-
meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 2 +-
meta-isar/conf/multiconfig/qemui386-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemui386-stretch.conf | 3 ++-
meta-isar/conf/multiconfig/rpi-jessie.conf | 3 ++-
meta-isar/recipes-core/images/isar-image-base.bb | 5 ++++-
meta/recipes-kernel/linux/linux-distro.bb | 14 ++++++++++++++
14 files changed, 38 insertions(+), 9 deletions(-)
create mode 100644 meta/recipes-kernel/linux/linux-distro.bb
diff --git a/meta-isar/conf/distro/debian-jessie.conf b/meta-isar/conf/distro/debian-jessie.conf
index d4bc4b1..4494c91 100644
--- a/meta-isar/conf/distro/debian-jessie.conf
+++ b/meta-isar/conf/distro/debian-jessie.conf
@@ -10,3 +10,5 @@ DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-distro"
diff --git a/meta-isar/conf/distro/debian-stretch.conf b/meta-isar/conf/distro/debian-stretch.conf
index 74177fd..1375c1d 100644
--- a/meta-isar/conf/distro/debian-stretch.conf
+++ b/meta-isar/conf/distro/debian-stretch.conf
@@ -8,3 +8,5 @@ DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-distro"
diff --git a/meta-isar/conf/distro/debian-wheezy.conf b/meta-isar/conf/distro/debian-wheezy.conf
index 017316e..1e99ddd 100644
--- a/meta-isar/conf/distro/debian-wheezy.conf
+++ b/meta-isar/conf/distro/debian-wheezy.conf
@@ -10,3 +10,5 @@ DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-distro"
diff --git a/meta-isar/conf/distro/raspbian-jessie.conf b/meta-isar/conf/distro/raspbian-jessie.conf
index bd3c280..6a6c568 100644
--- a/meta-isar/conf/distro/raspbian-jessie.conf
+++ b/meta-isar/conf/distro/raspbian-jessie.conf
@@ -10,3 +10,5 @@ DISTRO_APT_SOURCE_SEC ?= ""
DISTRO_CONFIG_SCRIPT ?= "raspbian-configscript.sh"
DISTRO_MULTICONF_BOOTSTRAP ?= "base"
DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-distro"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
index 51d39b6..c80a936 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
@@ -6,7 +6,7 @@ MACHINE ?= "qemuamd64"
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "amd64"
-IMAGE_PREINSTALL += "linux-image-amd64"
+KERNEL_ARCH ?= "amd64"
ROOTFS_DEV ?= "sda"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
index c59876a..28ab3ae 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
@@ -6,9 +6,10 @@ MACHINE ?= "qemuamd64"
DISTRO ?= "debian-stretch"
DISTRO_ARCH ?= "amd64"
+KERNEL_ARCH ?= "amd64"
+
IMAGE_PREINSTALL += " \
init \
- linux-image-amd64 \
"
ROOTFS_DEV ?= "sda"
diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
index ed84c6c..48244eb 100644
--- a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
@@ -13,7 +13,7 @@ MACHINE ?= "qemuarm"
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "armhf"
-IMAGE_PREINSTALL += "linux-image-armmp"
+KERNEL_ARCH ?= "armmp"
ROOTFS_DEV ?= "vda"
diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
index 1cce97a..5cf24f2 100644
--- a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
@@ -6,9 +6,10 @@ MACHINE ?= "qemuarm"
DISTRO ?= "debian-stretch"
DISTRO_ARCH ?= "armhf"
+KERNEL_ARCH ?= "armmp"
+
IMAGE_PREINSTALL += " \
init \
- linux-image-armmp \
"
ROOTFS_DEV ?= "vda"
diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
index 38ea191..695cdce 100644
--- a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
@@ -13,7 +13,7 @@ MACHINE ?= "qemuarm"
DISTRO ?= "debian-wheezy"
DISTRO_ARCH ?= "armhf"
-IMAGE_PREINSTALL += "linux-image-vexpress"
+KERNEL_ARCH ?= "vexpress"
ROOTFS_DEV ?= "mmcblk0"
diff --git a/meta-isar/conf/multiconfig/qemui386-jessie.conf b/meta-isar/conf/multiconfig/qemui386-jessie.conf
index d589661..f73ad98 100644
--- a/meta-isar/conf/multiconfig/qemui386-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemui386-jessie.conf
@@ -6,7 +6,7 @@ MACHINE ?= "qemui386"
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "i386"
-IMAGE_PREINSTALL += "linux-image-686-pae"
+KERNEL_ARCH ?= "686-pae"
ROOTFS_DEV ?= "sda"
diff --git a/meta-isar/conf/multiconfig/qemui386-stretch.conf b/meta-isar/conf/multiconfig/qemui386-stretch.conf
index 40239e4..60f8ccb 100644
--- a/meta-isar/conf/multiconfig/qemui386-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemui386-stretch.conf
@@ -6,9 +6,10 @@ MACHINE ?= "qemui386"
DISTRO ?= "debian-stretch"
DISTRO_ARCH ?= "i386"
+KERNEL_ARCH ?= "686-pae"
+
IMAGE_PREINSTALL += " \
init \
- linux-image-686-pae \
"
ROOTFS_DEV ?= "sda"
diff --git a/meta-isar/conf/multiconfig/rpi-jessie.conf b/meta-isar/conf/multiconfig/rpi-jessie.conf
index d1dd9d9..c7c7fae 100644
--- a/meta-isar/conf/multiconfig/rpi-jessie.conf
+++ b/meta-isar/conf/multiconfig/rpi-jessie.conf
@@ -13,13 +13,14 @@ MACHINE ?= "rpi"
DISTRO ?= "raspbian-jessie"
DISTRO_ARCH ?= "armhf"
+KERNEL_ARCH ?= "rpi-rpfv"
+
IMAGE_PREINSTALL += " \
bind9-host \
dnsutils \
iproute2 \
iputils-ping \
isc-dhcp-client \
- linux-image-rpi-rpfv \
lrzsz \
net-tools \
netcat-openbsd \
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index e54b9a6..5340767 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -18,12 +18,15 @@ PV = "1.0"
inherit image
-DEPENDS += "${IMAGE_INSTALL}"
+DEPENDS += "${IMAGE_INSTALL} \
+ virtual/kernel"
IMAGE_PREINSTALL += "apt \
dbus \
localepurge"
+IMAGE_INSTALL += "${@d.getVar("PREFERRED_PROVIDER_virtual/kernel", True)}"
+
WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
do_rootfs[dirs] = "${WORKDIR}/hooks_multistrap"
diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb
new file mode 100644
index 0000000..a0700e8
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-distro.bb
@@ -0,0 +1,14 @@
+# Debian kernel pseudo package
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+
+DESCRIPTION = "Meta package for distribution kernel"
+MAINTAINER = "ISAR project <isar-users@googlegroups.com>"
+PROVIDES = "virtual/kernel"
+
+KERNEL_ARCH ?= "${DISTRO_ARCH}"
+
+DEBIAN_DEPENDS = "linux-image-${KERNEL_ARCH}"
+
+inherit dpkg-raw
--
2.13.6
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 5/8] Provide include file for easy custom kernel builds
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
` (3 preceding siblings ...)
2018-02-08 15:05 ` [PATCH 4/8] Install kernel via replaceable recipe Jan Kiszka
@ 2018-02-08 15:05 ` Jan Kiszka
2018-02-08 15:05 ` [PATCH 6/8] Add custom kernel examples Jan Kiszka
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2018-02-08 15:05 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
With this include file, it becomes almost trivial to replace the distro
kernel with a custom build. You just need to include linux-custom.inc,
specify the source URI, define via S where the source is unpacked to and
provide a defconfig. To switch to a custom kernel recipe,
PREFERRED_PROVIDER_virtual/kernel has to be adjusted in local.conf or
the distro conf.
The approach works internally by first running "make deb-pkg" on the
kernel and the repackages the output to make the binary linux-image and
linux-header debs act as replacement of their distro packages. This
results in a suboptimal technical implementation which may eventually be
replaced by an isar-implemented deb-pkg build process. However, this is
not expected to affect the user-visible interface of this include file.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/recipes-kernel/linux/linux-custom.inc | 91 ++++++++++++++++++++++++++++++
1 file changed, 91 insertions(+)
create mode 100644 meta/recipes-kernel/linux/linux-custom.inc
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
new file mode 100644
index 0000000..d487515
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -0,0 +1,91 @@
+DESCRIPTION ?= "Custom kernel"
+PROVIDES = "virtual/kernel"
+
+inherit dpkg-base
+
+KERNEL_DEBIAN_DEPENDS = "initramfs-tools | linux-initramfs-tool, kmod, linux-base (>= 4.3~)"
+KERNEL_HEADERS_DEBIAN_DEPENDS = "libc6, libssl1.1, gcc"
+KBUILD_DEPENDS = "libssl-dev libelf-dev bc"
+
+REPACK_DIR = "${PP}/repack"
+REPACK_LINUX_IMAGE_DIR = "${REPACK_DIR}/linux-image"
+REPACK_LINUX_HEADERS_DIR = "${REPACK_DIR}/linux-headers"
+
+dpkg_runbuild() {
+ E="${@ bb.utils.export_proxies(d)}"
+ sudo -E chroot ${BUILDCHROOT_DIR} sh -c '
+ set -e
+
+ apt-get install -y -o Debug::pkgProblemResolver=yes \
+ --no-install-recommends ${KBUILD_DEPENDS}
+
+ cd ${PP}/${S}
+ cp ../defconfig .config
+ make olddefconfig
+
+ make -j ${@bb.utils.cpu_count() * 2} deb-pkg
+
+ rm -rf ${REPACK_DIR}
+ mkdir -p ${REPACK_DIR}
+ mkdir -p ${REPACK_LINUX_IMAGE_DIR}
+ mkdir -p ${REPACK_LINUX_HEADERS_DIR}
+
+ cd ${PP}
+ tar xzf linux-${PV}_${PV}-1.debian.tar.gz -C ${REPACK_DIR}
+ dpkg-deb -R linux-image-${PV}_${PV}-1_${KERNEL_ARCH}.deb \
+ ${REPACK_LINUX_IMAGE_DIR}
+ dpkg-deb -R linux-headers-${PV}_${PV}-1_${KERNEL_ARCH}.deb \
+ ${REPACK_LINUX_HEADERS_DIR}
+
+ dpkg-gencontrol -crepack/debian/control \
+ -lrepack/debian/changelog \
+ -frepack/debian/files \
+ -plinux-image-${PV} \
+ -P${REPACK_LINUX_IMAGE_DIR} \
+ -DPackage="linux-image-${KERNEL_ARCH}" \
+ -DSection=kernel \
+ -DPriority=required \
+ -DProvides="${PN}" \
+ -DDepends="${KERNEL_DEBIAN_DEPENDS}"
+
+ # Add Debian-like link installation to postinst
+ touch ${REPACK_LINUX_IMAGE_DIR}/lib/modules/${PV}/.fresh-install
+ sed -i ${REPACK_LINUX_IMAGE_DIR}/DEBIAN/postinst \
+ -e "/^set -e$/a\\
+\\
+if [ -f /lib/modules/${PV}/.fresh-install ]; then\\
+ change=install\\
+else\\
+ change=upgrade\\
+fi\\
+linux-update-symlinks \$change ${PV} /boot/vmlinuz-${PV}\\
+rm -f /lib/modules/${PV}/.fresh-install"
+
+ # Add Debian-like link removal to postrm
+ sed -i ${REPACK_LINUX_IMAGE_DIR}/DEBIAN/postrm \
+ -e "/^set -e$/a\\
+\\
+rm -f /lib/modules/${PV}/.fresh-install\\
+\\
+if [ \"\$1\" != upgrade ] && command -v linux-update-symlinks >/dev/null; then\\
+ linux-update-symlinks remove ${PV} /boot/vmlinuz-${PV}\\
+fi"
+
+ dpkg-gencontrol -crepack/debian/control \
+ -lrepack/debian/changelog \
+ -frepack/debian/files \
+ -plinux-headers-${PV} \
+ -P${REPACK_LINUX_HEADERS_DIR} \
+ -Vkernel:debarch="${KERNEL_ARCH}" \
+ -DPackage="linux-headers-${KERNEL_ARCH}" \
+ -DSection=kernel \
+ -DDepends="${KERNEL_HEADERS_DEBIAN_DEPENDS}"
+
+ dpkg-deb -b ${REPACK_LINUX_IMAGE_DIR} \
+ linux-image-${KERNEL_ARCH}_${PV}-1_${KERNEL_ARCH}.deb
+ rm -f linux-image-${PV}_${PV}-1_${KERNEL_ARCH}.deb
+ dpkg-deb -b ${REPACK_LINUX_HEADERS_DIR} \
+ linux-headers-${KERNEL_ARCH}_${PV}-1_${KERNEL_ARCH}.deb
+ rm -f linux-headers-${PV}_${PV}-1_${KERNEL_ARCH}.deb
+ '
+}
--
2.13.6
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 6/8] Add custom kernel examples
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
` (4 preceding siblings ...)
2018-02-08 15:05 ` [PATCH 5/8] Provide include file for easy custom kernel builds Jan Kiszka
@ 2018-02-08 15:05 ` Jan Kiszka
2018-02-08 15:05 ` [PATCH 7/8] Provide include file for easy custom module builds Jan Kiszka
2018-02-08 15:05 ` [PATCH 8/8] Add exemplary kernel module Jan Kiszka
7 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2018-02-08 15:05 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
Provide two examples for describing custom kernel builds. Both are for
x86_64, simply using upstream x86_64_defconfig to define the required
defconfig. One example is demoing a build from a tarball, the other
pulling from git.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta-isar/recipes-kernel/linux/files/defconfig | 308 +++++++++++++++++++++
meta-isar/recipes-kernel/linux/linux-cip_4.4.bb | 10 +
.../recipes-kernel/linux/linux-mainline_4.14.17.bb | 8 +
3 files changed, 326 insertions(+)
create mode 100644 meta-isar/recipes-kernel/linux/files/defconfig
create mode 100644 meta-isar/recipes-kernel/linux/linux-cip_4.4.bb
create mode 100644 meta-isar/recipes-kernel/linux/linux-mainline_4.14.17.bb
diff --git a/meta-isar/recipes-kernel/linux/files/defconfig b/meta-isar/recipes-kernel/linux/files/defconfig
new file mode 100644
index 0000000..e32fc1f
--- /dev/null
+++ b/meta-isar/recipes-kernel/linux/files/defconfig
@@ -0,0 +1,308 @@
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_FHANDLE=y
+CONFIG_AUDIT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_LOG_BUF_SHIFT=18
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CPUSETS=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_PROFILING=y
+CONFIG_KPROBES=y
+CONFIG_JUMP_LABEL=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_OSF_PARTITION=y
+CONFIG_AMIGA_PARTITION=y
+CONFIG_MAC_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_SGI_PARTITION=y
+CONFIG_SUN_PARTITION=y
+CONFIG_KARMA_PARTITION=y
+CONFIG_EFI_PARTITION=y
+CONFIG_SMP=y
+CONFIG_CALGARY_IOMMU=y
+CONFIG_NR_CPUS=64
+CONFIG_SCHED_SMT=y
+CONFIG_PREEMPT_VOLUNTARY=y
+CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
+CONFIG_X86_MCE=y
+CONFIG_MICROCODE=y
+CONFIG_MICROCODE_AMD=y
+CONFIG_X86_MSR=y
+CONFIG_X86_CPUID=y
+CONFIG_NUMA=y
+CONFIG_X86_CHECK_BIOS_CORRUPTION=y
+# CONFIG_MTRR_SANITIZER is not set
+CONFIG_EFI=y
+CONFIG_HZ_1000=y
+CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
+CONFIG_RANDOMIZE_BASE=y
+CONFIG_RANDOMIZE_MEMORY=y
+# CONFIG_COMPAT_VDSO is not set
+CONFIG_HIBERNATION=y
+CONFIG_PM_DEBUG=y
+CONFIG_PM_TRACE_RTC=y
+CONFIG_ACPI_DOCK=y
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_STAT is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_X86_ACPI_CPUFREQ=y
+CONFIG_PCI_MMCONFIG=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCCARD=y
+CONFIG_YENTA=y
+CONFIG_HOTPLUG_PCI=y
+CONFIG_BINFMT_MISC=y
+CONFIG_IA32_EMULATION=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_DIAG is not set
+CONFIG_TCP_CONG_ADVANCED=y
+# CONFIG_TCP_CONG_BIC is not set
+# CONFIG_TCP_CONG_WESTWOOD is not set
+# CONFIG_TCP_CONG_HTCP is not set
+CONFIG_TCP_MD5SIG=y
+CONFIG_IPV6=y
+CONFIG_INET6_AH=y
+CONFIG_INET6_ESP=y
+CONFIG_NETLABEL=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_ADVANCED is not set
+CONFIG_NF_CONNTRACK=y
+CONFIG_NF_CONNTRACK_FTP=y
+CONFIG_NF_CONNTRACK_IRC=y
+CONFIG_NF_CONNTRACK_SIP=y
+CONFIG_NF_CT_NETLINK=y
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
+CONFIG_NETFILTER_XT_TARGET_NFLOG=y
+CONFIG_NETFILTER_XT_TARGET_SECMARK=y
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
+CONFIG_NETFILTER_XT_MATCH_POLICY=y
+CONFIG_NETFILTER_XT_MATCH_STATE=y
+CONFIG_NF_CONNTRACK_IPV4=y
+CONFIG_IP_NF_IPTABLES=y
+CONFIG_IP_NF_FILTER=y
+CONFIG_IP_NF_TARGET_REJECT=y
+CONFIG_NF_NAT=y
+CONFIG_IP_NF_TARGET_MASQUERADE=y
+CONFIG_IP_NF_MANGLE=y
+CONFIG_NF_CONNTRACK_IPV6=y
+CONFIG_IP6_NF_IPTABLES=y
+CONFIG_IP6_NF_MATCH_IPV6HEADER=y
+CONFIG_IP6_NF_FILTER=y
+CONFIG_IP6_NF_TARGET_REJECT=y
+CONFIG_IP6_NF_MANGLE=y
+CONFIG_NET_SCHED=y
+CONFIG_NET_EMATCH=y
+CONFIG_NET_CLS_ACT=y
+CONFIG_HAMRADIO=y
+CONFIG_CFG80211=y
+CONFIG_MAC80211=y
+CONFIG_MAC80211_LEDS=y
+CONFIG_RFKILL=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_DEBUG_DEVRES=y
+CONFIG_CONNECTOR=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_LOWLEVEL is not set
+CONFIG_ATA=y
+CONFIG_SATA_AHCI=y
+CONFIG_ATA_PIIX=y
+CONFIG_PATA_AMD=y
+CONFIG_PATA_OLDPIIX=y
+CONFIG_PATA_SCH=y
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_BLK_DEV_DM=y
+CONFIG_DM_MIRROR=y
+CONFIG_DM_ZERO=y
+CONFIG_MACINTOSH_DRIVERS=y
+CONFIG_MAC_EMUMOUSEBTN=y
+CONFIG_NETDEVICES=y
+CONFIG_NETCONSOLE=y
+CONFIG_TIGON3=y
+CONFIG_NET_TULIP=y
+CONFIG_E100=y
+CONFIG_E1000=y
+CONFIG_E1000E=y
+CONFIG_SKY2=y
+CONFIG_FORCEDETH=y
+CONFIG_8139TOO=y
+CONFIG_R8169=y
+CONFIG_FDDI=y
+CONFIG_INPUT_POLLDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_INPUT_TABLET=y
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_INPUT_MISC=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_INTEL is not set
+# CONFIG_HW_RANDOM_AMD is not set
+CONFIG_NVRAM=y
+CONFIG_HPET=y
+# CONFIG_HPET_MMAP is not set
+CONFIG_I2C_I801=y
+CONFIG_WATCHDOG=y
+CONFIG_AGP=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+CONFIG_DRM=y
+CONFIG_DRM_I915=y
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_EFI=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SEQUENCER=y
+CONFIG_SND_SEQ_DUMMY=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_HRTIMER=y
+CONFIG_SND_HDA_INTEL=y
+CONFIG_SND_HDA_HWDEP=y
+CONFIG_HIDRAW=y
+CONFIG_HID_GYRATION=y
+CONFIG_LOGITECH_FF=y
+CONFIG_HID_NTRIG=y
+CONFIG_HID_PANTHERLORD=y
+CONFIG_PANTHERLORD_FF=y
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+CONFIG_HID_TOPSEED=y
+CONFIG_HID_PID=y
+CONFIG_USB_HIDDEV=y
+CONFIG_USB=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_MON=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_USB_PRINTER=y
+CONFIG_USB_STORAGE=y
+CONFIG_EDAC=y
+CONFIG_RTC_CLASS=y
+# CONFIG_RTC_HCTOSYS is not set
+CONFIG_DMADEVICES=y
+CONFIG_EEEPC_LAPTOP=y
+CONFIG_AMD_IOMMU=y
+CONFIG_INTEL_IOMMU=y
+# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
+CONFIG_EFI_VARS=y
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+CONFIG_QUOTA=y
+CONFIG_QUOTA_NETLINK_INTERFACE=y
+# CONFIG_PRINT_QUOTA_WARNING is not set
+CONFIG_QFMT_V2=y
+CONFIG_AUTOFS4_FS=y
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_HUGETLBFS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NLS_DEFAULT="utf8"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_UTF8=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+CONFIG_DEBUG_STACK_USAGE=y
+CONFIG_BLK_DEV_IO_TRACE=y
+CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
+CONFIG_EARLY_PRINTK_DBGP=y
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_DEBUG_RODATA_TEST is not set
+CONFIG_DEBUG_BOOT_PARAMS=y
+CONFIG_OPTIMIZE_INLINING=y
+CONFIG_UNWINDER_ORC=y
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_DISABLE=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/meta-isar/recipes-kernel/linux/linux-cip_4.4.bb b/meta-isar/recipes-kernel/linux/linux-cip_4.4.bb
new file mode 100644
index 0000000..d4fdda4
--- /dev/null
+++ b/meta-isar/recipes-kernel/linux/linux-cip_4.4.bb
@@ -0,0 +1,10 @@
+require recipes-kernel/linux/linux-custom.inc
+
+SRC_URI += " \
+ git://git.kernel.org/pub/scm/linux/kernel/git/bwh/linux-cip.git;branch=linux-4.4.y-cip \
+ file://defconfig"
+
+SRCREV = "4e52cc5f668c4666e31a8485725b5f4e897b3baf"
+PV = "4.4.112-cip18"
+
+S = "git"
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_4.14.17.bb b/meta-isar/recipes-kernel/linux/linux-mainline_4.14.17.bb
new file mode 100644
index 0000000..6c0b0ab
--- /dev/null
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_4.14.17.bb
@@ -0,0 +1,8 @@
+require recipes-kernel/linux/linux-custom.inc
+
+SRC_URI += " \
+ https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz \
+ file://defconfig"
+SRC_URI[sha256sum] = "27c69487f17b3c4e6576dbc9fc89a94525c4825c75ffbd4006fb536b97410a4b"
+
+S = "linux-${PV}"
--
2.13.6
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 7/8] Provide include file for easy custom module builds
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
` (5 preceding siblings ...)
2018-02-08 15:05 ` [PATCH 6/8] Add custom kernel examples Jan Kiszka
@ 2018-02-08 15:05 ` Jan Kiszka
2018-02-08 15:05 ` [PATCH 8/8] Add exemplary kernel module Jan Kiszka
7 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2018-02-08 15:05 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
Analogously to linux-custom.inc, this provides an include for custom
kernel modules. The user just needs to specify the module SRC_URI, and
those sources must be then reside in a separate directory which is - as
usual - defined via S.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/recipes-kernel/linux-module/files/debian/changelog | 5 +++++
meta/recipes-kernel/linux-module/files/debian/compat | 1 +
meta/recipes-kernel/linux-module/files/debian/control | 11 +++++++++++
meta/recipes-kernel/linux-module/files/debian/rules | 8 ++++++++
meta/recipes-kernel/linux-module/module.inc | 17 +++++++++++++++++
5 files changed, 42 insertions(+)
create mode 100644 meta/recipes-kernel/linux-module/files/debian/changelog
create mode 100644 meta/recipes-kernel/linux-module/files/debian/compat
create mode 100644 meta/recipes-kernel/linux-module/files/debian/control
create mode 100755 meta/recipes-kernel/linux-module/files/debian/rules
create mode 100644 meta/recipes-kernel/linux-module/module.inc
diff --git a/meta/recipes-kernel/linux-module/files/debian/changelog b/meta/recipes-kernel/linux-module/files/debian/changelog
new file mode 100644
index 0000000..c1c3516
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/files/debian/changelog
@@ -0,0 +1,5 @@
+@PN@ (@PV@) unstable; urgency=low
+
+ * Generated package.
+
+ -- ISAR project <isar-users@googlegroups.com> Tue, 6 Feb 2018 00:00:00 +0000
diff --git a/meta/recipes-kernel/linux-module/files/debian/compat b/meta/recipes-kernel/linux-module/files/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/files/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/meta/recipes-kernel/linux-module/files/debian/control b/meta/recipes-kernel/linux-module/files/debian/control
new file mode 100644
index 0000000..d8fbcaa
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/files/debian/control
@@ -0,0 +1,11 @@
+Source: @PN@
+Section: kernel
+Priority: optional
+Standards-Version: 3.9.6
+Build-Depends: linux-headers-@KERNEL_ARCH@
+Maintainer: ISAR project <isar-users@googlegroups.com>
+
+Package: @PN@
+Architecture: any
+Depends: linux-image-@KERNEL_ARCH@
+Description: @DESCRIPTION@
diff --git a/meta/recipes-kernel/linux-module/files/debian/rules b/meta/recipes-kernel/linux-module/files/debian/rules
new file mode 100755
index 0000000..51d3dc5
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/files/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+export KDIR=$(shell ls -d /lib/modules/*/build)
+
+export DEB_BUILD_OPTIONS=parallel=$(shell nproc)
+
+%:
+ dh $@ --parallel
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
new file mode 100644
index 0000000..a17a14f
--- /dev/null
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -0,0 +1,17 @@
+FILESPATH =. "${LAYERDIR_core}/recipes-kernel/linux-module/files:"
+
+DESCRIPTION ?= "Custom kernel module ${PN}"
+
+DEPENDS = "virtual/kernel"
+
+inherit dpkg
+
+SRC_URI = "file://debian/"
+
+dpkg_runbuild_prepend() {
+ cp -r ${WORKDIR}/debian ${WORKDIR}/${S}/
+ sed -i -e 's/@PN@/${PN}/g' -e 's/@PV@/${PV}/g' \
+ -e 's/@KERNEL_ARCH@/${KERNEL_ARCH}/g' \
+ -e 's/@DESCRIPTION@/${DESCRIPTION}/g' \
+ ${WORKDIR}/${S}/debian/changelog ${WORKDIR}/${S}/debian/control
+}
--
2.13.6
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 8/8] Add exemplary kernel module
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
` (6 preceding siblings ...)
2018-02-08 15:05 ` [PATCH 7/8] Provide include file for easy custom module builds Jan Kiszka
@ 2018-02-08 15:05 ` Jan Kiszka
7 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2018-02-08 15:05 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
This demonstrates the usage of the new module.inc via a primitive
hello world module.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta-isar/conf/local.conf.sample | 2 +-
.../recipes-kernel/example-module/example-module.bb | 5 +++++
.../recipes-kernel/example-module/files/src/Makefile | 11 +++++++++++
.../example-module/files/src/example-module.c | 19 +++++++++++++++++++
4 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 meta-isar/recipes-kernel/example-module/example-module.bb
create mode 100644 meta-isar/recipes-kernel/example-module/files/src/Makefile
create mode 100644 meta-isar/recipes-kernel/example-module/files/src/example-module.c
diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 2ae43e7..92dea46 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -153,7 +153,7 @@ CONF_VERSION = "1"
#
# The default list of extra packages to be installed.
-IMAGE_INSTALL = "example-hello example-raw"
+IMAGE_INSTALL = "example-hello example-raw example-module"
#
# Default parallel jobs for bitbake:
diff --git a/meta-isar/recipes-kernel/example-module/example-module.bb b/meta-isar/recipes-kernel/example-module/example-module.bb
new file mode 100644
index 0000000..86dbf18
--- /dev/null
+++ b/meta-isar/recipes-kernel/example-module/example-module.bb
@@ -0,0 +1,5 @@
+include recipes-kernel/linux-module/module.inc
+
+SRC_URI += "file://src"
+
+S = "src"
diff --git a/meta-isar/recipes-kernel/example-module/files/src/Makefile b/meta-isar/recipes-kernel/example-module/files/src/Makefile
new file mode 100644
index 0000000..59a9703
--- /dev/null
+++ b/meta-isar/recipes-kernel/example-module/files/src/Makefile
@@ -0,0 +1,11 @@
+obj-m := example-module.o
+
+INSTALL_MOD_PATH ?= $(DESTDIR)
+export INSTALL_MOD_PATH
+
+modules modules_install clean:
+ $(MAKE) -C $(KDIR) M=$(PWD) $@
+
+install: modules_install
+
+.PHONY: modules modules_install install clean
diff --git a/meta-isar/recipes-kernel/example-module/files/src/example-module.c b/meta-isar/recipes-kernel/example-module/files/src/example-module.c
new file mode 100644
index 0000000..2099e16
--- /dev/null
+++ b/meta-isar/recipes-kernel/example-module/files/src/example-module.c
@@ -0,0 +1,19 @@
+/*
+ * Example modules
+ *
+ * Copyright (c) Siemens AG, 2018
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.
+ */
+
+#include <linux/module.h>
+
+static int __init example_module_init(void)
+{
+ printk("Just an example\n");
+ return -ENOANO;
+}
+
+module_init(example_module_init);
+
+MODULE_LICENSE("GPL");
--
2.13.6
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-02-08 15:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
2018-02-08 15:05 ` [PATCH 1/8] Forward proxy settings to dpkg build Jan Kiszka
2018-02-08 15:05 ` [PATCH 2/8] Prioritize isar-apt repo over all others Jan Kiszka
2018-02-08 15:05 ` [PATCH 3/8] Replace SRC_DIR with S Jan Kiszka
2018-02-08 15:05 ` [PATCH 4/8] Install kernel via replaceable recipe Jan Kiszka
2018-02-08 15:05 ` [PATCH 5/8] Provide include file for easy custom kernel builds Jan Kiszka
2018-02-08 15:05 ` [PATCH 6/8] Add custom kernel examples Jan Kiszka
2018-02-08 15:05 ` [PATCH 7/8] Provide include file for easy custom module builds Jan Kiszka
2018-02-08 15:05 ` [PATCH 8/8] Add exemplary kernel module Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox