1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Be more informative and try to ask the user in some instances if we can't

figure out the root device.
This commit is contained in:
Poul-Henning Kamp 1999-07-03 08:24:00 +00:00
parent e366aade76
commit ad6cb55952
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=48512
4 changed files with 42 additions and 22 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
* $Id: autoconf.c,v 1.124 1999/05/31 11:25:39 phk Exp $
* $Id: autoconf.c,v 1.125 1999/06/01 18:56:10 phk Exp $
*/
/*
@ -431,18 +431,27 @@ setroot()
#endif
return;
}
if ((bootdev & B_MAGICMASK) != B_DEVMAGIC)
if ((bootdev & B_MAGICMASK) != B_DEVMAGIC) {
printf("No B_DEVMAGIC\n");
setconf();
return;
}
majdev = B_TYPE(bootdev);
dev = makebdev(majdev, 0);
if (bdevsw(dev) == NULL)
if (bdevsw(dev) == NULL) {
printf("No bdevsw (majdev=%d bootdev=%08x)\n", majdev, bootdev);
setconf();
return;
}
unit = B_UNIT(bootdev);
slice = B_SLICE(bootdev);
if (slice == WHOLE_DISK_SLICE)
slice = COMPATIBILITY_SLICE;
if (slice < 0 || slice >= MAX_SLICES)
if (slice < 0 || slice >= MAX_SLICES) {
printf("bad slice\n");
setconf();
return;
}
/*
* XXX kludge for inconsistent unit numbering and lack of slice
@ -508,6 +517,7 @@ setrootbyname(char *name)
int bd, unit, slice, part;
dev_t dev;
printf("setrootbyname(\"%s\")\n", name);
slice = 0;
part = 0;
cp = name;
@ -545,9 +555,9 @@ setrootbyname(char *name)
printf("junk after name\n");
return (1);
}
printf("driver=%s, unit=%d, slice=%d, part=%d\n",
name, unit, slice, part);
rootdev = makebdev(bd, dkmakeminor(unit, slice, part));
printf("driver=%s, unit=%d, slice=%d, part=%d -> rootdev=%08x\n",
name, unit, slice, part, rootdev);
return 0;
}
@ -569,9 +579,9 @@ setconf()
for (i = 0; i < NUMCDEVSW; i++) {
dev = makebdev(i, 0);
if (bdevsw(dev) != NULL)
printf(" %s", bdevsw(dev)->d_name);
printf(" \"%s\"", bdevsw(dev)->d_name);
}
printf(" followed by a unit number...\n");
printf("\nfollowed by a unit number...\n");
}
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
* $Id: autoconf.c,v 1.124 1999/05/31 11:25:39 phk Exp $
* $Id: autoconf.c,v 1.125 1999/06/01 18:56:10 phk Exp $
*/
/*
@ -431,18 +431,27 @@ setroot()
#endif
return;
}
if ((bootdev & B_MAGICMASK) != B_DEVMAGIC)
if ((bootdev & B_MAGICMASK) != B_DEVMAGIC) {
printf("No B_DEVMAGIC\n");
setconf();
return;
}
majdev = B_TYPE(bootdev);
dev = makebdev(majdev, 0);
if (bdevsw(dev) == NULL)
if (bdevsw(dev) == NULL) {
printf("No bdevsw (majdev=%d bootdev=%08x)\n", majdev, bootdev);
setconf();
return;
}
unit = B_UNIT(bootdev);
slice = B_SLICE(bootdev);
if (slice == WHOLE_DISK_SLICE)
slice = COMPATIBILITY_SLICE;
if (slice < 0 || slice >= MAX_SLICES)
if (slice < 0 || slice >= MAX_SLICES) {
printf("bad slice\n");
setconf();
return;
}
/*
* XXX kludge for inconsistent unit numbering and lack of slice
@ -508,6 +517,7 @@ setrootbyname(char *name)
int bd, unit, slice, part;
dev_t dev;
printf("setrootbyname(\"%s\")\n", name);
slice = 0;
part = 0;
cp = name;
@ -545,9 +555,9 @@ setrootbyname(char *name)
printf("junk after name\n");
return (1);
}
printf("driver=%s, unit=%d, slice=%d, part=%d\n",
name, unit, slice, part);
rootdev = makebdev(bd, dkmakeminor(unit, slice, part));
printf("driver=%s, unit=%d, slice=%d, part=%d -> rootdev=%08x\n",
name, unit, slice, part, rootdev);
return 0;
}
@ -569,9 +579,9 @@ setconf()
for (i = 0; i < NUMCDEVSW; i++) {
dev = makebdev(i, 0);
if (bdevsw(dev) != NULL)
printf(" %s", bdevsw(dev)->d_name);
printf(" \"%s\"", bdevsw(dev)->d_name);
}
printf(" followed by a unit number...\n");
printf("\nfollowed by a unit number...\n");
}
}

View File

@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94
* $Id: vfs_conf.c,v 1.28 1999/05/24 00:37:26 jb Exp $
* $Id: vfs_conf.c,v 1.29 1999/06/26 14:44:24 peter Exp $
*/
/*
@ -129,7 +129,7 @@ vfs_mountrootfs(void *unused)
* New root mount structure
*/
if ((err = vfs_rootmountalloc(mountrootfsname, ROOTNAME, &mp))) {
printf("error %d: ", err);
printf("rootdev=%08x error=%d, ", rootdev, err);
panic("cannot mount root\n");
return ;
}
@ -170,7 +170,7 @@ vfs_mountrootfs(void *unused)
* (hardly worthwhile with the PANIC eh?)
*/
free( mp, M_MOUNT);
printf("error %d: ", err);
printf("rootdev=%08x error=%d, ", rootdev, err);
panic("cannot mount root (2)\n");
return;
}

View File

@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94
* $Id: vfs_conf.c,v 1.28 1999/05/24 00:37:26 jb Exp $
* $Id: vfs_conf.c,v 1.29 1999/06/26 14:44:24 peter Exp $
*/
/*
@ -129,7 +129,7 @@ vfs_mountrootfs(void *unused)
* New root mount structure
*/
if ((err = vfs_rootmountalloc(mountrootfsname, ROOTNAME, &mp))) {
printf("error %d: ", err);
printf("rootdev=%08x error=%d, ", rootdev, err);
panic("cannot mount root\n");
return ;
}
@ -170,7 +170,7 @@ vfs_mountrootfs(void *unused)
* (hardly worthwhile with the PANIC eh?)
*/
free( mp, M_MOUNT);
printf("error %d: ", err);
printf("rootdev=%08x error=%d, ", rootdev, err);
panic("cannot mount root (2)\n");
return;
}