Simplify mount point handling by using /run/live instead of /lib/live/mount
authorBenjamin Drung <benjamin.drung@profitbricks.com>
Thu, 4 Jan 2018 10:02:32 +0000 (11:02 +0100)
committerRaphaël Hertzog <hertzog@debian.org>
Fri, 23 Feb 2018 17:39:42 +0000 (18:39 +0100)
commit0d878d3a679820d570a20c0fa1c1a2c5b92ad037
treef54fc42a87541adca0908a1a54bef79352113489
parent41611e087d9be36c3eb8526e8cce715a47aca9ca
Simplify mount point handling by using /run/live instead of /lib/live/mount

Currently live-boot mounts following things:

  /lib/live/mount/medium: the live media mounted read-only
  /lib/live/mount/rootfs/filesystem.{squashfs,ext*,...}: the root fs image
  /lib/live/mount/overlay: the copy-on-write content from aufs
  /lib/live/mount/findiso: the loop-mounted iso image when using findiso
  /lib/live/mount/persistence/*: persistent devices with copy-on-write overlay

Some of these mounts are mounted in /live before they are moved to their
correct place. Since the final root filesystem is mounted in /root and
run-init switches to it, special care needs to be taken when moving the
mount points around.

/lib/live/mount/overlay is not accessible any more in the live system:

$ df -h
/dev/loop0 169M  169M     0 100% /lib/live/mount/rootfs/root.squashfs
tmpfs      744M     0  744M   0% /lib/live/mount/overlay
overlay    1,5G 1001M  536M  66% /

The early initramfs stage mounts tmpfs on /run which doesn't need to be
moved once the final root filesystem is in place. The mount points do
not need much space and can live on /run/live without problems. Since
these mount points are run-time variable data, they fit perfectly for
/run and comply with FHS 3.0.

Therefore move /lib/live/mount to /run/live and skip the intermedia
/live mount points. This reduces code and complexity.

See also for the previous larger layout change:
https://lists.debian.org/debian-live/2012/10/msg00021.html

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
Closes: #886328
backend/initramfs-tools/live.hook
components/0001-init-vars.sh
components/2010-remove-persistence
components/9990-main.sh
components/9990-misc-helpers.sh
components/9990-overlay.sh