Skip to contentSkip to conversation

initramfs-framework/setup-live: quote bootparam_root variable

PATCH New California Sullivan 1 participant 1 message Aug 23, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 initramfs-framework/setup-live: quote bootparam_root variable

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

---
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(-)
meta/recipes-core/initrdscripts/initramfs-framework/setup-live +1 -1
index b98a321..4c79f41 100644
@@ -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
Signature · 1 line
2.9.5