diff mbox series

[isar-cip-core,v3,7/9] add linux 6.1 mainline kernel

Message ID 20230302152659.2096307-8-felix.moessbauer@siemens.com (mailing list archive)
State Superseded
Headers show
Series Add swupdate support for riscv64 | expand

Commit Message

Felix Moessbauer March 2, 2023, 3:26 p.m. UTC
This patch adds the vanilla 6.1 linux kernel for testing and for boards
which need a more recent kernel than what CIP can offer.
The kernel can be selected from the menu, similar to the other kernels.
As defconfig, we always use the kernels internal configuration, because
there is no cip-kernel-config for that version yet. In addition, the
squashfs knob is selected to support the swupdate pattern without any
modifications.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 Kconfig                                    |  4 ++++
 kas/opt/6.1-mainline.yml                   | 18 ++++++++++++++++++
 recipes-kernel/linux/files/squashfs.cfg    |  1 +
 recipes-kernel/linux/linux-mainline_6.1.bb | 18 ++++++++++++++++++
 4 files changed, 41 insertions(+)
 create mode 100644 kas/opt/6.1-mainline.yml
 create mode 100644 recipes-kernel/linux/files/squashfs.cfg
 create mode 100644 recipes-kernel/linux/linux-mainline_6.1.bb

Comments

Jan Kiszka March 3, 2023, 7:19 a.m. UTC | #1
On 02.03.23 16:26, Felix Moessbauer wrote:
> This patch adds the vanilla 6.1 linux kernel for testing and for boards
> which need a more recent kernel than what CIP can offer.
> The kernel can be selected from the menu, similar to the other kernels.
> As defconfig, we always use the kernels internal configuration, because
> there is no cip-kernel-config for that version yet. In addition, the
> squashfs knob is selected to support the swupdate pattern without any
> modifications.

We just decided in CIP to start 6.1-cip development, so we could also
start filling cip-kernel-config with related 6.1 entries, already
including additional knobs we need. Actually, I suspect you could add
squashfs to the 5.10 riscv defconfig and use that for now, avoiding the
snippet here.

And once a 6.1-cip kernel branch exist, we should switch this recipe over.

> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>  Kconfig                                    |  4 ++++
>  kas/opt/6.1-mainline.yml                   | 18 ++++++++++++++++++
>  recipes-kernel/linux/files/squashfs.cfg    |  1 +
>  recipes-kernel/linux/linux-mainline_6.1.bb | 18 ++++++++++++++++++
>  4 files changed, 41 insertions(+)
>  create mode 100644 kas/opt/6.1-mainline.yml
>  create mode 100644 recipes-kernel/linux/files/squashfs.cfg
>  create mode 100644 recipes-kernel/linux/linux-mainline_6.1.bb
> 
> diff --git a/Kconfig b/Kconfig
> index cd24ce2..a932bbe 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -97,6 +97,9 @@ config KERNEL_4_19
>  config KERNEL_5_10
>  	bool "Kernel 5.10.x-cip"
>  
> +config KERNEL_6_1_MAINLINE
> +	bool "Kernel 6.1.x-mainline"
> +
>  endchoice
>  
>  config KAS_INCLUDE_KERNEL
> @@ -104,6 +107,7 @@ config KAS_INCLUDE_KERNEL
>  	default "kas/opt/4.4.yml" if KERNEL_4_4
>  	default "kas/opt/4.19.yml" if KERNEL_4_19
>  	default "kas/opt/5.10.yml" if KERNEL_5_10
> +	default "kas/opt/6.1-mainline.yml" if KERNEL_6_1_MAINLINE
>  
>  config KERNEL_RT
>  	bool "Real-time CIP kernel"
> diff --git a/kas/opt/6.1-mainline.yml b/kas/opt/6.1-mainline.yml
> new file mode 100644
> index 0000000..84d12b0
> --- /dev/null
> +++ b/kas/opt/6.1-mainline.yml
> @@ -0,0 +1,18 @@
> +#
> +# CIP Core, generic profile
> +#
> +# Copyright (c) Siemens AG, 2023
> +#
> +# Authors:
> +#  Felix Moessbauer <felix.moessbauer@siemens.com>
> +#
> +# SPDX-License-Identifier: MIT
> +#
> +
> +header:
> +  version: 12
> +
> +local_conf_header:
> +  kernel-version: |
> +    KERNEL_DEFCONFIG = ""
> +    KERNEL_NAME = "mainline"
> diff --git a/recipes-kernel/linux/files/squashfs.cfg b/recipes-kernel/linux/files/squashfs.cfg
> new file mode 100644
> index 0000000..7a89d00
> --- /dev/null
> +++ b/recipes-kernel/linux/files/squashfs.cfg
> @@ -0,0 +1 @@
> +CONFIG_SQUASHFS=y
> diff --git a/recipes-kernel/linux/linux-mainline_6.1.bb b/recipes-kernel/linux/linux-mainline_6.1.bb
> new file mode 100644
> index 0000000..8a879a0
> --- /dev/null
> +++ b/recipes-kernel/linux/linux-mainline_6.1.bb

