summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2006-03-13 14:17:40 +0000
committerOlivier Blin <oblin@mandriva.org>2006-03-13 14:17:40 +0000
commit4c42a7af86363e43019230b5bfd50af3767a3e28 (patch)
treec149306c1aaece4d7351e03cb1d5874f929df70f
parent4df8d073e1f9b5c7dbddeb18875fc2dfc1ebeea4 (diff)
downloaddrakx-backup-do-not-use-4c42a7af86363e43019230b5bfd50af3767a3e28.tar
drakx-backup-do-not-use-4c42a7af86363e43019230b5bfd50af3767a3e28.tar.gz
drakx-backup-do-not-use-4c42a7af86363e43019230b5bfd50af3767a3e28.tar.bz2
drakx-backup-do-not-use-4c42a7af86363e43019230b5bfd50af3767a3e28.tar.xz
drakx-backup-do-not-use-4c42a7af86363e43019230b5bfd50af3767a3e28.zip
eject cd media before halt/reboot
-rw-r--r--live/One/2006.0/config/live.cfg1
-rw-r--r--live/One/2006.0/files/halt.local24
2 files changed, 25 insertions, 0 deletions
diff --git a/live/One/2006.0/config/live.cfg b/live/One/2006.0/config/live.cfg
index 0f5975120..66b7fef80 100644
--- a/live/One/2006.0/config/live.cfg
+++ b/live/One/2006.0/config/live.cfg
@@ -19,6 +19,7 @@ my $_l = {
files => [
[ 'files/kside238-ONE.png', '/usr/share/apps/kicker/pics/kside_download.png', 0644 ],
[ 'files/defaultspooler', '/etc/foomatic/defaultspooler', 0644 ],
+ [ 'files/halt.local', '/sbin/halt.local', 0755 ],
],
patches => [
'patches/halt.loopfs.patch',
diff --git a/live/One/2006.0/files/halt.local b/live/One/2006.0/files/halt.local
new file mode 100644
index 000000000..b39f97581
--- /dev/null
+++ b/live/One/2006.0/files/halt.local
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+use lib qw(/usr/lib/libDrakX);
+use MDK::Common;
+use detect_devices;
+use c;
+
+system("mount -t proc none /proc");
+my ($device) = cat_("/proc/mounts") =~ m!(/dev/\S+)\s+/live/media\s+iso9660!;
+system("umount /proc");
+$device or exit;
+
+# try to put halt/reboot in cache, if not called directly from them
+system("$_ --help 2>/dev/null") foreach qw(halt reboot);
+
+my $f = detect_devices::tryOpen($device);
+# see openCdromTray() and unlockCdrom(), from install_any
+ioctl($f, c::CDROM_LOCKDOOR(), 0);
+ioctl($f, c::CDROMEJECT(), 0);
+
+print "\n\nPlease press <Enter> once the medium is removed.\n";
+<STDIN>;
+
+ioctl($f, 0x5319, 0); # CDROMCLOSETRAY