Hi,

On 02/05/2017 19:50, intrig...@debian.org wrote:
> 
> It seems that some part of bilibop got confused and we get a string
> with two paths separated by a newline, where there should be only one
> path, no?

Yes. It seems the bug has been introduced at commit 03a49203282, between
versions 0.4.23 (in jessie) and 0.5.0.

> Downgrading to Jessie's bilibop fixes the problem… but it might
> introduce other problems, can't it?

Probably not in this case. Changes since 0.4.23 are about overlayfs
support, btrfs support, and documentation updates, typos, packaging and
so on. If you use aufs to manage incremental upgrades, I suppose you
don't use overlayfs ?

For the case you have an entry point to easily add a patch in your build
process, try the attached file. It may also be tested quickly from a
Tails session with:
# cd /
# patch -p1 < /path/to/bilibop-bugfix861685-01.patch
# /lib/bilibop/disk /
# /lib/bilibop/test /

I will test it too in a few days.

Thanks for your detailed bug report,
quidame
diff --git a/lib/bilibop/common.sh b/lib/bilibop/common.sh
index 5f9e4bb..589f177 100644
--- a/lib/bilibop/common.sh
+++ b/lib/bilibop/common.sh
@@ -513,24 +513,31 @@ underlying_device_from_loop() {
 # branch of an aufs mountpoint given as argument. We assume that there is only
 # and at least one physical device used to build the aufs (but the directory
 # is not necessarly the mountpoint of this device), other branch(s) being
-# virtual fs.
+# virtual fs. Note that if there are more than one readonly branch, the first
+# block device found wins.
 underlying_device_from_aufs() {
     ${DEBUG} && echo "> underlying_device_from_aufs $@" >&2
-    local   dir="$(aufs_readonly_branch "${1}")"
-    local   dev="$(device_id_of_file "${dir}")"
-    case "${dev}" in
-        "")
-            ;;
-        0:*)
-            # aufs mounts can't be nested; but this may be btrfs
-            dev="$(underlying_device_from_file "${dir}")"
-            ;;
-        *)
-            dev="$(device_node_from_major_minor "${dev}")"
-            ;;
-    esac
-
-    [ -b "${dev}" ] && readlink -f "${dev}"
+    local dev dir
+    for dir in $(aufs_readonly_branch "${1}"); do
+        dev="$(device_id_of_file "${dir}")"
+        case "${dev}" in
+            "")
+                continue
+                ;;
+            0:*)
+                # aufs mounts can't be nested; but this may be btrfs
+                dev="$(underlying_device_from_file "${dir}")"
+                ;;
+            *)
+                dev="$(device_node_from_major_minor "${dev}")"
+                ;;
+        esac
+        if [ -b "${dev}" ]; then
+            readlink -f "${dev}"
+            return 0
+        fi
+    done
+    return 1
 }
 # ===========================================================================}}}
 # underlying_device_from_overlayfs() ========================================{{{

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to