summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-10-28 20:43:06 +0000
committerOlivier Blin <oblin@mandriva.com>2008-10-28 20:43:06 +0000
commit1ed9d8e1506275eb66d2e1a822c5d66554d3b1d0 (patch)
tree76d092339a75794dfbf6f87fe20b7d5bda29b6b8
parentff93412d481bc1387b8164743964a488db1589cc (diff)
downloaddraklive-1ed9d8e1506275eb66d2e1a822c5d66554d3b1d0.tar
draklive-1ed9d8e1506275eb66d2e1a822c5d66554d3b1d0.tar.gz
draklive-1ed9d8e1506275eb66d2e1a822c5d66554d3b1d0.tar.bz2
draklive-1ed9d8e1506275eb66d2e1a822c5d66554d3b1d0.tar.xz
draklive-1ed9d8e1506275eb66d2e1a822c5d66554d3b1d0.zip
move get_initrd_path as method in MDV::Draklive::Media
-rwxr-xr-xdraklive19
-rw-r--r--lib/MDV/Draklive/Media.pm5
2 files changed, 12 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,
diff --git a/lib/MDV/Draklive/Media.pm b/lib/MDV/Draklive/Media.pm
index c6aa625..2845fc8 100644
--- a/lib/MDV/Draklive/Media.pm
+++ b/lib/MDV/Draklive/Media.pm
@@ -1,3 +1,8 @@
package MDV::Draklive::Media;
+sub get_initrd_path {
+ my ($media) = @_;
+ '/' . $media->{storage} . '/initrd.gz';
+}
+
1;