summaryrefslogtreecommitdiffstats
path: root/lib/MGA/DrakISO/BuildBoot.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-18 21:23:57 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-18 21:23:57 +0000
commit996706b13c0354ae98e08f4cd54eae2a5868434c (patch)
treebabaa5bcfbc3a51d6e0849757e5b3629a48a8047 /lib/MGA/DrakISO/BuildBoot.pm
parentcd2fe6bf1129641d59614d6382c5819acd8252e4 (diff)
downloaddrakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.tar
drakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.tar.gz
drakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.tar.bz2
drakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.tar.xz
drakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.zip
Remove ability to override default directory names.
It's unlikely anyone would want to do this, and it makes the code considerably harder to read.
Diffstat (limited to 'lib/MGA/DrakISO/BuildBoot.pm')
-rwxr-xr-xlib/MGA/DrakISO/BuildBoot.pm30
1 files changed, 14 insertions, 16 deletions
diff --git a/lib/MGA/DrakISO/BuildBoot.pm b/lib/MGA/DrakISO/BuildBoot.pm
index 895f7b7..8fbc164 100755
--- a/lib/MGA/DrakISO/BuildBoot.pm
+++ b/lib/MGA/DrakISO/BuildBoot.pm
@@ -42,7 +42,7 @@ sub prepare_live_system_boot {
# Create a build directory. This will contain all the files we need to
# exist in /boot on the ISO.
- my $boot_dir = $live->get_builddir . $live->{prefix}{build}{boot};
+ my $boot_dir = $live->get_builddir('boot');
mkdir_p($boot_dir);
# Locate the kernel we want to boot.
@@ -75,7 +75,7 @@ sub prepare_iso_bootloader {
my ($live) = @_;
# Create a subdirectory to hold the grub2 bootloader.
- my $grub2_dir = $live->get_builddir . $live->{prefix}{build}{boot} . '/grub2';
+ my $grub2_dir = $live->get_builddir('boot') . '/grub2';
mkdir_p($grub2_dir);
# Locate and copy the default font for the bootloader. If we can't find a
@@ -156,7 +156,7 @@ sub prepare_iso_bootloader {
-e $eltorito_img or die "cannot find El Torito boot image $eltorito_img\n";
cp_f($eltorito_img, $grub2_dir . '/eltorito.img');
} else {
- build_grub2_eltorito_img($live, $grub2_dir . '/eltorito.img');
+ build_grub2_eltorito_img($grub2_dir . '/eltorito.img');
}
my $label = $live->{media}->get_media_label;
@@ -189,7 +189,7 @@ sub prepare_iso_bootloader {
# Create another build directory. This will contain all the files we need
# to exist in the /EFI directory on the ISO.
- my $efi_root_dir = $live->get_builddir . $live->{prefix}{build}{EFI};
+ my $efi_root_dir = $live->get_builddir('EFI');
my $efi_boot_dir = $efi_root_dir . '/BOOT';
mkdir_p($efi_boot_dir);
@@ -200,7 +200,7 @@ sub prepare_iso_bootloader {
-e $bootx64_efi or die "cannot find EFI boot image $bootx64_efi\n";
cp_f($bootx64_efi, $efi_boot_dir . '/bootx64.efi');
} else {
- build_grub2_bootx64_efi($live, $efi_boot_dir . '/bootx64.efi');
+ build_grub2_bootx64_efi($efi_boot_dir . '/bootx64.efi');
}
# Build a grub2 configuration file for UEFI boot. This just chains to the
@@ -217,7 +217,7 @@ sub prepare_iso_bootloader {
}
# Create another build directory for temporarily storing the ESP image.
- my $images_dir = $live->get_builddir . $live->{prefix}{build}{images};
+ my $images_dir = $live->get_builddir('images');
mkdir_p($images_dir);
# Construct an ESP image. This is needed for USB boot.
@@ -228,28 +228,28 @@ sub prepare_iso_bootloader {
}
sub build_grub2_eltorito_img {
- my ($live, $output) = @_;
+ my ($output) = @_;
my @modules = qw(biosdisk iso9660 fat part_msdos all_video font png gfxterm gfxmenu linux
keylayouts at_keyboard usb_keyboard configfile echo gettext ls search test);
run_('grub2-mkimage',
'--output', $output,
- '--prefix', $live->get_media_prefix('boot') . '/grub2',
+ '--prefix', '/boot/grub2',
'--format', 'i386-pc-eltorito',
@modules
);
}
sub build_grub2_bootx64_efi {
- my ($live, $output) = @_;
+ my ($output) = @_;
my @modules = qw(iso9660 fat part_msdos all_video font png gfxterm gfxmenu linux
keylayouts at_keyboard usb_keyboard configfile echo gettext ls search test);
run_('grub2-mkimage',
'--output', $output,
- '--prefix', $live->get_media_prefix('EFI') . '/BOOT',
+ '--prefix', '/EFI/BOOT',
'--format', 'x86_64-efi',
@modules
);
@@ -265,12 +265,10 @@ sub build_grub2_cfg {
my $gettext = $add_lang_menu ? '$' : '';
- my $boot_dir = $live->get_media_prefix('boot');
-
join("\n",
"if [ -z \$initialised ] ; then",
" search --no-floppy --set=root -l '" . $live->{media}->get_media_label . "'",
- " set prefix=(\$root)" . $live->get_media_prefix('boot') . "/grub2",
+ " set prefix=(\$root)/boot/grub2",
"",
" if loadfont \$prefix/fonts/unicode.pf2 ; then",
" set gfxmode=1024x768,800x600,auto",
@@ -307,8 +305,8 @@ sub build_grub2_cfg {
my ($name, $cmdline) = @$_;
join("\n",
"menuentry $gettext\"$name\" {",
- " linux $boot_dir/vmlinuz " . get_default_append($live) . if_($cmdline, " $cmdline"),
- " initrd $boot_dir/initrd.gz",
+ " linux /boot/vmlinuz " . get_default_append($live) . if_($cmdline, " $cmdline"),
+ " initrd /boot/initrd.gz",
"}"
);
} group_by2(@{$live->{media}{bootloader_entries}})),
@@ -410,7 +408,7 @@ sub build_uefi_grub2_cfg {
my ($live) = @_;
join("\n",
"search --no-floppy --set=root -l '" . $live->{media}->get_media_label . "'",
- "set prefix=(\$root)" . $live->get_media_prefix('boot') . "/grub2",
+ "set prefix=(\$root)/boot/grub2",
"",
"set uefi=true",
"export uefi",