[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] fix condition for setting rootfs_dest_backing



From: Evgeni Golov <evgeni@grml.org>

The fix for the opt_link check in d5ed94293c3905b8ac402a75bd80272a20b032d4
broke the code as it inverted the meaning. Previously it ran the code
iff opt_link was empty, as [ -n ] is true. In the case opt_link was not
empty, the code evaluated to [ -n foo], which is invalid syntax and thus
false. This, however, was almost the expected behaviour, as rootfs_dest_backing
is needed for opt_union and (in read-only mode) for opt_link.
---
 scripts/boot/9990-misc-helpers.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/boot/9990-misc-helpers.sh b/scripts/boot/9990-misc-helpers.sh
index d775181..ad4f3d7 100755
--- a/scripts/boot/9990-misc-helpers.sh
+++ b/scripts/boot/9990-misc-helpers.sh
@@ -1491,7 +1491,7 @@ activate_custom_mounts ()
 		# ignore the loop below and set rootfs_dest_backing=$dest
 		local rootfs_dest_backing
 		rootfs_dest_backing=""
-		if [ -n "${opt_link}" ]
+		if [ -n "${opt_link}" ] || [ -n "${opt_union}" ]
 		then
 			for d in /live/rootfs/*
 			do
-- 
1.7.10.4


Reply to: