summaryrefslogtreecommitdiffstats
path: root/lib/MGA/DrakISO/Media.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-18 23:13:49 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-18 23:13:49 +0000
commit7f97b53ea0cadced2321414a2b7054a4811eda6f (patch)
treef0121a7ecd1cdf31e95a376b7cda14692880df97 /lib/MGA/DrakISO/Media.pm
parentfce42d85023e9e0cbd3b7fbd98ff3b734814612a (diff)
downloaddrakiso-7f97b53ea0cadced2321414a2b7054a4811eda6f.tar
drakiso-7f97b53ea0cadced2321414a2b7054a4811eda6f.tar.gz
drakiso-7f97b53ea0cadced2321414a2b7054a4811eda6f.tar.bz2
drakiso-7f97b53ea0cadced2321414a2b7054a4811eda6f.tar.xz
drakiso-7f97b53ea0cadced2321414a2b7054a4811eda6f.zip
Remove unused code.
Diffstat (limited to 'lib/MGA/DrakISO/Media.pm')
-rw-r--r--lib/MGA/DrakISO/Media.pm47
1 files changed, 2 insertions, 45 deletions
diff --git a/lib/MGA/DrakISO/Media.pm b/lib/MGA/DrakISO/Media.pm
index 169d22d..d69854f 100644
--- a/lib/MGA/DrakISO/Media.pm
+++ b/lib/MGA/DrakISO/Media.pm
@@ -3,10 +3,11 @@ package MGA::DrakISO::Media;
use strict;
use MDK::Common;
-use MGA::DrakISO::Storage;
use POSIX;
use common;
+use MGA::DrakISO::Storage;
+
sub new {
my ($media) = @_;
@@ -27,64 +28,20 @@ sub new {
$media;
}
-sub get_initrd_path {
- my ($media) = @_;
- '/' . $media->{storage} . '/initrd.gz';
-}
-
-#- mainly for storage-specific subroutines
sub get_storage_setting {
my ($media, $setting) = @_;
$MGA::DrakISO::Storage::storage_types{$media->{storage}}{$setting};
}
-#- for actions that support an optional boot storage type
-sub get_boot_setting {
- my ($media, $setting, $opts) = @_;
- $opts->{boot} ? $MGA::DrakISO::Storage::storage_types{$opts->{boot}}{$setting} : get_media_setting($media, $setting);
-}
-
#- for user-customisable media setting, that can override storage setting
sub get_media_setting {
my ($media, $setting) = @_;
$media->{$setting} || $media->get_storage_setting($setting);
}
-sub get_media_fs_module {
- my ($media) = @_;
- my $fs = $media->get_media_setting('fs');
- $fs eq 'iso9660' ? 'isofs' : $fs eq 'ext2' ? @{[]} : $fs;
-}
-
sub get_media_label {
my ($media) = @_;
first($media->get_media_setting('source') =~ /^LABEL=(.*)$/);
}
-sub get_media_source_for_nash {
- my ($media) = @_;
- my $label = $media->get_media_label;
- #- strip vfat labels to 11 chars and upper-case it
- $label && $media->get_media_setting('fs') eq 'vfat' ?
- 'LABEL=' . uc(substr($label, 0, 11)) :
- $media->get_media_setting('source');
-}
-
-sub find_partition_index {
- my ($media, $mntpoint) = @_;
- eval { find_index { $_->{mntpoint} eq $mntpoint } @{$media->{partitions}} };
-}
-
-sub find_boot_partition_index {
- my ($media) = @_;
- $media->find_partition_index('/boot') || $media->find_partition_index('/');
-}
-
-sub supplement_slash_size {
- my ($media, $total_size) = @_;
- my $correction = 1.2;
- my $slash = find { $_->{mntpoint} eq '/' } @{$media->{partitions}};
- $slash->{size} ||= POSIX::ceil($total_size * $correction / $common::SECTORSIZE);
-}
-
1;