diff options
author | Mystery Man <unknown@mandriva.org> | 2000-11-08 00:01:16 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2000-11-08 00:01:16 +0000 |
commit | d5c526273db473a7d87a26000585900fc10dda7d (patch) | |
tree | 0fdaabe7a00921b6cc556601b103d344fc7ac781 /perl-install/standalone/livedrake | |
parent | 9c164312d4bfff6d93e1c4529de6b992f2bebc44 (diff) | |
download | drakx-d5c526273db473a7d87a26000585900fc10dda7d.tar drakx-d5c526273db473a7d87a26000585900fc10dda7d.tar.gz drakx-d5c526273db473a7d87a26000585900fc10dda7d.tar.bz2 drakx-d5c526273db473a7d87a26000585900fc10dda7d.tar.xz drakx-d5c526273db473a7d87a26000585900fc10dda7d.zip |
This commit was manufactured by cvs2svn to create branch
'unlabeled-1.1.1'.
Diffstat (limited to 'perl-install/standalone/livedrake')
-rwxr-xr-x | perl-install/standalone/livedrake | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/perl-install/standalone/livedrake b/perl-install/standalone/livedrake new file mode 100755 index 000000000..397294543 --- /dev/null +++ b/perl-install/standalone/livedrake @@ -0,0 +1,52 @@ +#!/usr/bin/perl + +use lib qw(/usr/lib/libDrakX); + +use common qw(:common :system); +use interactive; +use mouse; +use c; + +local $_ = join '', @ARGV; + +/-h/ and die "usage: livedrake [--auto] [--testing]\n"; + +$::auto = /-auto/; +$::testing = /-testing/; +$::isStandalone = 1; + +my $in = vnew interactive('su'); + +my $cd_mntpoint = "/mnt/cdrom"; + +while (! -x "$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/live_install") { + ejectCdrom(); + $in->ask_okcancel(_("Change Cd-Rom"), +_("Please insert the Installation Cd-Rom in your drive and press Ok when done. +If you don't have it, press Cancel to avoid live upgrade."), 1) or $in->exit(0); + eval { fs::mount("/mnt/cdrom") }; +} + +if (-x "$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/live_install") { + chdir "/$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/"; + exec "./live_install"; +} + +$in->ask_warn('', _("Unable to start live upgrade !!!\n")); +$in->exit(1); + +sub unlockCdrom(;$) { + my ($cdrom) = @_; + $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1; + $cdrom or cat_("/etc/fstab") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1; + eval { $cdrom and ioctl detect_devices::tryOpen($1), c::CDROM_LOCKDOOR(), 0 }; +} + +sub ejectCdrom(;$) { + my ($cdrom) = @_; + $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1; + my $f = eval { $cdrom && detect_devices::tryOpen($cdrom) } or return; + getFile("XXX"); #- close still opened filehandle + eval { fs::umount("/mnt/cdrom") }; + ioctl $f, c::CDROMEJECT(), 1; +} |