summaryrefslogtreecommitdiffstats
path: root/draklive
diff options
context:
space:
mode:
Diffstat (limited to 'draklive')
-rwxr-xr-xdraklive15
1 files changed, 5 insertions, 10 deletions
diff --git a/draklive b/draklive
index 3a1f1b9..4e72694 100755
--- a/draklive
+++ b/draklive
@@ -1022,15 +1022,10 @@ sub list_selected_loopbacks {
$live->{settings}{pack} ? @{$live->{packs}{$live->{settings}{pack}} || []} : ());
}
-sub get_media_label {
- my ($media) = @_;
- first($media->get_media_setting('source') =~ /^LABEL=(.*)$/);
-}
-
sub get_media_device {
my ($live, $opts) = @_;
return $opts->{device} if $opts->{device};
- my $label = get_media_label($live->{media}) or return $live->{media}->get_media_setting('source');
+ my $label = $live->{media}->get_media_label or return $live->{media}->get_media_setting('source');
my $device = chomp_(`readlink -f /dev/disk/by-label/$label`)
or die "unable to find device for /dev/disk/by-label/$label\n";
$device;
@@ -1044,7 +1039,7 @@ sub get_media_prefix {
sub get_media_source_for_nash {
my ($media) = @_;
- my $label = get_media_label($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)) :
@@ -1159,7 +1154,7 @@ sub get_cdrom_master_path {
sub create_cdrom_master {
my ($live, $opts) = @_;
- my $label = get_media_label($live->{media}) or die "the source device must be described by a label\n";
+ my $label = $live->{media}->get_media_label or die "the source device must be described by a label\n";
my $dest;
unless ($opts->{onthefly}) {
$dest = get_cdrom_master_path($live, $opts);
@@ -1408,7 +1403,7 @@ sub record_usb_master {
my $media_boot = get_media_prefix($live, 'boot', $opts->{boot});
my $media_loopbacks = get_media_prefix($live, 'loopbacks', $opts->{boot});
- if (my $label = !$opts->{boot_only} && $opts->{device} && get_media_label($media)) {
+ if (my $label = !$opts->{boot_only} && $opts->{device} && $media->get_media_label) {
set_device_label($opts->{device}, $media->get_media_setting('fs'), $label);
}
my $device = get_media_device($live, $opts)
@@ -1472,7 +1467,7 @@ sub record_harddisk_master {
my $media_boot = get_media_prefix($live, 'boot', $opts->{boot});
my $media_loopbacks = get_media_prefix($live, 'loopbacks', $opts->{boot});
- if (my $label = !$opts->{boot_only} && $opts->{device} && get_media_label($media)) {
+ if (my $label = !$opts->{boot_only} && $opts->{device} && $media->get_media_label) {
set_device_label($opts->{device}, $media->get_media_setting('fs'), $label);
}
my $device = get_media_device($live, $opts)