Please use at least an up-to-date version, ie. 6.1.14.

> @@ -0,0 +1,18 @@
> +# Example recipe for building the mainline kernel
> +#
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2018-2020
> +#
> +# SPDX-License-Identifier: MIT
> +
> +require recipes-kernel/linux/linux-custom.inc
> +
> +ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else d.getVar('PV') }"
> +
> +SRC_URI += " \
> +    https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
> +    file://squashfs.cfg"
> +
> +SRC_URI[sha256sum] = "2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb"
> +
> +S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"

Jan
Felix Moessbauer March 3, 2023, 8:40 a.m. UTC | #2
On Fri, 2023-03-03 at 08:19 +0100, Jan Kiszka wrote:
> On 02.03.23 16:26, Felix Moessbauer wrote:
> > This patch adds the vanilla 6.1 linux kernel for testing and for
> > boards
> > which need a more recent kernel than what CIP can offer.
> > The kernel can be selected from the menu, similar to the other
> > kernels.
> > As defconfig, we always use the kernels internal configuration,
> > because
> > there is no cip-kernel-config for that version yet. In addition,
> > the
> > squashfs knob is selected to support the swupdate pattern without
> > any
> > modifications.
> 
> We just decided in CIP to start 6.1-cip development, so we could also
> start filling cip-kernel-config with related 6.1 entries, already
> including additional knobs we need. Actually, I suspect you could add
> squashfs to the 5.10 riscv defconfig and use that for now, avoiding
> the
> snippet here.

I could, but I don't like to mix up versions here: Having a 6.1 kernel
with a defconfig that is written for 5.10 feels somehow strange. That's
why I decided to start with the plain defconfig from the kernel and
just add what was missing.

As this squashfs=m default bit us now for many times (e.g. required
distro kernels), I'm thinking about simply always adding the initramfs
hook. In case squashfs is already enabled, a modprobe does not hurt
anyways.

Felix

