[OE-core] [PATCH] initramfs-framework/setup-live: quote bootparam_root variable

California Sullivan california.l.sullivan at intel.com
Wed Aug 23 22:47:28 UTC 2017


When bootparam_root was empty the if statement would resolve into
invalid syntax instead of short circuiting after the -z, causing a boot
failure.

Signed-off-by: California Sullivan <california.l.sullivan at intel.com>
---
I stupidly didn't test an empty root parameter with my previous patch
and just assumed the -z $bootparam_root would still work. I was wrong.

Rest assured this patch was tested with all three cases: an empty root
parameter, root=/dev/ram0, and a valid PARTUUID.

 meta/recipes-core/initrdscripts/initramfs-framework/setup-live | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/setup-live b/meta/recipes-core/initrdscripts/initramfs-framework/setup-live
index b98a321..4c79f41 100644
--- a/meta/recipes-core/initrdscripts/initramfs-framework/setup-live
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/setup-live
@@ -12,7 +12,7 @@ ISOLINUX=""
 ROOT_DISK=""
 shelltimeout=30
 
-	if [ -z $bootparam_root -o $bootparam_root = "/dev/ram0" ]; then
+	if [ -z "$bootparam_root" -o "$bootparam_root" = "/dev/ram0" ]; then
 		echo "Waiting for removable media..."
 		C=0
 		while true
-- 
2.9.5




More information about the Openembedded-core mailing list