From 505bfb9a7ade6a916d7869605a4f7a292de22776 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 19 Dec 2017 16:01:31 +0000 Subject: Replace $live by $build throughout, Ready for adding support for classic installer builds. --- lib/MGA/DrakISO/BuildISO.pm | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'lib/MGA/DrakISO/BuildISO.pm') 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); -- cgit v1.2.1