> 
> And once a 6.1-cip kernel branch exist, we should switch this recipe
> over.
> 
> > 
> > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> > ---
> >  Kconfig                                    |  4 ++++
> >  kas/opt/6.1-mainline.yml                   | 18 ++++++++++++++++++
> >  recipes-kernel/linux/files/squashfs.cfg    |  1 +
> >  recipes-kernel/linux/linux-mainline_6.1.bb | 18 ++++++++++++++++++
> >  4 files changed, 41 insertions(+)
> >  create mode 100644 kas/opt/6.1-mainline.yml
> >  create mode 100644 recipes-kernel/linux/files/squashfs.cfg
> >  create mode 100644 recipes-kernel/linux/linux-mainline_6.1.bb
> > 
> > diff --git a/Kconfig b/Kconfig
> > index cd24ce2..a932bbe 100644
> > --- a/Kconfig
> > +++ b/Kconfig
> > @@ -97,6 +97,9 @@ config KERNEL_4_19
> >  config KERNEL_5_10
> >         bool "Kernel 5.10.x-cip"
> >  
> > +config KERNEL_6_1_MAINLINE
> > +       bool "Kernel 6.1.x-mainline"
> > +
> >  endchoice
> >  
> >  config KAS_INCLUDE_KERNEL
> > @@ -104,6 +107,7 @@ config KAS_INCLUDE_KERNEL
> >         default "kas/opt/4.4.yml" if KERNEL_4_4
> >         default "kas/opt/4.19.yml" if KERNEL_4_19
> >         default "kas/opt/5.10.yml" if KERNEL_5_10
> > +       default "kas/opt/6.1-mainline.yml" if KERNEL_6_1_MAINLINE
> >  
> >  config KERNEL_RT
> >         bool "Real-time CIP kernel"
> > diff --git a/kas/opt/6.1-mainline.yml b/kas/opt/6.1-mainline.yml
> > new file mode 100644
> > index 0000000..84d12b0
> > --- /dev/null
> > +++ b/kas/opt/6.1-mainline.yml
> > @@ -0,0 +1,18 @@
> > +#
> > +# CIP Core, generic profile
> > +#
> > +# Copyright (c) Siemens AG, 2023
> > +#
> > +# Authors:
> > +#  Felix Moessbauer <felix.moessbauer@siemens.com>
> > +#
> > +# SPDX-License-Identifier: MIT
> > +#
> > +
> > +header:
> > +  version: 12
> > +
> > +local_conf_header:
> > +  kernel-version: |
> > +    KERNEL_DEFCONFIG = ""
> > +    KERNEL_NAME = "mainline"
> > diff --git a/recipes-kernel/linux/files/squashfs.cfg b/recipes-
> > kernel/linux/files/squashfs.cfg
> > new file mode 100644
> > index 0000000..7a89d00
> > --- /dev/null
> > +++ b/recipes-kernel/linux/files/squashfs.cfg
> > @@ -0,0 +1 @@
> > +CONFIG_SQUASHFS=y
> > diff --git a/recipes-kernel/linux/linux-mainline_6.1.bb b/recipes-
> > kernel/linux/linux-mainline_6.1.bb
> > new file mode 100644
> > index 0000000..8a879a0
> > --- /dev/null
> > +++ b/recipes-kernel/linux/linux-mainline_6.1.bb
> 
> Please use at least an up-to-date version, ie. 6.1.14.
> 
> > @@ -0,0 +1,18 @@
> > +# Example recipe for building the mainline kernel
> > +#
> > +# This software is a part of ISAR.
> > +# Copyright (c) Siemens AG, 2018-2020
> > +#
> > +# SPDX-License-Identifier: MIT
> > +
> > +require recipes-kernel/linux/linux-custom.inc
> > +
> > +ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if
> > d.getVar('PV').endswith('.0') else d.getVar('PV') }"
> > +
> > +SRC_URI += " \
> > +    
> > https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz
> >  \
> > +    file://squashfs.cfg"
> > +
> > +SRC_URI[sha256sum] =
> > "2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb"
> > +
> > +S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"
> 
> Jan
>
Jan Kiszka March 3, 2023, 8:46 a.m. UTC | #3
On 03.03.23 09:40, Moessbauer, Felix (T CED INW-CN) wrote:
> On Fri, 2023-03-03 at 08:19 +0100, Jan Kiszka wrote:
>> On 02.03.23 16:26, Felix Moessbauer wrote:
>>> This patch adds the vanilla 6.1 linux kernel for testing and for
>>> boards
>>> which need a more recent kernel than what CIP can offer.
>>> The kernel can be selected from the menu, similar to the other
>>> kernels.
>>> As defconfig, we always use the kernels internal configuration,
>>> because
>>> there is no cip-kernel-config for that version yet. In addition,
>>> the
>>> squashfs knob is selected to support the swupdate pattern without
>>> any
>>> modifications.
>>
>> We just decided in CIP to start 6.1-cip development, so we could also
>> start filling cip-kernel-config with related 6.1 entries, already
>> including additional knobs we need. Actually, I suspect you could add
>> squashfs to the 5.10 riscv defconfig and use that for now, avoiding
>> the
>> snippet here.
> 
> I could, but I don't like to mix up versions here: Having a 6.1 kernel
> with a defconfig that is written for 5.10 feels somehow strange. That's
> why I decided to start with the plain defconfig from the kernel and
> just add what was missing.
> 
> As this squashfs=m default bit us now for many times (e.g. required
> distro kernels), I'm thinking about simply always adding the initramfs
> hook. In case squashfs is already enabled, a modprobe does not hurt
> anyways.

