diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-03-21 14:32:30 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-03-21 14:32:30 +0000 |
commit | 49f85bfde6755eafc5089d5d2c5cd97325e6b11c (patch) | |
tree | 5facd7f2732ab47c05b091b4a74dc819c640cf7e /perl-install | |
parent | 743033b1f635d74f819b0e122e4787266b77120a (diff) | |
download | drakx-49f85bfde6755eafc5089d5d2c5cd97325e6b11c.tar drakx-49f85bfde6755eafc5089d5d2c5cd97325e6b11c.tar.gz drakx-49f85bfde6755eafc5089d5d2c5cd97325e6b11c.tar.bz2 drakx-49f85bfde6755eafc5089d5d2c5cd97325e6b11c.tar.xz drakx-49f85bfde6755eafc5089d5d2c5cd97325e6b11c.zip |
Force opening of cdrom tray when asking for a supplementary CD.
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install_any.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 5dddb6732..ca4d4c26a 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -443,6 +443,7 @@ sub selectSupplMedia { $cdrom =~ m,^/, or $cdrom = "/dev/$cdrom"; devices::make($cdrom); ejectCdrom($cdrom); + openCdromTray($cdrom); if ($o->ask_okcancel('', N("Insert the CD"), 1)) { #- mount suppl CD in /mnt/cdrom to avoid umounting /tmp/image mountCdrom("/mnt/cdrom", $cdrom); @@ -467,10 +468,7 @@ sub selectSupplMedia { eval { fs::umount("/mnt/cdrom") }; #- re-mount CD 1 if this was a cdrom install if ($main_method eq 'cdrom') { - eval { - my $dev = detect_devices::tryOpen($cdrom); - ioctl($dev, c::CDROMEJECT(), 1); - }; + openCdromTray($cdrom); $o->ask_warn('', N("Insert the CD 1 again")); mountCdrom("/tmp/image", $cdrom); log::l($@) if $@; @@ -899,6 +897,12 @@ sub unlockCdrom() { eval { ioctl(detect_devices::tryOpen($cdrom), c::CDROM_LOCKDOOR(), 0) }; } +sub openCdromTray { + my ($cdrom) = @_; + eval { ioctl(detect_devices::tryOpen($cdrom), c::CDROMEJECT(), 1) }; + $@ and log::l("ejection failed: $@"); +} + sub ejectCdrom { my ($o_cdrom, $o_mountpoint) = @_; getFile("XXX"); #- close still opened filehandle @@ -920,7 +924,6 @@ sub ejectCdrom { my $dev = detect_devices::tryOpen($cdrom); ioctl($dev, c::CDROMEJECT(), 1) if ioctl($dev, c::CDROM_DRIVE_STATUS(), 0) == c::CDS_DISC_OK(); }; - $@ and log::l("ejection failed: $@"); } sub warnAboutFilesStillOpen() { |