summaryrefslogtreecommitdiffstats
path: root/lib/MGA/DrakISO/BuildISO.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-19 16:01:31 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-19 16:01:31 +0000
commit505bfb9a7ade6a916d7869605a4f7a292de22776 (patch)
tree9b64ce385e96bc069c8b83f5deda2d11ff05996d /lib/MGA/DrakISO/BuildISO.pm
parent059b5c2a18e61cc7e4348e955025f9d77466647d (diff)
downloaddrakiso-505bfb9a7ade6a916d7869605a4f7a292de22776.tar
drakiso-505bfb9a7ade6a916d7869605a4f7a292de22776.tar.gz
drakiso-505bfb9a7ade6a916d7869605a4f7a292de22776.tar.bz2
drakiso-505bfb9a7ade6a916d7869605a4f7a292de22776.tar.xz
drakiso-505bfb9a7ade6a916d7869605a4f7a292de22776.zip
Replace $live by $build throughout,
Ready for adding support for classic installer builds.
Diffstat (limited to 'lib/MGA/DrakISO/BuildISO.pm')
-rwxr-xr-xlib/MGA/DrakISO/BuildISO.pm42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/MGA/DrakISO/BuildISO.pm b/lib/MGA/DrakISO/BuildISO.pm
index 4198a10..eb28c6c 100755
--- a/lib/MGA/DrakISO/BuildISO.pm
+++ b/lib/MGA/DrakISO/BuildISO.pm
@@ -39,47 +39,47 @@ our @EXPORT = qw(build_live_iso);
###############################################################################
sub build_live_iso {
- my ($live) = @_;
+ my ($build) = @_;
- my $label = $live->{media}->get_media_label or die "the source device must be described by a label\n";
+ my $label = $build->{media}->get_media_label or die "the source device must be described by a label\n";
- my $mbr_image = $live->get_absolute_path($live->{media}{mbr_boot_img}) // '/usr/lib/grub/i386-pc/boot_hybrid.img';
+ my $mbr_image = $build->get_absolute_path($build->{media}{mbr_boot_img}) // '/usr/lib/grub/i386-pc/boot_hybrid.img';
-e $mbr_image or die "cannot find MBR boot image $mbr_image\n";
- my $esp_image = $live->get_builddir('images') . '/esp.img';
+ my $esp_image = $build->get_builddir('images') . '/esp.img';
-e $esp_image or die "cannot find ESP image $esp_image\n";
- my $dest = $live->get_builddir('dist') . '/' . $live->get_name . '.iso';
+ my $dest = $build->get_builddir('dist') . '/' . $build->get_name . '.iso';
mkdir_p(dirname($dest));
build_iso_image(
- $live,
+ $build,
$dest,
$label,
$mbr_image,
$esp_image,
- '/boot=' . $live->get_builddir('boot'),
- if_($live->{settings}{arch} eq 'x86_64',
- '/EFI=' . $live->get_builddir('EFI'),
+ '/boot=' . $build->get_builddir('boot'),
+ if_($build->{settings}{arch} eq 'x86_64',
+ '/EFI=' . $build->get_builddir('EFI'),
),
(
map {
- '/loopbacks' . $_ . '=' . $live->get_builddir('loopbacks') . $_;
- } list_selected_loopbacks($live)
+ '/loopbacks' . $_ . '=' . $build->get_builddir('loopbacks') . $_;
+ } list_selected_loopbacks($build)
),
- if_($live->{media}{files},
+ if_($build->{media}{files},
map {
- $_ . '=' . $live->get_builddir('files') . '/' . $_;
- } all($live->get_builddir('files'))
+ $_ . '=' . $build->get_builddir('files') . '/' . $_;
+ } all($build->get_builddir('files'))
),
);
}
sub list_selected_loopbacks {
- my ($live) = @_;
- my @pack = $live->{settings}{pack} ? @{$live->{packs}{$live->{settings}{pack}} || []} : ();
- my @pack_modules = grep { member($_->{name}, @pack) } list_loopback_modules($live);
- (map { $loop_types{$_->{type}}{is_loopback} && $_->{path} ? $_->{path} . $loop_types{$_->{type}}{extension} : () } @{$live->{mount}{dirs} || []}),
+ my ($build) = @_;
+ my @pack = $build->{settings}{pack} ? @{$build->{packs}{$build->{settings}{pack}} || []} : ();
+ my @pack_modules = grep { member($_->{name}, @pack) } list_loopback_modules($build);
+ (map { $loop_types{$_->{type}}{is_loopback} && $_->{path} ? $_->{path} . $loop_types{$_->{type}}{extension} : () } @{$build->{mount}{dirs} || []}),
(map { '/modules/' . $_->{name} . $loop_types{$_->{type}}{extension} } @pack_modules);
}
@@ -107,7 +107,7 @@ sub list_selected_loopbacks {
# initial grub2 configuration file will be located accordingly.
#
sub build_iso_image {
- my ($live, $dest, $label, $mbr_image, $esp_image, @opts) = @_;
+ my ($build, $dest, $label, $mbr_image, $esp_image, @opts) = @_;
run_('xorrisofs',
'-pad', '-l', '-R', '-J',
@@ -123,7 +123,7 @@ sub build_iso_image {
'-boot-load-size', 4,
'-boot-info-table',
'--grub2-boot-info',
- if_($live->{settings}{arch} eq 'x86_64',
+ if_($build->{settings}{arch} eq 'x86_64',
# for DVD UEFI boot
'-eltorito-alt-boot',
'-e', '/EFI/BOOT/bootx64.efi',
@@ -145,7 +145,7 @@ sub build_iso_image {
run_({ chdir => $dir }, 'sha1sum', '>', $dest . '.sha1', $filename);
run_({ chdir => $dir }, 'sha512sum', '>', $dest . '.sha512', $filename);
run_({ chdir => $dir }, 'date', '>', $dir . '/DATE.txt');
- if (my $suffix = $live->get_set_suffix) {
+ if (my $suffix = $build->get_set_suffix) {
if (my ($prefix, $ext) = $dest =~ /(.*)(\.[^.]+)$/) {
my $link = $prefix . $suffix . $ext;
linkf($dest, $link);