summaryrefslogtreecommitdiffstats
path: root/tools/draklive
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-12-16 19:13:11 +0000
committerOlivier Blin <oblin@mandriva.org>2005-12-16 19:13:11 +0000
commit199fee580831d69aa53817737d97240c0fca0479 (patch)
treec6dae4290b4664d3432bea2a8027606e91cbd760 /tools/draklive
parent2f5498998d4f2ba52dbb50616b9c0e6a1f23fd22 (diff)
downloaddrakx-199fee580831d69aa53817737d97240c0fca0479.tar
drakx-199fee580831d69aa53817737d97240c0fca0479.tar.gz
drakx-199fee580831d69aa53817737d97240c0fca0479.tar.bz2
drakx-199fee580831d69aa53817737d97240c0fca0479.tar.xz
drakx-199fee580831d69aa53817737d97240c0fca0479.zip
format usb device when asked only, use "mlabel -i <dev> ::" to set label instead
Diffstat (limited to 'tools/draklive')
-rwxr-xr-xtools/draklive20
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/draklive b/tools/draklive
index a3d9065cc..d739701bf 100755
--- a/tools/draklive
+++ b/tools/draklive
@@ -232,6 +232,7 @@ my %storage = (
usb => {
modules => 'bus/usb disk/raw|usb',
create => undef,
+ format => \&format_usb_device,
record => \&record_usb_master,
},
);
@@ -506,14 +507,20 @@ sub create_master {
sub format_cdrom_device {
my ($live) = @_;
- $live->{media}{device} or die "no device defined in media configuration";
run_('cdrecord', '-v', 'dev=' . $live->{media}{device}, "blank=fast");
}
+sub format_usb_device {
+ my ($live) = @_;
+ run_('mkdosfs', $live->{media}{device})
+ or die "unable to format device $live->{media}{device}";
+}
+
sub format_device {
my ($live) = @_;
+ $live->{media}{device} or die "no device defined in media configuration";
if (my $format = $storage{$live->{media}{storage}}{format}) {
- $format->($live, $o_refresh_boot_only);
+ $format->($live);
} else {
warn "not implemented yet";
}
@@ -529,12 +536,11 @@ sub record_cdrom_master {
sub record_usb_master {
my ($live, $o_refresh_boot_only) = @_;
- my $label = get_media_label($live);
- if ($live->{media}{device} && $label) {
- run_('mkdosfs', '-n', $label, $live->{media}{device})
- or die "unable to format device $live->{media}{device}";
+ if (my $label = $live->{media}{device} && get_media_label($live)) {
+ run_('mlabel', '-i', $live->{media}{device}, '::' . $label);
}
- my $device = get_media_device($live);
+ my $device = get_media_device($live)
+ or die "unable to find recording device (missing label? try with --device <device>)";
mkdir_p($live->{mnt});
run_('mount', $device, $live->{mnt})
or die "unable to mount $device";