From 35b3921b16054fe31afbe8b00f2b0764e8401630 Mon Sep 17 00:00:00 2001 From: joerg Date: Sat, 9 Nov 1996 11:57:40 +0000 Subject: [PATCH] If mounting the fixit floppy fails in the first place, warn the user but make a second attempt using MNT_FORCE, just in case it has been unclean from a previous crash. That's dangerous, but far better than keeping the despaired user standing in the rain... (Experienced admins can still fsck it then, and remount. Others will either totally crash, or incidentally succeed, without much further help possible...) Btw., mount(2) misses the description of MNT_FORCE for the mount syscall. --- release/sysinstall/install.c | 6 +++++- usr.sbin/sade/install.c | 6 +++++- usr.sbin/sysinstall/install.c | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index 52badb1fcc9a..b9c831d542d5 100644 --- a/release/sysinstall/install.c +++ b/release/sysinstall/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.136 1996/11/07 15:45:59 jkh Exp $ + * $Id: install.c,v 1.137 1996/11/08 05:38:27 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -266,6 +266,10 @@ installFixitFloppy(dialogMenuItem *self) msgConfirm("Please insert a writable fixit floppy and press return"); if (mount(MOUNT_UFS, "/mnt2", 0, (caddr_t)&args) != -1) break; + msgConfirm("An attempt to mount the fixit floppy failed, maybe the filesystem\n" + "is unclean. Trying a forcible mount as a last resort..."); + if (mount(MOUNT_UFS, "/mnt2", MNT_FORCE, (caddr_t)&args) != -1) + break; if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?") != 0) return DITEM_FAILURE; } diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 52badb1fcc9a..b9c831d542d5 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.136 1996/11/07 15:45:59 jkh Exp $ + * $Id: install.c,v 1.137 1996/11/08 05:38:27 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -266,6 +266,10 @@ installFixitFloppy(dialogMenuItem *self) msgConfirm("Please insert a writable fixit floppy and press return"); if (mount(MOUNT_UFS, "/mnt2", 0, (caddr_t)&args) != -1) break; + msgConfirm("An attempt to mount the fixit floppy failed, maybe the filesystem\n" + "is unclean. Trying a forcible mount as a last resort..."); + if (mount(MOUNT_UFS, "/mnt2", MNT_FORCE, (caddr_t)&args) != -1) + break; if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?") != 0) return DITEM_FAILURE; } diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 52badb1fcc9a..b9c831d542d5 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.136 1996/11/07 15:45:59 jkh Exp $ + * $Id: install.c,v 1.137 1996/11/08 05:38:27 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -266,6 +266,10 @@ installFixitFloppy(dialogMenuItem *self) msgConfirm("Please insert a writable fixit floppy and press return"); if (mount(MOUNT_UFS, "/mnt2", 0, (caddr_t)&args) != -1) break; + msgConfirm("An attempt to mount the fixit floppy failed, maybe the filesystem\n" + "is unclean. Trying a forcible mount as a last resort..."); + if (mount(MOUNT_UFS, "/mnt2", MNT_FORCE, (caddr_t)&args) != -1) + break; if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?") != 0) return DITEM_FAILURE; }