Add backward compatibility rbind mount /lib/live/mount -> /run/live
authorLuca Boccassi <bluca@debian.org>
Fri, 16 Mar 2018 12:08:16 +0000 (12:08 +0000)
committerLuca Boccassi <bluca@debian.org>
Fri, 16 Mar 2018 20:11:22 +0000 (20:11 +0000)
The paths used in the current released versions of live-boot are a
form of public API, and existing applications and scripts might rely
on them. Do a recursive bind mount of the new path on the previous one
so that they do not break on upgrade (see #886328).

This backward-compatible mount point will be deprecated and removed
before the Bullseye (Debian 11) release. Users are recommended to start
migrating to the new /run/live path as soon as possible.

Gbp-Dch: Full

components/9990-main.sh

index b585704..ed48be3 100755 (executable)
@@ -174,6 +174,13 @@ Live ()
                panic "A wrong rootfs was mounted."
        fi
 
+       # avoid breaking existing user scripts that rely on the old path
+       # this includes code that checks what is mounted on /lib/live/mount/*
+       # (eg: grep /lib/live /proc/mount)
+       # XXX: to be removed before the bullseye release
+       mkdir -p ${rootmnt}/lib/live/mount
+       mount --rbind /run/live ${rootmnt}/lib/live/mount
+
        Fstab
        Netbase