From e69be5e8dc97a4dc8c45b79cbf7fb6f8fc646464 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 27 Nov 2003 13:36:49 +0000 Subject: move tries to eject cdrom --- mdk-stage1/init.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'mdk-stage1/init.c') diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c index 44fc9a3e9..31cfda544 100644 --- a/mdk-stage1/init.c +++ b/mdk-stage1/init.c @@ -26,6 +26,7 @@ #endif #include "config-stage1.h" +#include #if defined(__powerpc__) #define TIOCSCTTY 0x540E @@ -329,6 +330,15 @@ void unmount_filesystems(void) printf("\tumount failed: %s\n", fs[i].name); if (strcmp(fs[i].fs, "ext2") == 0) nb++; /* don't count not-ext2 umount failed */ } + +#ifdef MANDRAKE_MOVE + fd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK, 0); + if (fd > 0) { + printf("ejecting cdrom\n"); + ioctl(fd, CDROMEJECT, 0); + close(fd); + } +#endif if (nb) { printf("failed to umount some filesystems\n"); @@ -479,11 +489,13 @@ int main(int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)) sync(); sync(); if (!abnormal_termination) { - if (reboot_magic == 0x01234567) + if (reboot_magic == 0x01234567) { printf("automatic reboot in 10 seconds\n"); - else - printf("automatic poweroff in 10 seconds\n"); - sleep(10); + sleep(10); + } else { + printf("automatic poweroff in 15 seconds\n"); + sleep(15); + } reboot(0xfee1dead, 672274793, reboot_magic); } else { printf("you may safely reboot or halt your system\n"); -- cgit v1.2.1