Feature #8473

Add support to live-boot to support multiple read-only lower layers with overlayfs

Added by intrigeri about 10 years ago. Updated about 5 years ago.

Status:
Resolved
Priority:
Elevated
Assignee:
Category:
Target version:
Start date:
2014-12-21
Due date:
% Done:

100%

Feature Branch:
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description


Subtasks


Related issues

Blocked by Tails - Feature #8472: Wait for overlayfs to support multiple read-only lower layers Resolved 2014-12-21
Blocked by Tails - Bug #8483: Fix overlayfs support in live-boot upstream Resolved 2014-12-24
Blocks Tails - Feature #9373: Make tails-iuk support overlayfs Resolved
Blocks Tails - Feature #16209: Core work: Foundations Team Confirmed

History

#1 Updated by intrigeri about 10 years ago

  • blocked by Feature #8472: Wait for overlayfs to support multiple read-only lower layers added

#2 Updated by intrigeri about 10 years ago

  • blocked by Bug #8483: Fix overlayfs support in live-boot upstream added

#3 Updated by intrigeri about 10 years ago

This can be worked on once Linux 4.0.0 has been successfully built for i386 in Debian experimental.

#4 Updated by intrigeri about 10 years ago

I’m told that something like that works:

mount -t overlay overlay -olowerdir=./psu-test2_squashfs:./psu-test_squashfs:filesystem_squashfs,upperdir=./psu_overlay_rw,workdir=./psu_overlay_work ./psu_overlay

#5 Updated by intrigeri about 10 years ago

  • Feature Branch set to feature/8415-overlayfs

intrigeri wrote:
> This can be worked on once Linux 4.0.0 has been successfully built for i386 in Debian experimental.

That’s not a blocker anymore in the topic branch.

#6 Updated by intrigeri about 10 years ago

  • Target version set to Sustainability_M1

#7 Updated by sajolida about 10 years ago

  • Target version changed from Sustainability_M1 to 2016

#9 Updated by intrigeri about 9 years ago

  • Status changed from Confirmed to In Progress
  • % Done changed from 0 to 10

#10 Updated by intrigeri about 9 years ago

… but seems to be buggy, see https://lists.debian.org/debian-live/2016/01/msg00010.html

#11 Updated by intrigeri about 9 years ago

  • Target version deleted (2016)

Given we could do Feature #10298 without migrating to overlayfs, we removed this from our roadmap at the summit this year.

#12 Updated by Anonymous about 7 years ago

  • Assignee set to anonym

anonym, I’m reassigning this to you as the parent is part of the roadmap again it seems, and you’re the assignee. I let you verify if / how this ticket here is still relevant.

#13 Updated by intrigeri about 7 years ago

  • Assignee changed from anonym to segfault
  • Target version set to Tails_3.11

#14 Updated by intrigeri about 7 years ago

#15 Updated by intrigeri about 7 years ago

#16 Updated by intrigeri about 7 years ago

  • Target version changed from Tails_3.11 to Tails_3.13

#17 Updated by intrigeri about 6 years ago

#18 Updated by intrigeri about 6 years ago

  • blocked by deleted (Feature #15506: Core work 2018Q4: Foundations Team)

#19 Updated by intrigeri about 6 years ago

  • blocked by deleted (Feature #15507: Core work 2019Q1: Foundations Team)

#20 Updated by intrigeri about 6 years ago

#21 Updated by intrigeri about 6 years ago

  • Target version changed from Tails_3.13 to 2019

#22 Updated by intrigeri about 6 years ago

  • Assignee deleted (segfault)

#23 Updated by intrigeri about 5 years ago

  • Feature Branch deleted (feature/8415-overlayfs)

#24 Updated by intrigeri about 5 years ago

  • blocked by Feature #17152: Port tails-iuk to a more lightweight set of dependencies added

#25 Updated by intrigeri about 5 years ago

  • blocks deleted (Feature #17152: Port tails-iuk to a more lightweight set of dependencies)

#26 Updated by segfault about 5 years ago

live-boot already supports multiple read-only layers. I tested it like this:

  • Create 3 squashfs files:
mkdir 1 2 3
echo 1 > 1/foo
echo 2 > 2/foo
echo 3 > 3/foo
echo 1 > 1/bar
echo 2 > 2/bar
mksqashfs 1 1.squashfs
mksqashfs 2 2.squashfs
mksqashfs 3 3.squashfs
  • Create a disk image and put the squashfs files there:
truncate -s 1M usb
LOOPDEV="$(sudo losetup --find --show usb)"
// Format the loop device via GNOME Disks
sudo mount "${LOOPDEV}" /mnt
cp *.squashfs /mnt
sudo umount /mnt
  • Boot an image built from the Feature #8415 feature branch (commit 5209e7d757)
  • Add break=premount (and debug) to the kernel command line options
  • Attach the disk image to the VM as a USB
  • Copy the squashfs files to the live directory and add them to Tails.module:
// Mount the root filesystem:
mount -t vfat /dev/sda1 /root

// Mount the USB
mkdir /mnt
mount -t ext4 /dev/sdb /mnt

// Copy the squashfs files to the live directory
cp /mnt/*.squashfs /root/live/

// Add the filenames to Tails.module
echo -e "1.squashfs\n2.squashfs\n3.squashfs" >> /root/live/Tails.module

// Unmount the filesystems
umount /mnt /root

// Continue boot
exit

The booted Tails then contained the following files:

cat /foo
3
cat /bar
2

… which means that the squashfs’s were mounted in the correct order (first 1, then 2, then 3).

#27 Updated by intrigeri about 5 years ago

  • Status changed from In Progress to Resolved

Great!

#28 Updated by intrigeri about 5 years ago

  • % Done changed from 10 to 100