From 46304bfe5a3c7beb586dc61aff63d7190373e424 Mon Sep 17 00:00:00 2001 From: msmith Date: Wed, 11 Mar 1998 00:10:31 +0000 Subject: If the root mount fails from a device that is not the compatability slice of a disk, because that slice does not exist, try again mounting from the compatability slice. This handles the case where a disk has been initialised by 'disklabel auto', which places a bogus and invalid slice entry on the disk. The bootstrap is not smart enough to reject this slice, and pretends to boot from it. Believing the the bootstrap at this point is unwise. Booting from non-'wd' disks thus prepared is still broken, as 'disklabel -rwB xdN auto' does not initialise the disk type field, and the bootstrap mistakenly claims that the disk is handled by 'wd'. Behaviour is now consistent with DEVFS expected characteristics. --- sys/kern/vfs_mount.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'sys/kern/vfs_mount.c') diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 56fb1b9..a42a89a 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94 - * $Id: vfs_conf.c,v 1.20 1998/01/09 03:21:01 eivind Exp $ + * $Id: vfs_conf.c,v 1.21 1998/02/09 06:09:32 eivind Exp $ */ /* @@ -135,6 +135,18 @@ vfs_mountrootfs(void *unused) * Attempt the mount */ err = VFS_MOUNT(mp, NULL, NULL, NULL, p); + /* + * rootdev may be bogus (slice field may be incorrect for disks) + * If slice field is nonzero, clear and retry. + * + * XXX Implicit knowledge of device minor number layout. + * This is placeholder code until saner root mounts arrive with + * DEVFS. + */ + if ((err == ENXIO) && (rootdev & 0xff0000)) { + rootdev &= ~0xff0000; + err = VFS_MOUNT(mp, NULL, NULL, NULL, p); + } if (err) { vfs_unbusy(mp, p); /* -- cgit v1.1