summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-22 17:35:31 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-22 20:39:00 +0000
commit8604d137143ed3dfd2abecb718a32c31bb0dac48 (patch)
treed2a84be7e4044de0800ab245c322ebfe1f0c5fc3
parent8152efd28ce168ddedf8031c07b8bd7418c9526e (diff)
downloaddrakiso-8604d137143ed3dfd2abecb718a32c31bb0dac48.tar
drakiso-8604d137143ed3dfd2abecb718a32c31bb0dac48.tar.gz
drakiso-8604d137143ed3dfd2abecb718a32c31bb0dac48.tar.bz2
drakiso-8604d137143ed3dfd2abecb718a32c31bb0dac48.tar.xz
drakiso-8604d137143ed3dfd2abecb718a32c31bb0dac48.zip
Move handling of copy_from_repo list to prepare_iso_bootloader().
This allows it to be used for Live ISOs too.
-rwxr-xr-xlib/MGA/DrakISO/BuildBoot.pm10
-rwxr-xr-xlib/MGA/DrakISO/BuildClassic.pm15
2 files changed, 13 insertions, 12 deletions
diff --git a/lib/MGA/DrakISO/BuildBoot.pm b/lib/MGA/DrakISO/BuildBoot.pm
index e52519c..bcf07ea 100755
--- a/lib/MGA/DrakISO/BuildBoot.pm
+++ b/lib/MGA/DrakISO/BuildBoot.pm
@@ -74,6 +74,16 @@ sub prepare_live_system_boot {
sub prepare_iso_bootloader {
my ($build) = @_;
+ # If the user has supplied a list of files to copy from the repository,
+ # do that now. We may need some of those files to correctly auto-detect
+ # the default kernel and initrd.
+ my $repo_prefix = $build->{settings}{repository} . '/' . $build->{settings}{arch} . '/';
+ my $copy_prefix = $build->get_builddir . '/';
+ foreach (group_by2(@{$build->{copy_from_repo}})) {
+ my ($src, $dst) = @$_;
+ copy_or_link($repo_prefix . $src, $copy_prefix . $dst);
+ }
+
# Create a subdirectory to hold the grub2 bootloader.
my $grub2_dir = $build->get_builddir('boot') . '/grub2';
mkdir_p($grub2_dir);
diff --git a/lib/MGA/DrakISO/BuildClassic.pm b/lib/MGA/DrakISO/BuildClassic.pm
index 21c9cb2..503b044 100755
--- a/lib/MGA/DrakISO/BuildClassic.pm
+++ b/lib/MGA/DrakISO/BuildClassic.pm
@@ -103,19 +103,10 @@ sub prepare_files {
my $version = $build->{settings}{version};
my $tag = $build->{settings}{tag};
- # Process the list of files or directories supplied by the user. If the
- # repository is on a local disk, we just create soft links, otherwise
- # we have to download the files.
- my $repo_dir = $build->{settings}{repository} . '/' . $arch . '/';
- my $copy_dir = $build->get_builddir . '/';
- foreach (group_by2(@{$build->{copy_from_repo}})) {
- my ($src, $dst) = @$_;
- copy_or_link($repo_dir . $src, $copy_dir . $dst);
- }
+ my $files_dir = $build->get_builddir('files') . '/';
- # Automatically generate the remaining files.
- create_product_id($build, $copy_dir . $arch . '/product.id');
- create_index($build, $copy_dir . $arch . '/pkg-' . $version . '-' . $tag . '.idx');
+ create_product_id($build, $files_dir . $arch . '/product.id');
+ create_index($build, $files_dir . $arch . '/pkg-' . $version . '-' . $tag . '.idx');
}
###############################################################################