All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc
@ 2020-01-15 18:08 Paul Barker
  2020-01-15 18:08 ` [PATCH 1/3] kernel-yocto: Move defaults and tasks from linux-yocto.inc into bbclass Paul Barker
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Paul Barker @ 2020-01-15 18:08 UTC (permalink / raw)
  To: openembedded-core

Patch 1 allows the kernel-yocto bbclass to be inherited directly in a recipe
without needing to use linux-yocto.inc. I can then use kconfig fragments in
my kernel recipe without pulling in the whole of linux-yocto.inc (which
includes some things I don't want like KERNEL_FEATURES changes and the
LINUX_VERSION_EXTENSION default).

Patches 2 & 3 fix some minor issues I spotted while working on this.

I've tested that linux-yocto can still be built for qemux86 after these
changes.

Paul Barker (3):
  kernel-yocto: Move defaults and tasks from linux-yocto.inc into
    bbclass
  kernel-yocto: Drop setting of unused variables in do_kernel_metadata
  kernel-yocto: Only override CONFIG_LOCALVERSION if
    LINUX_VERSION_EXTENSION is set

 meta/classes/kernel-yocto.bbclass         | 34 +++++++++++++++++------
 meta/recipes-kernel/linux/linux-yocto.inc | 21 --------------
 2 files changed, 25 insertions(+), 30 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] kernel-yocto: Move defaults and tasks from linux-yocto.inc into bbclass
  2020-01-15 18:08 [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc Paul Barker
@ 2020-01-15 18:08 ` Paul Barker
  2020-01-15 18:08 ` [PATCH 2/3] kernel-yocto: Drop setting of unused variables in do_kernel_metadata Paul Barker
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Paul Barker @ 2020-01-15 18:08 UTC (permalink / raw)
  To: openembedded-core

This allows the kernel-yocto bbclass to be inherited in a recipe without
needing to include linux-yocto.inc. The bbclass should stand on its own
and linux-yocto.inc does a few things which may not be desired in other
kernel recipes (such as modifying KERNEL_FEATURES).

The LINUX_VERSION_EXTENSION default is not moved as other kernel recipes
may not want this setting in place.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
---
 meta/classes/kernel-yocto.bbclass         | 21 +++++++++++++++++++++
 meta/recipes-kernel/linux/linux-yocto.inc | 21 ---------------------
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 87c681f1c3..8b22c34243 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -3,6 +3,22 @@ SRCTREECOVEREDTASKS += "do_kernel_configme do_validate_branches do_kernel_config
 PATCH_GIT_USER_EMAIL ?= "kernel-yocto@oe"
 PATCH_GIT_USER_NAME ?= "OpenEmbedded"
 
+# The distro or local.conf should set this, but if nobody cares...
+LINUX_KERNEL_TYPE ??= "standard"
+
+# KMETA ?= ""
+KBRANCH ?= "master"
+KMACHINE ?= "${MACHINE}"
+SRCREV_FORMAT ?= "meta_machine"
+
+# LEVELS:
+#   0: no reporting
+#   1: report options that are specified, but not in the final config
+#   2: report options that are not hardware related, but set by a BSP
+KCONF_AUDIT_LEVEL ?= "1"
+KCONF_BSP_AUDIT_LEVEL ?= "0"
+KMETA_AUDIT ?= "yes"
+
 # returns local (absolute) path names for all valid patches in the
 # src_uri
 def find_patches(d,subdir):
@@ -474,3 +490,8 @@ python () {
     if 'do_diffconfig' in d:
         bb.build.addtask('do_diffconfig', None, 'do_kernel_configme', d)
 }
+
+# extra tasks
+addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before do_compile
+addtask validate_branches before do_patch after do_kernel_checkout
+addtask kernel_configcheck after do_configure before do_compile
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index f191946f2a..91df9c1cd5 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -39,22 +39,6 @@ KERNEL_FEATURES_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'fea
 # and it can be specific to the machine or shared
 # KMACHINE = "UNDEFINED"
 
-# The distro or local.conf should set this, but if nobody cares...
-LINUX_KERNEL_TYPE ??= "standard"
-
-# KMETA ?= ""
-KBRANCH ?= "master"
-KMACHINE ?= "${MACHINE}"
-SRCREV_FORMAT ?= "meta_machine" 
-
-# LEVELS:
-#   0: no reporting
-#   1: report options that are specified, but not in the final config
-#   2: report options that are not hardware related, but set by a BSP
-KCONF_AUDIT_LEVEL ?= "1"
-KCONF_BSP_AUDIT_LEVEL ?= "0"
-KMETA_AUDIT ?= "yes"
-
 LINUX_VERSION_EXTENSION ??= "-yocto-${LINUX_KERNEL_TYPE}"
 
 # Pick up shared functions
@@ -69,10 +53,5 @@ do_install_append(){
 	fi
 }
 
-# extra tasks
-addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before do_compile
-addtask validate_branches before do_patch after do_kernel_checkout
-addtask kernel_configcheck after do_configure before do_compile
-
 # enable kernel-sample for oeqa/runtime/cases's ksample.py test
 KERNEL_FEATURES_append_qemuall=" features/kernel-sample/kernel-sample.scc"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] kernel-yocto: Drop setting of unused variables in do_kernel_metadata
  2020-01-15 18:08 [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc Paul Barker
  2020-01-15 18:08 ` [PATCH 1/3] kernel-yocto: Move defaults and tasks from linux-yocto.inc into bbclass Paul Barker
