Improve the root-dev prompt facility for printing devices which could

possibly be a root filesystem.
This commit is contained in:
phk 2003-06-07 15:46:53 +00:00
parent c9fca2ba58
commit 8d105bca1c
3 changed files with 9 additions and 20 deletions

View File

@ -172,7 +172,7 @@ struct g_provider {
};
/* geom_dev.c */
int g_dev_print(void);
void g_dev_print(void);
/* geom_dump.c */
void g_hexdump(void *ptr, int length);

View File

@ -76,19 +76,17 @@ static struct g_class g_dev_class = {
.taste = g_dev_taste,
};
int
void
g_dev_print(void)
{
struct g_geom *gp;
char const *p = "";
g_waitidle();
if (LIST_EMPTY(&g_dev_class.geom))
return (0);
printf("List of GEOM disk devices:\n ");
LIST_FOREACH(gp, &g_dev_class.geom, geom)
printf(" %s", gp->name);
LIST_FOREACH(gp, &g_dev_class.geom, geom) {
printf("%s%s", p, gp->name);
p = " ";
}
printf("\n");
return (1);
}
/*

View File

@ -1600,8 +1600,6 @@ static int
vfs_mountroot_ask(void)
{
char name[128];
int i;
dev_t dev;
for(;;) {
printf("\nManual root filesystem specification:\n");
@ -1618,15 +1616,8 @@ vfs_mountroot_ask(void)
if (name[0] == 0)
return(1);
if (name[0] == '?') {
if (!g_dev_print()) {
printf("Possibly valid devices for 'ufs' root:\n");
for (i = 0; i < NUMCDEVSW; i++) {
dev = makedev(i, 0);
if (devsw(dev) != NULL)
printf(" \"%s\"", devsw(dev)->d_name);
}
}
printf("\n");
printf("\nList of GEOM managed disk devices:\n ");
g_dev_print();
continue;
}
if (!vfs_mountroot_try(name))