Openembedded Core Discussions
 help / color / mirror / Atom feed
* Re: [OE-core] [PATCH] nfsrootfs: disable warning message if bootargs root parameter have not been defined
  2025-06-16  7:43 Jimmy Ho
@ 2025-06-16 13:52 ` Alexander Kanavin
  2025-06-19  6:12   ` Jimmy Ho
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Kanavin @ 2025-06-16 13:52 UTC (permalink / raw)
  To: jimmy.ho; +Cc: openembedded-core

On Mon, 16 Jun 2025 at 13:56, Jimmy Ho via lists.openembedded.org
<jimmy.ho=sifive.com@lists.openembedded.org> wrote:
>  nfsrootfs_enabled() {
> -       if [ ${bootparam_root} != "/dev/nfs" ] || [ -z ${bootparam_nfsroot} ]; then
> +       if [ -z ${bootparam_root} ] || [ ${bootparam_root} != "/dev/nfs" ] || [ -z ${bootparam_nfsroot} ]; then
>                 return 1
>         fi
>         return 0

This needs a bit more explanation. What is the warning message, why
does it need to be disabled, and how does the above change achieve it?

Alex


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

* Re: [OE-core] [PATCH] nfsrootfs: disable warning message if bootargs root parameter have not been defined
  2025-06-16 13:52 ` [OE-core] " Alexander Kanavin
@ 2025-06-19  6:12   ` Jimmy Ho
  2025-06-19  7:22     ` Alexander Kanavin
  0 siblings, 1 reply; 6+ messages in thread
From: Jimmy Ho @ 2025-06-19  6:12 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core

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

hi Alexander:
in one of our use case, we don't define root in bootargs,
if [ ${bootparam_root} != "/dev/nfs" ] will output /init.d/85-nfsrootfs:
line 4: [: !=: unary operator expected
by checking   if [-z ${bootparam_root} ] can clear this warning message
thanks
best regards
jimmy ho

On Mon, Jun 16, 2025 at 9:52 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> On Mon, 16 Jun 2025 at 13:56, Jimmy Ho via lists.openembedded.org
> <jimmy.ho=sifive.com@lists.openembedded.org> wrote:
> >  nfsrootfs_enabled() {
> > -       if [ ${bootparam_root} != "/dev/nfs" ] || [ -z
> ${bootparam_nfsroot} ]; then
> > +       if [ -z ${bootparam_root} ] || [ ${bootparam_root} != "/dev/nfs"
> ] || [ -z ${bootparam_nfsroot} ]; then
> >                 return 1
> >         fi
> >         return 0
>
> This needs a bit more explanation. What is the warning message, why
> does it need to be disabled, and how does the above change achieve it?
>
> Alex
>

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

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

* Re: [OE-core] [PATCH] nfsrootfs: disable warning message if bootargs root parameter have not been defined
  2025-06-19  6:12   ` Jimmy Ho
@ 2025-06-19  7:22     ` Alexander Kanavin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Kanavin @ 2025-06-19  7:22 UTC (permalink / raw)
  To: Jimmy Ho; +Cc: openembedded-core

On Thu, 19 Jun 2025 at 08:12, Jimmy Ho <jimmy.ho@sifive.com> wrote:
>
> hi Alexander:
> in one of our use case, we don't define root in bootargs,
> if [ ${bootparam_root} != "/dev/nfs" ] will output /init.d/85-nfsrootfs: line 4: [: !=: unary operator expected
> by checking   if [-z ${bootparam_root} ] can clear this warning message

Thanks, makese sense. Can you resend the patch with this information
in the commit message?

Alex


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

* [PATCH] nfsrootfs: disable warning message if bootargs root parameter have not been defined
@ 2025-06-19  8:29 Jimmy Ho
  2025-06-19 15:32 ` [OE-core] " Antonin Godard
  0 siblings, 1 reply; 6+ messages in thread
From: Jimmy Ho @ 2025-06-19  8:29 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin, Jimmy Ho

we have case that don't define root in bootargs,
if [ ${bootparam_root} != "/dev/nfs" ] will output warning "/init.d/85-nfsrootfs: line 4: [: !=: unary operator expected"
by checking  whether bootparam_root is defined can clear this warning message 

Signed-off-by: Jimmy Ho <jimmy.ho@sifive.com>
---
 meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs b/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
index e67ee4c25d..1e76258ce1 100644
--- a/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 nfsrootfs_enabled() {
-	if [ ${bootparam_root} != "/dev/nfs" ] || [ -z ${bootparam_nfsroot} ]; then
+	if [ -z ${bootparam_root} ] || [ ${bootparam_root} != "/dev/nfs" ] || [ -z ${bootparam_nfsroot} ]; then
 		return 1
 	fi
 	return 0
-- 
2.39.3



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

* Re: [OE-core] [PATCH] nfsrootfs: disable warning message if bootargs root parameter have not been defined
  2025-06-19  8:29 [PATCH] nfsrootfs: disable warning message if bootargs root parameter have not been defined Jimmy Ho
@ 2025-06-19 15:32 ` Antonin Godard
  2025-06-23 23:53   ` Jimmy Ho
  0 siblings, 1 reply; 6+ messages in thread
From: Antonin Godard @ 2025-06-19 15:32 UTC (permalink / raw)
  To: jimmy.ho, openembedded-core; +Cc: Alexander Kanavin

On Thu Jun 19, 2025 at 10:29 AM CEST, Jimmy Ho via lists.openembedded.org wrote:
> we have case that don't define root in bootargs,
> if [ ${bootparam_root} != "/dev/nfs" ] will output warning "/init.d/85-nfsrootfs: line 4: [: !=: unary operator expected"
> by checking  whether bootparam_root is defined can clear this warning message 
>
> Signed-off-by: Jimmy Ho <jimmy.ho@sifive.com>
> ---
>  meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs b/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
> index e67ee4c25d..1e76258ce1 100644
> --- a/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
> +++ b/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  
>  nfsrootfs_enabled() {
> -	if [ ${bootparam_root} != "/dev/nfs" ] || [ -z ${bootparam_nfsroot} ]; then
> +	if [ -z ${bootparam_root} ] || [ ${bootparam_root} != "/dev/nfs" ] || [ -z ${bootparam_nfsroot} ]; then

I think a better way of fixing this would be to replace

  [ ${bootparam_root} != "/dev/nfs" ]

by

  [ "${bootparam_root}" != "/dev/nfs" ]

instead of an extra condition.

Antonin

-- 
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



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

* Re: [OE-core] [PATCH] nfsrootfs: disable warning message if bootargs root parameter have not been defined
  2025-06-19 15:32 ` [OE-core] " Antonin Godard
@ 2025-06-23 23:53   ` Jimmy Ho
  0 siblings, 0 replies; 6+ messages in thread
From: Jimmy Ho @ 2025-06-23 23:53 UTC (permalink / raw)
  To: Antonin Godard; +Cc: openembedded-core, Alexander Kanavin

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

Hi Antonin:
thanks for suggestion
i will resend the patch

On Thu, Jun 19, 2025 at 11:32 PM Antonin Godard <antonin.godard@bootlin.com>
wrote:

> On Thu Jun 19, 2025 at 10:29 AM CEST, Jimmy Ho via lists.openembedded.org
> wrote:
> > we have case that don't define root in bootargs,
> > if [ ${bootparam_root} != "/dev/nfs" ] will output warning
> "/init.d/85-nfsrootfs: line 4: [: !=: unary operator expected"
> > by checking  whether bootparam_root is defined can clear this warning
> message
> >
> > Signed-off-by: Jimmy Ho <jimmy.ho@sifive.com>
> > ---
> >  meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git
> a/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
> b/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
> > index e67ee4c25d..1e76258ce1 100644
> > --- a/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
> > +++ b/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
> > @@ -1,7 +1,7 @@
> >  #!/bin/sh
> >
> >  nfsrootfs_enabled() {
> > -     if [ ${bootparam_root} != "/dev/nfs" ] || [ -z
> ${bootparam_nfsroot} ]; then
> > +     if [ -z ${bootparam_root} ] || [ ${bootparam_root} != "/dev/nfs" ]
> || [ -z ${bootparam_nfsroot} ]; then
>
> I think a better way of fixing this would be to replace
>
>   [ ${bootparam_root} != "/dev/nfs" ]
>
> by
>
>   [ "${bootparam_root}" != "/dev/nfs" ]
>
> instead of an extra condition.
>
> Antonin
>
> --
> Antonin Godard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
>

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

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

end of thread, other threads:[~2025-06-24 12:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19  8:29 [PATCH] nfsrootfs: disable warning message if bootargs root parameter have not been defined Jimmy Ho
2025-06-19 15:32 ` [OE-core] " Antonin Godard
2025-06-23 23:53   ` Jimmy Ho
  -- strict thread matches above, loose matches on Subject: below --
2025-06-16  7:43 Jimmy Ho
2025-06-16 13:52 ` [OE-core] " Alexander Kanavin
2025-06-19  6:12   ` Jimmy Ho
2025-06-19  7:22     ` Alexander Kanavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox