All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wic: Use custom kernel path if provided
@ 2022-02-15 16:54 Bill Pittman
  2022-03-02 18:15 ` Bill Pittman
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bill Pittman @ 2022-02-15 16:54 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

If the custom kernel path is provided in options, then
use that path instead of the default path.

Signed-off-by: Bill Pittman <bill.pittman@ni.com>
---
 scripts/wic | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/wic b/scripts/wic
index a741aed364..29a157bf37 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -159,6 +159,9 @@ def wic_create_subcommand(options, usage_str):
                            "(Use -e/--image-name to specify it)")
         native_sysroot = options.native_sysroot

+    if options.kernel_dir:
+        kernel_dir = options.kernel_dir
+
     if not options.vars_dir and (not native_sysroot or not os.path.isdir(native_sysroot)):
         logger.info("Building wic-tools...\n")
         subprocess.check_call(["bitbake", "wic-tools"])
--
2.25.1


INTERNAL - NI CONFIDENTIAL

[-- Attachment #2: Type: text/html, Size: 1799 bytes --]

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

* Re: [PATCH] wic: Use custom kernel path if provided
  2022-02-15 16:54 [PATCH] wic: Use custom kernel path if provided Bill Pittman
@ 2022-03-02 18:15 ` Bill Pittman
  2022-03-02 22:06 ` [OE-core] " Andrei Gherzan
  2022-03-02 23:02 ` [OE-core] " Richard Purdie
  2 siblings, 0 replies; 6+ messages in thread
From: Bill Pittman @ 2022-03-02 18:15 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

Hey all,

Gentle ping on this patch, any comments?

Thanks,
Bill

________________________________
From: Bill Pittman
Sent: Tuesday, February 15, 2022 10:54 AM
To: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org>
Subject: [PATCH] wic: Use custom kernel path if provided

If the custom kernel path is provided in options, then
use that path instead of the default path.



INTERNAL - NI CONFIDENTIAL

[-- Attachment #2: Type: text/html, Size: 1977 bytes --]

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

* Re: [OE-core] [PATCH] wic: Use custom kernel path if provided
  2022-02-15 16:54 [PATCH] wic: Use custom kernel path if provided Bill Pittman
  2022-03-02 18:15 ` Bill Pittman
@ 2022-03-02 22:06 ` Andrei Gherzan
       [not found]   ` <SN6PR04MB49098B84F7D5490D734B7EB1EC089@SN6PR04MB4909.namprd04.prod.outlook.com>
  2022-03-02 23:02 ` [OE-core] " Richard Purdie
  2 siblings, 1 reply; 6+ messages in thread
From: Andrei Gherzan @ 2022-03-02 22:06 UTC (permalink / raw)
  To: Bill Pittman; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 269 bytes --]


Feb 15, 2022 16:54:28 Bill Pittman <bill.pittman@ni.com>:

> If the custom kernel path is provided in options, then
> use that path instead of the default path.

Just to understand this a bit, what is your usecase here?
--
Andrei Gherzan
gpg: rsa4096/D4D94F67AD0E9640

[-- Attachment #2: Type: text/html, Size: 952 bytes --]

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

* Re: [OE-core] [PATCH] wic: Use custom kernel path if provided
  2022-02-15 16:54 [PATCH] wic: Use custom kernel path if provided Bill Pittman
  2022-03-02 18:15 ` Bill Pittman
  2022-03-02 22:06 ` [OE-core] " Andrei Gherzan
@ 2022-03-02 23:02 ` Richard Purdie
       [not found]   ` <SN6PR04MB4909394161091073345E1ACBEC089@SN6PR04MB4909.namprd04.prod.outlook.com>
  2 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2022-03-02 23:02 UTC (permalink / raw)
  To: Bill Pittman, openembedded-core

On Tue, 2022-02-15 at 16:54 +0000, Bill Pittman wrote:
> If the custom kernel path is provided in options, then
> use that path instead of the default path.
> 
> Signed-off-by: Bill Pittman <bill.pittman@ni.com>
> ---
>  scripts/wic | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/wic b/scripts/wic
> index a741aed364..29a157bf37 100755
> --- a/scripts/wic
> +++ b/scripts/wic
> @@ -159,6 +159,9 @@ def wic_create_subcommand(options, usage_str):
>                             "(Use -e/--image-name to specify it)")
>          native_sysroot = options.native_sysroot
>  
> +    if options.kernel_dir:
> +        kernel_dir = options.kernel_dir
> +
>      if not options.vars_dir and (not native_sysroot or not
> os.path.isdir(native_sysroot)):
>          logger.info("Building wic-tools...\n")
>          subprocess.check_call(["bitbake", "wic-tools"])


The concern with these kinds of changes is I can't really test it or tell if it
is the right thing to do and I worry about it regressing in the future.

Is there part of the test coverage we should be improving too? wic does have
fairly good coverage from oe-selftest -r wic

Cheers,

Richard


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

* [PATCH] wic: Use custom kernel path if provided
       [not found]   ` <SN6PR04MB49098B84F7D5490D734B7EB1EC089@SN6PR04MB4909.namprd04.prod.outlook.com>
@ 2022-03-07 16:37     ` Bill Pittman
  0 siblings, 0 replies; 6+ messages in thread
