From abe6ca9f950427dfd7bb1f2068a1c95383328aea Mon Sep 17 00:00:00 2001 From: Thomas Backlund Date: Sat, 4 Jan 2014 21:51:06 +0100 Subject: add mga4-alpha1 configs --- files/halt.local.DVD | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 files/halt.local.DVD (limited to 'files/halt.local.DVD') diff --git a/files/halt.local.DVD b/files/halt.local.DVD new file mode 100755 index 0000000..6254c61 --- /dev/null +++ b/files/halt.local.DVD @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +use lib qw(/usr/lib/libDrakX); +use MDK::Common; +use detect_devices; +use c; + +my ($device) = cat_("/proc/mounts") =~ m!(/dev/\S+)\s+/live/media\s+iso9660!; +$device or exit; + +# try to put halt/reboot in cache, if not called directly from them +# mount is also needed by end of /etc/init.d/halt +system("$_ --help &>/dev/null") foreach qw(halt mount reboot); + +my $f = detect_devices::tryOpen($device); +# see openCdromTray() from install::any +ioctl($f, c::CDROM_LOCKDOOR(), 0); # unlock door +ioctl($f, c::CDROMEJECT(), 0); + +print "\n\nPlease press (or ) once the medium is removed.\n"; +system("read < /dev/console"); + +ioctl($f, c::CDROMCLOSETRAY(), 0); -- cgit v1.2.1