@ 2020-01-15 18:08 ` Paul Barker
  2020-01-15 18:08 ` [PATCH 3/3] kernel-yocto: Only override CONFIG_LOCALVERSION if LINUX_VERSION_EXTENSION is set Paul Barker
  2020-01-15 18:36 ` [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc Bruce Ashfield
  3 siblings, 0 replies; 7+ messages in thread
From: Paul Barker @ 2020-01-15 18:08 UTC (permalink / raw)
  To: openembedded-core

The machine_branch and machine_srcrev variables were set but not used in
do_kernel_metadata.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
---
 meta/classes/kernel-yocto.bbclass | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 8b22c34243..70e131101e 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -99,13 +99,6 @@ do_kernel_metadata() {
 		fi
 	fi
 
-	machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
-	machine_srcrev="${SRCREV_machine}"
-	if [ -z "${machine_srcrev}" ]; then
-		# fallback to SRCREV if a non machine_meta tree is being built
-		machine_srcrev="${SRCREV}"
-	fi
-
 	# In a similar manner to the kernel itself:
 	#
 	#   defconfig: $(obj)/conf
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] kernel-yocto: Only override CONFIG_LOCALVERSION if LINUX_VERSION_EXTENSION is set
  2020-01-15 18:08 [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc Paul Barker
  2020-01-15 18:08 ` [PATCH 1/3] kernel-yocto: Move defaults and tasks from linux-yocto.inc into bbclass Paul Barker
  2020-01-15 18:08 ` [PATCH 2/3] kernel-yocto: Drop setting of unused variables in do_kernel_metadata Paul Barker
@ 2020-01-15 18:08 ` Paul Barker
  2020-01-15 18:36 ` [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc Bruce Ashfield
  3 siblings, 0 replies; 7+ messages in thread
From: Paul Barker @ 2020-01-15 18:08 UTC (permalink / raw)
  To: openembedded-core

CONFIG_LOCALVERSION may already be set in a defconfig or config fragment
and this should not be unconditionally overridden.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
---
 meta/classes/kernel-yocto.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 70e131101e..597abe7727 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -359,8 +359,10 @@ do_kernel_configme() {
 		bbfatal_log "Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}"
 	fi
 
-	echo "# Global settings from linux recipe" >> ${B}/.config
-	echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
+	if [ ! -z "${LINUX_VERSION_EXTENSION}" ]; then
+		echo "# Global settings from linux recipe" >> ${B}/.config
+		echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
+	fi
 }
 
 addtask kernel_configme before do_configure after do_patch
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc
  2020-01-15 18:08 [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc Paul Barker
                   ` (2 preceding siblings ...)
  2020-01-15 18:08 ` [PATCH 3/3] kernel-yocto: Only override CONFIG_LOCALVERSION if LINUX_VERSION_EXTENSION is set Paul Barker
@ 2020-01-15 18:36 ` Bruce Ashfield
  2020-01-15 18:46   ` Bruce Ashfield
  3 siblings, 1 reply; 7+ messages in thread
From: Bruce Ashfield @ 2020-01-15 18:36 UTC (permalink / raw)
  To: Paul Barker; +Cc: Patches and discussions about the oe-core layer

I already have an entire queue in development for this.

So hold onto this series. I'll publish my branch later this week, or early next.

Bruce

On Wed, Jan 15, 2020 at 1:08 PM Paul Barker <pbarker@konsulko.com> wrote:
>
> Patch 1 allows the kernel-yocto bbclass to be inherited directly in a recipe
> without needing to use linux-yocto.inc. I can then use kconfig fragments in
> my kernel recipe without pulling in the whole of linux-yocto.inc (which
> includes some things I don't want like KERNEL_FEATURES changes and the
> LINUX_VERSION_EXTENSION default).
>
> Patches 2 & 3 fix some minor issues I spotted while working on this.
>
> I've tested that linux-yocto can still be built for qemux86 after these
> changes.
>
> Paul Barker (3):
>   kernel-yocto: Move defaults and tasks from linux-yocto.inc into
>     bbclass
>   kernel-yocto: Drop setting of unused variables in do_kernel_metadata
>   kernel-yocto: Only override CONFIG_LOCALVERSION if
>     LINUX_VERSION_EXTENSION is set
>
>  meta/classes/kernel-yocto.bbclass         | 34 +++++++++++++++++------
>  meta/recipes-kernel/linux/linux-yocto.inc | 21 --------------
>  2 files changed, 25 insertions(+), 30 deletions(-)
>
> --
> 2.20.1
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc
  2020-01-15 18:36 ` [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc Bruce Ashfield
@ 2020-01-15 18:46   ` Bruce Ashfield
  2020-01-24 23:14     ` Bruce Ashfield
  0 siblings, 1 reply; 7+ messages in thread
From: Bruce Ashfield @ 2020-01-15 18:46 UTC (permalink / raw)
  To: Paul Barker; +Cc: Patches and discussions about the oe-core layer

On Wed, Jan 15, 2020 at 1:36 PM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
>
> I already have an entire queue in development for this.
>
> So hold onto this series. I'll publish my branch later this week, or early next.

Actually, I'll see how it stacks on top of my changes and send a
unified branch to try out. That's probably the easiest way to get them
all working together.

Patches 2/3 look good, but I'd rather wait until we have the whole
series ready to go before Acking.

Cheers,

Bruce

>
> Bruce
>
> On Wed, Jan 15, 2020 at 1:08 PM Paul Barker <pbarker@konsulko.com> wrote:
> >
> > Patch 1 allows the kernel-yocto bbclass to be inherited directly in a recipe
> > without needing to use linux-yocto.inc. I can then use kconfig fragments in
> > my kernel recipe without pulling in the whole of linux-yocto.inc (which
> > includes some things I don't want like KERNEL_FEATURES changes and the
> > LINUX_VERSION_EXTENSION default).
> >
> > Patches 2 & 3 fix some minor issues I spotted while working on this.
> >
> > I've tested that linux-yocto can still be built for qemux86 after these
> > changes.
> >
> > Paul Barker (3):
> >   kernel-yocto: Move defaults and tasks from linux-yocto.inc into
> >     bbclass
> >   kernel-yocto: Drop setting of unused variables in do_kernel_metadata
> >   kernel-yocto: Only override CONFIG_LOCALVERSION if
> >     LINUX_VERSION_EXTENSION is set
> >
> >  meta/classes/kernel-yocto.bbclass         | 34 +++++++++++++++++------
> >  meta/recipes-kernel/linux/linux-yocto.inc | 21 --------------
> >  2 files changed, 25 insertions(+), 30 deletions(-)
> >
> > --
> > 2.20.1
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II



--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc
  2020-01-15 18:46   ` Bruce Ashfield
@ 2020-01-24 23:14     ` Bruce Ashfield
  0 siblings, 0 replies; 7+ messages in thread
From: Bruce Ashfield @ 2020-01-24 23:14 UTC (permalink / raw)
  To: Paul Barker; +Cc: Patches and discussions about the oe-core layer

On Wed, Jan 15, 2020 at 1:46 PM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
>
> On Wed, Jan 15, 2020 at 1:36 PM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> >
> > I already have an entire queue in development for this.
> >
> > So hold onto this series. I'll publish my branch later this week, or early next.
>
> Actually, I'll see how it stacks on top of my changes and send a
> unified branch to try out. That's probably the easiest way to get them
> all working together.
>
> Patches 2/3 look good, but I'd rather wait until we have the whole
> series ready to go before Acking.

I haven't forgotten about this, but the issues with 5.4 as the
reference/LTS kernel popped back up and I didn't get a chance to stack
this and test with my other kernel-yocto changes.  I will get to it
shortly though.

Bruce

>
> Cheers,
>
> Bruce
>
> >
> > Bruce
> >
> > On Wed, Jan 15, 2020 at 1:08 PM Paul Barker <pbarker@konsulko.com> wrote:
> > >
> > > Patch 1 allows the kernel-yocto bbclass to be inherited directly in a recipe
> > > without needing to use linux-yocto.inc. I can then use kconfig fragments in
> > > my kernel recipe without pulling in the whole of linux-yocto.inc (which
> > > includes some things I don't want like KERNEL_FEATURES changes and the
> > > LINUX_VERSION_EXTENSION default).
> > >
> > > Patches 2 & 3 fix some minor issues I spotted while working on this.
> > >
> > > I've tested that linux-yocto can still be built for qemux86 after these
> > > changes.
> > >
> > > Paul Barker (3):
> > >   kernel-yocto: Move defaults and tasks from linux-yocto.inc into
> > >     bbclass
> > >   kernel-yocto: Drop setting of unused variables in do_kernel_metadata
> > >   kernel-yocto: Only override CONFIG_LOCALVERSION if
> > >     LINUX_VERSION_EXTENSION is set
> > >
> > >  meta/classes/kernel-yocto.bbclass         | 34 +++++++++++++++++------
> > >  meta/recipes-kernel/linux/linux-yocto.inc | 21 --------------
> > >  2 files changed, 25 insertions(+), 30 deletions(-)
> > >
> > > --
> > > 2.20.1
> > >
> >
> >
> > --
> > - Thou shalt not follow the NULL pointer, for chaos and madness await
> > thee at its end
> > - "Use the force Harry" - Gandalf, Star Trek II
>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-24 23:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 18:08 [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc Paul Barker
2020-01-15 18:08 ` [PATCH 1/3] kernel-yocto: Move defaults and tasks from linux-yocto.inc into bbclass Paul Barker
2020-01-15 18:08 ` [PATCH 2/3] kernel-yocto: Drop setting of unused variables in do_kernel_metadata Paul Barker
2020-01-15 18:08 ` [PATCH 3/3] kernel-yocto: Only override CONFIG_LOCALVERSION if LINUX_VERSION_EXTENSION is set Paul Barker
2020-01-15 18:36 ` [PATCH 0/3] Make kernel-yocto bbclass usable without linux-yocto.inc Bruce Ashfield
2020-01-15 18:46   ` Bruce Ashfield
2020-01-24 23:14     ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.