From: Bill Pittman @ 2022-03-07 16:37 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1915 bytes --]

Andrei,

In our build, we use a two stage build, the first stage builds the IPKs and packages files, the second stage builds the various images from the feeds created in the first stage.  We've run into a corner case when the kernel repo gets an update that bumps the version, if that happens, the kernel will rebuild during the second stage build (the kernel recipe is on AUTOREV).  Unfortunately, that now creates a new kernel with a newer version that the one in the pre-built feed.  The image recipe is then assembled using the prebuilt feed (and the older kernel), however the wic script picks up the new kernel.  Then when the wic image is booted, the new kernel in the boot portion of the wic image is unable to find the right version of modules and it panics.

This is only an issue during development while the kernel recipe is on autorev, but its causing other teams (and us) some grief and this change allows the wic script to always use a custom kernel path.  In this case it allows the wic script to use the path to the kernel installed in the image recipe.

The patch I'm proposing allows options.kernel_dir to always be used if its provided.  The current code in wic_create_subcommand has a code path where it is presently ignored.

Cheers,
Bill

________________________________
From: Andrei Gherzan <andrei@gherzan.com>
Sent: Wednesday, March 2, 2022 4:06 PM
To: Bill Pittman <bill.pittman@ni.com>
Cc: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org>
Subject: [EXTERNAL] Re: [OE-core] [PATCH] wic: Use custom kernel path if provided


Feb 15, 2022 16:54:28 Bill Pittman <bill.pittman@ni.com>:

> If the custom kernel path is provided in options, then
> use that path instead of the default path.

Just to understand this a bit, what is your usecase here?
--
Andrei Gherzan
gpg: rsa4096/D4D94F67AD0E9640


INTERNAL - NI CONFIDENTIAL

[-- Attachment #2: Type: text/html, Size: 3968 bytes --]

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

* [OE-core] [PATCH] wic: Use custom kernel path if provided
       [not found]   ` <SN6PR04MB4909394161091073345E1ACBEC089@SN6PR04MB4909.namprd04.prod.outlook.com>
@ 2022-03-07 16:38     ` Bill Pittman
  0 siblings, 0 replies; 6+ messages in thread
From: Bill Pittman @ 2022-03-07 16:38 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2198 bytes --]

Richard,

I don't think there are any additional test cases that need to be created for this condition.  It is a fairly unique set of circumstances that cause an error in our build system and would be difficult to reproduce outside of it.

As for your concern about this being the right thing to do, honestly I'm not sure, but it does seem wrong to me that there is a code path that ignores the value in options.kernel_dir, which is why I proposed the patch (and of course our build system was being affected by it).  I'm not sure if it is right or not, but it seems "more right" to me.

Hope that helps,
Bill


________________________________
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Sent: Wednesday, March 2, 2022 5:02 PM
To: Bill Pittman <bill.pittman@ni.com>; openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org>
Subject: [EXTERNAL] Re: [OE-core] [PATCH] wic: Use custom kernel path if provided

On Tue, 2022-02-15 at 16:54 +0000, Bill Pittman wrote:
> If the custom kernel path is provided in options, then
> use that path instead of the default path.
>
> Signed-off-by: Bill Pittman <bill.pittman@ni.com>
> ---
>  scripts/wic | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/scripts/wic b/scripts/wic
> index a741aed364..29a157bf37 100755
> --- a/scripts/wic
> +++ b/scripts/wic
> @@ -159,6 +159,9 @@ def wic_create_subcommand(options, usage_str):
>                             "(Use -e/--image-name to specify it)")
>          native_sysroot = options.native_sysroot
>
> +    if options.kernel_dir:
> +        kernel_dir = options.kernel_dir
> +
>      if not options.vars_dir and (not native_sysroot or not
> os.path.isdir(native_sysroot)):
>          logger.info("Building wic-tools...\n")
>          subprocess.check_call(["bitbake", "wic-tools"])


The concern with these kinds of changes is I can't really test it or tell if it
is the right thing to do and I worry about it regressing in the future.

Is there part of the test coverage we should be improving too? wic does have
fairly good coverage from oe-selftest -r wic

Cheers,

Richard



INTERNAL - NI CONFIDENTIAL

[-- Attachment #2: Type: text/html, Size: 4274 bytes --]

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

end of thread, other threads:[~2022-03-07 16:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 16:54 [PATCH] wic: Use custom kernel path if provided Bill Pittman
2022-03-02 18:15 ` Bill Pittman
2022-03-02 22:06 ` [OE-core] " Andrei Gherzan
     [not found]   ` <SN6PR04MB49098B84F7D5490D734B7EB1EC089@SN6PR04MB4909.namprd04.prod.outlook.com>
2022-03-07 16:37     ` Bill Pittman
2022-03-02 23:02 ` [OE-core] " Richard Purdie
     [not found]   ` <SN6PR04MB4909394161091073345E1ACBEC089@SN6PR04MB4909.namprd04.prod.outlook.com>
2022-03-07 16:38     ` Bill Pittman

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.