Source: live-boot
Version: 1:20170623
Severity: normal
Tags: patch
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
overlay1,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. A tested patch is
attached.
See also for the previous larger layout change:
https://lists.debian.org/debian-live/2012/10/msg00021.html
--
Benjamin Drung
System Developer
Debian & Ubuntu Developer
ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin
Email: benjamin.dr...@profitbricks.com
URL: https://www.profitbricks.de
Sitz der Gesellschaft: Berlin
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B
Geschäftsführer: Achim Weiss, Matthias Steinberg
>From 3f97c0d3153c2073eb93473eeb26d2f8153f6464 Mon Sep 17 00:00:00 2001
From: Benjamin Drung
Date: Thu, 4 Jan 2018 11:02:32 +0100
Subject: [PATCH] Use /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
overlay1,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
---
backend/initramfs-tools/live.hook | 2 +-
components/0001-init-vars.sh | 2 +-
components/2010-remove-persistence | 2 +-
components/9990-main.sh| 20 +++
components/9990-misc-helpers.sh| 24 +++---
components/9990-overlay.sh | 41 +++---
6 files changed, 25 insertions(+), 66 deletions(-)
diff --git a/backend/initramfs-tools/live.hook
b/backend/initramfs-tools/live.hook
index 1ce922d..97f4c5e 100755
--- a/backend/initramfs-tools/live.hook
+++ b/backend/initramfs-tools/live.hook
@@ -8,7 +8,7 @@ set -e
# Reading configuration file from filesystem and live-media
for _FILE in /etc/live/boot.conf /etc/live/boot/* \
-/lib/live/mount/media/live/boot.conf
/lib/live/mount/media/live/boot/*
+/run/live/medium/live/boot.conf /run/live/medium/live/boot/*
do
if [ -e "${_FILE}" ]
then
diff --git a/components/0001-init-vars.sh b/components/0001-init-vars.sh
index 7e69956..603cf43 100755
--- a/components/0001-init-vars.sh
+++ b/components/0001-init-vars.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-mountpoint="/live/medium"
+mountpoint="/run/live/medium"
alt_mountpoint="/media"
LIVE_MEDIA_PATH="live"
HOSTNAME="host"
diff --git a/components/2010-remove-persistence
b/components/2010-remove-persistence
index 5dcf0c0..717a408 100755
--- a/components/2010-remove-persistence
+++