diff mbox series

kernel-yocto: sort patches by filename

Message ID LO0P265MB29537DEB8276706CFBB05913AA8E2@LO0P265MB2953.GBRP265.PROD.OUTLOOK.COM
State New
Headers show
Series kernel-yocto: sort patches by filename | expand

Commit Message

Benjamin Shirley-Quirk May 6, 2025, 12:34 p.m. UTC
Currently patches are applied in the order in which they appear in SRC_URI.
As a result, patches split across multiple recipes are applied according to
recipe parse order, not patch order, which can cause them to fail.

This commit allows kernel patches split across multiple recipes to be applied
in a deterministic and controllable order: sorted alphabetically by
filename.

Signed-off-by: Benjamin Shirley-Quirk <benjamin.shirley-quirk@carallon.com>
---
 meta/classes-recipe/kernel-yocto.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bruce Ashfield May 6, 2025, 1 p.m. UTC | #1
On Tue, May 6, 2025 at 8:56 AM Benjamin Shirley-Quirk via
lists.openembedded.org <benjamin.shirley-quirk=
carallon.com@lists.openembedded.org> wrote:

> Currently patches are applied in the order in which they appear in SRC_URI.
> As a result, patches split across multiple recipes are applied according to
> recipe parse order, not patch order, which can cause them to fail.
>
> This commit allows kernel patches split across multiple recipes to be
> applied
> in a deterministic and controllable order: sorted alphabetically by
> filename.
>

They really do need to be applied in SRC_URI order. So no, this patch
cannot be merged.

Bruce



>
> Signed-off-by: Benjamin Shirley-Quirk <benjamin.shirley-quirk@carallon.com
> >
> ---
>  meta/classes-recipe/kernel-yocto.bbclass | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/kernel-yocto.bbclass
> b/meta/classes-recipe/kernel-yocto.bbclass
> index cef6b9ec3f..766098db28 100644
> --- a/meta/classes-recipe/kernel-yocto.bbclass
> +++ b/meta/classes-recipe/kernel-yocto.bbclass
> @@ -46,7 +46,8 @@ def find_patches(d,subdir):
>              # properly
>              if not patchdir:
>                  patch_list.append(local)
> -
> +    # sort patch_list so that they will be applied in filename-order
> +    patch_list.sort(key=os.path.basename)
>      return patch_list
>
>  # returns all the elements from the src uri that are .scc files
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#216043):
> https://lists.openembedded.org/g/openembedded-core/message/216043
> Mute This Topic: https://lists.openembedded.org/mt/112648149/1050810
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index cef6b9ec3f..766098db28 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -46,7 +46,8 @@  def find_patches(d,subdir):
             # properly
             if not patchdir:
                 patch_list.append(local)
-
+    # sort patch_list so that they will be applied in filename-order
+    patch_list.sort(key=os.path.basename)
     return patch_list

 # returns all the elements from the src uri that are .scc files