summaryrefslogtreecommitdiffstats
path: root/draklive
diff options
context:
space:
mode:
Diffstat (limited to 'draklive')
-rwxr-xr-xdraklive19
1 files changed, 7 insertions, 12 deletions
diff --git a/draklive b/draklive
index a075fab..4ed1d1c 100755
--- a/draklive
+++ b/draklive
@@ -369,11 +369,6 @@ my %overlay = (
},
);
-sub get_initrd_path {
- my ($media) = @_;
- '/' . $media->{storage} . '/initrd.gz';
-}
-
sub get_syslinux_path {
my ($media, $opts) = @_;
'/' . $media->{storage} . '/syslinux' . ($opts->{boot} && '-boot-' . $opts->{boot}) . '.cfg';
@@ -387,7 +382,7 @@ sub need_media_specific_boot {
sub create_media_initrd {
my ($live) = @_;
create_initrd_for_media($live, $live->{media});
- cp_f($live->get_builddir . $live->{prefix}{build}{boot} . get_initrd_path($live->{media}),
+ cp_f($live->get_builddir . $live->{prefix}{build}{boot} . $live->{media}->get_initrd_path,
$live->{copy_initrd}) if $live->{copy_initrd};
}
@@ -595,7 +590,7 @@ sub compress_initrd_tree {
my $inodes = chomp_(run_program::get_stdout("find $initrd_tree | wc -l")) + 100;
my $initrd_size = $size + 350 + int($inodes / 10); #- 10 inodes needs 1K
$initrd_size += 600; # splashy
- my $initrd = $live->get_builddir . $live->{prefix}{build}{boot} . get_initrd_path($media);
+ my $initrd = $live->get_builddir . $live->{prefix}{build}{boot} . $media->get_initrd_path;
$initrd =~ s/.gz$//;
mkdir_p(dirname($initrd));
@@ -615,7 +610,7 @@ sub add_splash {
my ($live, $media) = @_;
if ($live->{system}{vga_mode} && $live->{system}{splash} ne 'no') {
require bootloader;
- my $initrd = $live->get_builddir . $live->{prefix}{build}{boot} . get_initrd_path($media);
+ my $initrd = $live->get_builddir . $live->{prefix}{build}{boot} . $media->get_initrd_path;
my $tmp_initrd = '/tmp/initrd.gz';
cp_f($initrd, $live->get_system_root . $tmp_initrd);
{
@@ -673,7 +668,7 @@ sub build_syslinux_cfg {
my $to_root = get_boot_setting($media, 'fs', $opts) eq 'vfat';
my $boot = get_media_prefix($live, 'boot', $opts->{boot});
my ($initrd, $kernel, $bootlogo, $help) = map { $to_root ? basename($_) : $_ }
- map { $boot . $_ } get_initrd_path($media), @syslinux_boot_files;
+ map { $boot . $_ } $media->get_initrd_path, @syslinux_boot_files;
my $has_bootlogo = $live->{system}{gfxboot} &&
-e $live->get_builddir . $live->{prefix}{build}{boot} . '/syslinux/bootlogo';
my $timeout = get_bootloader_timeout($live) * 10;
@@ -698,7 +693,7 @@ sub build_grub_cfg {
my ($live, $media, $opts, $device) = @_;
#- FIXME? first partition is hardcoded for loopback (master images)
my ($part_nb) = $device =~ m!/dev/loop! ? 1 : $device =~ /(\d+)$/;
- my $initrd = get_initrd_path($media);
+ my $initrd = $media->get_initrd_path;
build_grub_cfg_raw($live, $media, $initrd, $opts, $part_nb);
}
@@ -1386,7 +1381,7 @@ sub install_usb_bootloader {
if ($bootloader eq 'syslinux') {
cp_f($live->get_builddir . $_, $live->{mnt}) foreach map {
$live->{prefix}{boot} . $_;
- } get_syslinux_path($media, $opts), get_initrd_path($media), @syslinux_boot_files;
+ } get_syslinux_path($media, $opts), $media->get_initrd_path, @syslinux_boot_files;
} elsif ($bootloader eq 'grub') {
#- FIXME: add get_grub_path (when building boot configuration files)
# and get_bootloader_path (when copying)
@@ -1637,7 +1632,7 @@ sub get_disk_replicator_path {
sub get_disk_replicator_files {
my ($live) = @_;
my $media_boot = get_media_prefix($live, 'boot');
- my $initrd = $media_boot . get_initrd_path($live->{replicator}{media});
+ my $initrd = $media_boot . $live->{replicator}{media}->get_initrd_path;
(
'/usr/lib/drakx-installer-images/isolinux/alt0/vmlinuz' => $media_boot . '/vmlinuz',
'/usr/lib/drakx-installer-images/isolinux/alt0/all.rdz' => $initrd,