summaryrefslogtreecommitdiffstats
path: root/lib/MGA/DrakISO/Loopback.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MGA/DrakISO/Loopback.pm')
-rw-r--r--lib/MGA/DrakISO/Loopback.pm22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/MGA/DrakISO/Loopback.pm b/lib/MGA/DrakISO/Loopback.pm
index f3ba5ae..288d78f 100644
--- a/lib/MGA/DrakISO/Loopback.pm
+++ b/lib/MGA/DrakISO/Loopback.pm
@@ -22,17 +22,17 @@ our %loop_types;
modules => sub { "loop", best_squashfs4_compression($_[0]) ? "squashfs" : "squashfs_lzma" },
extension => '-lzma.sqfs',
build => sub {
- my ($live, $dir) = @_;
- my $dest = $live->get_builddir('loopbacks') . $dir->{path} . $loop_types{squashfs}{extension};
+ my ($build, $dir) = @_;
+ my $dest = $build->get_builddir('loopbacks') . $dir->{path} . $loop_types{squashfs}{extension};
mkdir_p(dirname($dest));
- my $root = $dir->{root} || $live->get_system_root;
+ my $root = $dir->{root} || $build->get_system_root;
my $src = $root . $dir->{build_from};
my $total = directory_usage($src);
print "have to process " . int($total/1000000) . " MB\n";
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_comp = best_squashfs4_compression($live);
+ my $sort = $build->{settings}{config_root} . '/' . $dir->{sort};
+ my $squashfs4_comp = best_squashfs4_compression($build);
run_($squashfs4_comp ? 'mksquashfs' : 'mksquashfs3', $src, $dest,
$squashfs4_comp ? ('-comp', $squashfs4_comp) : '-lzma',
'-noappend', '-b', '1048576',
@@ -91,8 +91,8 @@ our %loop_types;
modules => [],
extension => '.loop',
build => sub {
- my ($live, $dir) = @_;
- my $dest = $live->get_builddir('loopbacks') . $dir->{path} . $loop_types{loopfs}{extension};
+ my ($build, $dir) = @_;
+ my $dest = $build->get_builddir('loopbacks') . $dir->{path} . $loop_types{loopfs}{extension};
mkdir_p(dirname($dest));
MGA::DrakISO::Utils::device_allocate_file($dest, $dir->{pre_allocate});
MGA::DrakISO::Utils::device_mkfs($dest, $dir->{fs}) if !defined $dir->{min_size};
@@ -144,9 +144,9 @@ our %loop_types;
);
sub has_squashfs4_with {
- my ($live, $comp) = @_;
+ my ($build, $comp) = @_;
my $ucomp = uc($comp);
- cat_($live->get_system_root . "/boot/config-" . $live->find_kernel->{version}) =~ /^CONFIG_SQUASHFS_$ucomp=y$/m;
+ cat_($build->get_system_root . "/boot/config-" . $build->find_kernel->{version}) =~ /^CONFIG_SQUASHFS_$ucomp=y$/m;
}
sub mksquashfs4_compressors() {
@@ -154,8 +154,8 @@ sub mksquashfs4_compressors() {
}
sub best_squashfs4_compression {
- my ($live) = @_;
- find { has_squashfs4_with($live, $_) } intersection([ mksquashfs4_compressors() ], [ qw(xz lzma) ]);
+ my ($build) = @_;
+ find { has_squashfs4_with($build, $_) } intersection([ mksquashfs4_compressors() ], [ qw(xz lzma) ]);
}
1;