summaryrefslogtreecommitdiffstats
path: root/lib/MDV/Draklive
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2010-08-04 14:40:36 +0000
committerOlivier Blin <oblin@mandriva.com>2010-08-04 14:40:36 +0000
commitb92c63071817b0a975a89fc5c6fa682f362c42f0 (patch)
treea8a9bc736457c277d8b119f95df51625f5ce08cf /lib/MDV/Draklive
parent7910fa4e1b96204fc725921d84e23561c178167b (diff)
downloaddraklive-b92c63071817b0a975a89fc5c6fa682f362c42f0.tar
draklive-b92c63071817b0a975a89fc5c6fa682f362c42f0.tar.gz
draklive-b92c63071817b0a975a89fc5c6fa682f362c42f0.tar.bz2
draklive-b92c63071817b0a975a89fc5c6fa682f362c42f0.tar.xz
draklive-b92c63071817b0a975a89fc5c6fa682f362c42f0.zip
add back squashfs3 support
Diffstat (limited to 'lib/MDV/Draklive')
-rw-r--r--lib/MDV/Draklive/Loopback.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/MDV/Draklive/Loopback.pm b/lib/MDV/Draklive/Loopback.pm
index 6fb592d..27ee20d 100644
--- a/lib/MDV/Draklive/Loopback.pm
+++ b/lib/MDV/Draklive/Loopback.pm
@@ -15,7 +15,7 @@ our %loop_types;
squashfs => {
read_only => 1,
is_loopback => 1,
- modules => [ qw(loop squashfs) ],
+ modules => sub { "loop", has_squashfs4_with_lzma($_[0]) ? "squashfs" : "squashfs_lzma" },
extension => '-lzma.sqfs',
build => sub {
my ($live, $dir) = @_;
@@ -29,14 +29,16 @@ our %loop_types;
my $exclude_file = tmpnam();
output_p($exclude_file, map { $root . "$_\n" } grep { -e $root . $_ } @{$dir->{exclude} || []});
my $sort = $live->{settings}{config_root} . '/' . $dir->{sort};
+ my $squashfs4 = has_squashfs4_with_lzma($live);
run_foreach(sub {
if (/^mksquashfs: file .*, uncompressed size (\d+) bytes\s*(?:DUPLICATE|LINK)?$/) {
$progress->{current} += $1;
$progress->show(time());
}
},
- 'mksquashfs', $src, $dest, '-noappend', '-comp', 'lzma',
- '-b', '1048576',
+ $squashfs4 ? 'mksquashfs' : 'mksquashfs3', $src, $dest,
+ $squashfs4 ? ('-comp', 'lzma') : '-lzma',
+ '-noappend', '-b', '1048576',
#'-processors', 1,
'-ef', $exclude_file,
if_(-f $sort, '-sort', $sort),
@@ -131,4 +133,10 @@ sub get_loop_modules {
();
}
+sub has_squashfs4_with_lzma {
+ my ($live) = @_;
+ my $kernel = $live->find_kernel;
+ cat_($live->get_system_root . "/boot/config-" . $live->find_kernel->{version}) =~ /^CONFIG_DECOMPRESS_LZMA_NEEDED=y$/m;
+}
+
1;