summaryrefslogtreecommitdiffstats
path: root/lib/MDV/Draklive/Overlay.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-10-29 00:10:13 +0000
committerOlivier Blin <oblin@mandriva.com>2008-10-29 00:10:13 +0000
commit85ff78d269cbd31ad2a6eeb952f3cce8a17fb330 (patch)
tree4cf43599d110c443c349acbb43d6ed175cd961a2 /lib/MDV/Draklive/Overlay.pm
parentad0fa345dc453d2aaeaea17e62d6328ca398779a (diff)
downloaddraklive-85ff78d269cbd31ad2a6eeb952f3cce8a17fb330.tar
draklive-85ff78d269cbd31ad2a6eeb952f3cce8a17fb330.tar.gz
draklive-85ff78d269cbd31ad2a6eeb952f3cce8a17fb330.tar.bz2
draklive-85ff78d269cbd31ad2a6eeb952f3cce8a17fb330.tar.xz
draklive-85ff78d269cbd31ad2a6eeb952f3cce8a17fb330.zip
move overlay data in MDV::Draklive::Overlay
Diffstat (limited to 'lib/MDV/Draklive/Overlay.pm')
-rw-r--r--lib/MDV/Draklive/Overlay.pm22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/MDV/Draklive/Overlay.pm b/lib/MDV/Draklive/Overlay.pm
new file mode 100644
index 0000000..50b9cdd
--- /dev/null
+++ b/lib/MDV/Draklive/Overlay.pm
@@ -0,0 +1,22 @@
+package MDV::Draklive::Overlay;
+
+use MDV::Draklive::Loopback;
+
+our %overlay = (
+ unionfs => {
+ modules => [ qw(unionfs) ],
+ mount => sub {
+ my ($live) = @_;
+ #- build dirs list: "dir1=ro:dir2:ro:dir3=rw"
+ my $dirs = join(':',
+ map {
+ $_->{list} ? "\$(cat $live->{prefix}{live}{mnt}/$_->{list})" :
+ "$live->{prefix}{live}{mnt}$_->{mountpoint}=" .
+ (!$loop_types{$_->{type}}{read_only} && !$_->{read_only} ? 'rw' : 'ro');
+ } reverse grep { !$_->{fallback} } @{$live->{mount}{dirs} || []});
+ "sh -c 'mount -o dirs=$dirs -t unionfs unionfs $live->{prefix}{live}{mnt}$live->{mount}{root}'";
+ },
+ },
+);
+
+1;