diff mbox series

[v2] kernel-yocto: enable fetching kernel metadata using file fetcher

Message ID 20241220153004.2199488-1-christian.taedcke-oss@weidmueller.com
State New
Headers show
Series [v2] kernel-yocto: enable fetching kernel metadata using file fetcher | expand

Commit Message

Taedcke, Christian Dec. 20, 2024, 3:30 p.m. UTC
From: Christian Taedcke <christian.taedcke@weidmueller.com>

If no destsuffix parameter is supplied and the file fetcher is used,
the folder name (i.e. basepath) is added to the kernel-meta search
directories.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
---

Changes in v2:
- always use destsuffix if available
- do not restict fetcher type

 meta/classes-recipe/kernel-yocto.bbclass | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Bruce Ashfield Dec. 20, 2024, 4:25 p.m. UTC | #1
On Fri, Dec 20, 2024 at 10:30 AM <christian.taedcke-oss@weidmueller.com>
wrote:

> From: Christian Taedcke <christian.taedcke@weidmueller.com>
>
> If no destsuffix parameter is supplied and the file fetcher is used,
> the folder name (i.e. basepath) is added to the kernel-meta search
> directories.
>
> Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
> ---
>
> Changes in v2:
> - always use destsuffix if available
> - do not restict fetcher type
>

I was just looking at v1 a few days ago, to see how I could tweak
it and simplify a bit.

This version looks better to me, so I have no concerns as existing
user cases shouldn't be impacted.

Bruce



>
>  meta/classes-recipe/kernel-yocto.bbclass | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/meta/classes-recipe/kernel-yocto.bbclass
> b/meta/classes-recipe/kernel-yocto.bbclass
> index a5d89dc2c8..7d80e9aa52 100644
> --- a/meta/classes-recipe/kernel-yocto.bbclass
> +++ b/meta/classes-recipe/kernel-yocto.bbclass
> @@ -62,8 +62,8 @@ def find_sccs(d):
>
>      return sources_list
>
> -# check the SRC_URI for "kmeta" type'd git repositories. Return the name
> of
> -# the repository as it will be found in UNPACKDIR
> +# check the SRC_URI for "kmeta" type'd git repositories and directories.
> Return
> +# the name of the repository or directory as it will be found in UNPACKDIR
>  def find_kernel_feature_dirs(d):
>      feature_dirs=[]
>      fetch = bb.fetch2.Fetch([], d)
> @@ -71,13 +71,16 @@ def find_kernel_feature_dirs(d):
>          urldata = fetch.ud[url]
>          parm = urldata.parm
>          type=""
> +        destdir = ""
>          if "type" in parm:
>              type = parm["type"]
>          if "destsuffix" in parm:
>              destdir = parm["destsuffix"]
> -            if type == "kmeta":
> -                feature_dirs.append(destdir)
> -
> +        elif urldata.type == "file":
> +            destdir = urldata.basepath
> +        if type == "kmeta" and destdir:
> +            feature_dirs.append(destdir)
> +
>      return feature_dirs
>
>  # find the master/machine source branch. In the same way that the fetcher
> proceses
> --
> 2.34.1
>
>
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index a5d89dc2c8..7d80e9aa52 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -62,8 +62,8 @@  def find_sccs(d):
 
     return sources_list
 
-# check the SRC_URI for "kmeta" type'd git repositories. Return the name of
-# the repository as it will be found in UNPACKDIR
+# check the SRC_URI for "kmeta" type'd git repositories and directories. Return
+# the name of the repository or directory as it will be found in UNPACKDIR
 def find_kernel_feature_dirs(d):
     feature_dirs=[]
     fetch = bb.fetch2.Fetch([], d)
@@ -71,13 +71,16 @@  def find_kernel_feature_dirs(d):
         urldata = fetch.ud[url]
         parm = urldata.parm
         type=""
+        destdir = ""
         if "type" in parm:
             type = parm["type"]
         if "destsuffix" in parm:
             destdir = parm["destsuffix"]
-            if type == "kmeta":
-                feature_dirs.append(destdir)
-	    
+        elif urldata.type == "file":
+            destdir = urldata.basepath
+        if type == "kmeta" and destdir:
+            feature_dirs.append(destdir)
+
     return feature_dirs
 
 # find the master/machine source branch. In the same way that the fetcher proceses