Makes sense.

Jan
Felix Moessbauer March 3, 2023, 8:59 a.m. UTC | #4
On Fri, 2023-03-03 at 09:46 +0100, Jan Kiszka wrote:
> On 03.03.23 09:40, Moessbauer, Felix (T CED INW-CN) wrote:
> > On Fri, 2023-03-03 at 08:19 +0100, Jan Kiszka wrote:
> > > On 02.03.23 16:26, Felix Moessbauer wrote:
> > > > This patch adds the vanilla 6.1 linux kernel for testing and
> > > > for
> > > > boards
> > > > which need a more recent kernel than what CIP can offer.
> > > > The kernel can be selected from the menu, similar to the other
> > > > kernels.
> > > > As defconfig, we always use the kernels internal configuration,
> > > > because
> > > > there is no cip-kernel-config for that version yet. In
> > > > addition,
> > > > the
> > > > squashfs knob is selected to support the swupdate pattern
> > > > without
> > > > any
> > > > modifications.
> > > 
> > > We just decided in CIP to start 6.1-cip development, so we could
> > > also
> > > start filling cip-kernel-config with related 6.1 entries, already
> > > including additional knobs we need. Actually, I suspect you could
> > > add
> > > squashfs to the 5.10 riscv defconfig and use that for now,
> > > avoiding
> > > the
> > > snippet here.
> > 
> > I could, but I don't like to mix up versions here: Having a 6.1
> > kernel
> > with a defconfig that is written for 5.10 feels somehow strange.
> > That's
> > why I decided to start with the plain defconfig from the kernel and
> > just add what was missing.
> > 
> > As this squashfs=m default bit us now for many times (e.g. required
> > distro kernels), I'm thinking about simply always adding the
> > initramfs
> > hook. In case squashfs is already enabled, a modprobe does not hurt
> > anyways.
> 
> Makes sense.

I just saw that we already do it this way (it was different in the
past), but the vanilla defconfig has SQUASHFS=n. By that, we somewhere
have to flip the switch. If we will get the 6.1 cip-kernel-config
rather soon, I vote for waiting. Otherwise I would just keep it as it
currently is (dedicated file).

Felix

