summaryrefslogtreecommitdiffstats
path: root/tools/draklive
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-12-26 19:14:30 +0000
committerOlivier Blin <oblin@mandriva.org>2005-12-26 19:14:30 +0000
commitcfb99f130340b29e1c927fe1718dbb92be689e68 (patch)
treeb53c4429b7703caa637f983c9a94da579d6b4361 /tools/draklive
parenta8a23699a31472804ae32000f81817d8ee497be7 (diff)
downloaddrakx-cfb99f130340b29e1c927fe1718dbb92be689e68.tar
drakx-cfb99f130340b29e1c927fe1718dbb92be689e68.tar.gz
drakx-cfb99f130340b29e1c927fe1718dbb92be689e68.tar.bz2
drakx-cfb99f130340b29e1c927fe1718dbb92be689e68.tar.xz
drakx-cfb99f130340b29e1c927fe1718dbb92be689e68.zip
umount eventually mounted usb devices before formatting or running syslinux
Diffstat (limited to 'tools/draklive')
-rwxr-xr-xtools/draklive7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/draklive b/tools/draklive
index 3471de491..f465db642 100755
--- a/tools/draklive
+++ b/tools/draklive
@@ -546,6 +546,11 @@ sub create_master {
}
}
+sub maybe_umount_device {
+ my ($device) = @_;
+ run_('umount', $device) if cat_('/proc/mounts') =~ m!^$device\s+!m;
+}
+
sub format_cdrom_device {
my ($_live, $media) = @_;
run_('cdrecord', '-v', 'dev=' . $media->{device}, "blank=fast");
@@ -553,6 +558,7 @@ sub format_cdrom_device {
sub format_usb_device {
my ($_live, $media) = @_;
+ maybe_umount_device($media->{device});
run_('mkdosfs', $media->{device})
or die "unable to format device $media->{device}";
}
@@ -596,6 +602,7 @@ sub record_usb_master {
run_('rsync', '-vdP', $live->{workdir} . $live->{prefix}{loopbacks} . '/', $live->{mnt} . $live->{prefix}{loopbacks})
unless $opts->{refresh_boot_only};
run_('umount', $live->{mnt});
+ maybe_umount_device($device);
#- use syslinux -s, "safe, slow and stupid" version of SYSLINUX
run_('syslinux', '-s', $device) or die "unable to run syslinux on $device";
}