nfsrootfs: disable warning message if bootargs root parameter have not been defined

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"
let variable expension result become string to solve this problem

(From OE-Core rev: d50e12e5ae6a72535cacd0f767b1be1f89278f79)

Signed-off-by: Jimmy Ho <jimmy.ho@sifive.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jimmy Ho 2025-06-24 08:14:21 +08:00 committed by Richard Purdie
parent 6b81d5c64e
commit 4333921896

View File

@ -1,7 +1,7 @@
#!/bin/sh
nfsrootfs_enabled() {
if [ ${bootparam_root} != "/dev/nfs" ] || [ -z ${bootparam_nfsroot} ]; then
if [ "${bootparam_root}" != "/dev/nfs" ] || [ -z ${bootparam_nfsroot} ]; then
return 1
fi
return 0