> 
> Jan
>
Jan Kiszka March 3, 2023, 10 a.m. UTC | #5
On 03.03.23 09:59, Moessbauer, Felix (T CED INW-CN) wrote:
> On Fri, 2023-03-03 at 09:46 +0100, Jan Kiszka wrote:
>> On 03.03.23 09:40, Moessbauer, Felix (T CED INW-CN) wrote:
>>> On Fri, 2023-03-03 at 08:19 +0100, Jan Kiszka wrote:
>>>> On 02.03.23 16:26, Felix Moessbauer wrote:
>>>>> This patch adds the vanilla 6.1 linux kernel for testing and
>>>>> for
>>>>> boards
>>>>> which need a more recent kernel than what CIP can offer.
>>>>> The kernel can be selected from the menu, similar to the other
>>>>> kernels.
>>>>> As defconfig, we always use the kernels internal configuration,
>>>>> because
>>>>> there is no cip-kernel-config for that version yet. In
>>>>> addition,
>>>>> the
>>>>> squashfs knob is selected to support the swupdate pattern
>>>>> without
>>>>> any
>>>>> modifications.
>>>>
>>>> We just decided in CIP to start 6.1-cip development, so we could
>>>> also
>>>> start filling cip-kernel-config with related 6.1 entries, already
>>>> including additional knobs we need. Actually, I suspect you could
>>>> add
>>>> squashfs to the 5.10 riscv defconfig and use that for now,
>>>> avoiding
>>>> the
>>>> snippet here.
>>>
>>> I could, but I don't like to mix up versions here: Having a 6.1
>>> kernel
>>> with a defconfig that is written for 5.10 feels somehow strange.
>>> That's
>>> why I decided to start with the plain defconfig from the kernel and
>>> just add what was missing.
>>>
>>> As this squashfs=m default bit us now for many times (e.g. required
>>> distro kernels), I'm thinking about simply always adding the
>>> initramfs
>>> hook. In case squashfs is already enabled, a modprobe does not hurt
>>> anyways.
>>
>> Makes sense.
> 
> I just saw that we already do it this way (it was different in the
> past), but the vanilla defconfig has SQUASHFS=n. By that, we somewhere
> have to flip the switch. If we will get the 6.1 cip-kernel-config
> rather soon, I vote for waiting. Otherwise I would just keep it as it
> currently is (dedicated file).

You can accelerate the former by creating an MR on
https://gitlab.com/cip-project/cip-kernel/cip-kernel-config.

Jan
diff mbox series

Patch

diff --git a/Kconfig b/Kconfig
index cd24ce2..a932bbe 100644
--- a/Kconfig
+++ b/Kconfig
@@ -97,6 +97,9 @@  config KERNEL_4_19
 config KERNEL_5_10
 	bool "Kernel 5.10.x-cip"
 
+config KERNEL_6_1_MAINLINE
+	bool "Kernel 6.1.x-mainline"
+
 endchoice
 
 config KAS_INCLUDE_KERNEL
@@ -104,6 +107,7 @@  config KAS_INCLUDE_KERNEL
 	default "kas/opt/4.4.yml" if KERNEL_4_4
 	default "kas/opt/4.19.yml" if KERNEL_4_19
 	default "kas/opt/5.10.yml" if KERNEL_5_10
+	default "kas/opt/6.1-mainline.yml" if KERNEL_6_1_MAINLINE
 
 config KERNEL_RT
 	bool "Real-time CIP kernel"
diff --git a/kas/opt/6.1-mainline.yml b/kas/opt/6.1-mainline.yml
new file mode 100644
index 0000000..84d12b0
--- /dev/null
+++ b/kas/opt/6.1-mainline.yml
@@ -0,0 +1,18 @@ 
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2023
+#
+# Authors:
+#  Felix Moessbauer <felix.moessbauer@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+header:
+  version: 12
+
+local_conf_header:
+  kernel-version: |
+    KERNEL_DEFCONFIG = ""
+    KERNEL_NAME = "mainline"
diff --git a/recipes-kernel/linux/files/squashfs.cfg b/recipes-kernel/linux/files/squashfs.cfg
new file mode 100644
index 0000000..7a89d00
--- /dev/null
+++ b/recipes-kernel/linux/files/squashfs.cfg
@@ -0,0 +1 @@ 
+CONFIG_SQUASHFS=y
diff --git a/recipes-kernel/linux/linux-mainline_6.1.bb b/recipes-kernel/linux/linux-mainline_6.1.bb
new file mode 100644
index 0000000..8a879a0
--- /dev/null
+++ b/recipes-kernel/linux/linux-mainline_6.1.bb
@@ -0,0 +1,18 @@ 
+# Example recipe for building the mainline kernel
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018-2020
+#
+# SPDX-License-Identifier: MIT
+
+require recipes-kernel/linux/linux-custom.inc
+
+ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else d.getVar('PV') }"
+
+SRC_URI += " \
+    https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
+    file://squashfs.cfg"
+
+SRC_URI[sha256sum] = "2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb"
+
+S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"