All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <jimmy.ho@sifive.com>, <openembedded-core@lists.openembedded.org>
Cc: "Alexander Kanavin" <alex.kanavin@gmail.com>
Subject: Re: [OE-core] [PATCH] nfsrootfs: disable warning message if bootargs root parameter have not been defined
Date: Thu, 19 Jun 2025 17:32:28 +0200	[thread overview]
Message-ID: <DAQMA3E0OM0S.N9VZOQHC3GPL@bootlin.com> (raw)
In-Reply-To: <20250619082919.12390-1-jimmy.ho@sifive.com>

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



  reply	other threads:[~2025-06-19 15:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-06-23 23:53   ` [OE-core] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DAQMA3E0OM0S.N9VZOQHC3GPL@bootlin.com \
    --to=antonin.godard@bootlin.com \
    --cc=alex.kanavin@gmail.com \
    --cc=jimmy.ho@sifive.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.