sys/kern/vfs_subr.c
/*
 * Find an appropriate filesystem to use for the root. If a filesystem
 * has not been preselected, walk through the list of known filesystems
 * trying those that have mountroot routines, and try them until one
 * works or we have tried them all.
 */
Find an appropriate filesystem to use for the root. If a filesystem
has not been preselected, walk through the list of known filesystems
trying those that have mountroot routines, and try them until one
works or we have tried them all.
Find an appropriate filesystem to use for the root . If a filesystem has not been preselected walk through the list of known filesystems trying those that have mountroot routines and try them until one works or we have tried them all .
int
vfs_mountroot()
{
	struct vfsconf *vfsp;
	extern int (*mountroot)(void);
	int error;
	if (mountroot != NULL)
		return ((*mountroot)());
	for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next) {
		if (vfsp->vfc_mountroot == NULL)
			continue;
		if ((error = (*vfsp->vfc_mountroot)()) == 0)
			return (0);
		printf("%s_mountroot failed: %d\n", vfsp->vfc_name, error);
	}
	return (ENODEV);
}
int vfs_mountroot ( ) { struct vfsconf * vfsp ; extern int ( * mountroot ) ( void ) ; int error ; if ( mountroot != NULL ) return ( ( * mountroot ) ( ) ) ; for ( vfsp = vfsconf ; vfsp ; vfsp = vfsp -> vfc_next ) { if ( vfsp -> vfc_mountroot == NULL ) continue ; if ( ( error = ( * vfsp -> vfc_mountroot ) ( ) ) == 0 ) return ( 0 ) ; printf ( " \n " , vfsp -> vfc_name , error ) ; } return ( ENODEV ) ; }
Find an appropriate filesystem to use for the root.
Find an appropriate filesystem to use for the root .