Beispiel #1
0
/*ARGSUSED*/
int
bootprog(char *bpath, char *bargs, boolean_t user_specified_filename)
{
	boolean_t	once = B_FALSE;

	systype = set_fstype(v2path, bpath);

loop:
	/*
	 * Beware: the following code may be executed twice, with different
	 * bpath's if we discover a redirection file.
	 */

	if (verbosemode) {
		printf("device path '%s'\n", bpath);
		if (strcmp(bpath, v2path) != 0)
			printf("client path '%s'\n", v2path);
	}

	if (mountroot(bpath) != SUCCESS)
		prom_panic("Could not mount filesystem.");

	/*
	 * kernname (default-name) might have changed if mountroot() called
	 * boot_nfs_mountroot(), and it called set_default_filename().
	 */
	if (!user_specified_filename)
		(void) strcpy(filename, kernname);

	if (verbosemode)
		printf("standalone = `%s', args = `%s'\n", filename, bargs);

	set_client_bootargs(filename, bargs);

	if (!once &&
	    (strcmp(systype, "ufs") == 0 || strcmp(systype, "hsfs") == 0)) {
		char redirect[OBP_MAXPATHLEN];

		post_mountroot(filename, redirect);

		/*
		 * If we return at all, it's because we discovered
		 * a redirection file - the 'redirect' string now contains
		 * the name of the disk slice we should be looking at.
		 *
		 * Unmount the filesystem, tweak the boot path and retry
		 * the whole operation one more time.
		 */
		closeall(1);
		once = B_TRUE;
		redirect_boot_path(bpath, redirect);
		if (verbosemode)
			printf("%sboot: using '%s'\n", systype, bpath);

		goto loop;
		/*NOTREACHED*/
	}

	return (0);
}
Beispiel #2
0
int
determine_fstype_and_mountroot(char *path)
{
    set_default_fs(ufsname);
    if (mountroot(path) == VFS_SUCCESS) {
        systype = ufsname;
        return (VFS_SUCCESS);
    }

    set_default_fs(hsfsname);
    if (mountroot(path) == VFS_SUCCESS) {
        systype = hsfsname;
        return (VFS_SUCCESS);
    }
    clr_default_fs();

    return (VFS_FAILURE);
}