Esempio n. 1
0
status_t
register_boot_file_system(BootVolume& bootVolume)
{
	Directory* rootDirectory = bootVolume.RootDirectory();
	gRoot->AddLink("boot", rootDirectory);

	Partition *partition;
	status_t status = gRoot->GetPartitionFor(rootDirectory, &partition);
	if (status != B_OK) {
		dprintf("register_boot_file_system(): could not locate boot volume in "
			"root!\n");
		return status;
	}

	gBootVolume.SetInt64(BOOT_VOLUME_PARTITION_OFFSET,
		partition->offset);

	if (bootVolume.IsPackaged()) {
		gBootVolume.SetBool(BOOT_VOLUME_PACKAGED, true);
		PackageVolumeState* state = bootVolume.GetPackageVolumeState();
		if (state->Name() != NULL)
			gBootVolume.AddString(BOOT_VOLUME_PACKAGES_STATE, state->Name());
	}

	Node *device = get_node_from(partition->FD());
	if (device == NULL) {
		dprintf("register_boot_file_system(): could not get boot device!\n");
		return B_ERROR;
	}

	return platform_register_boot_device(device);
}
Esempio n. 2
0
status_t
register_boot_file_system(Directory *volume)
{
    gRoot->AddLink("boot", volume);

    Partition *partition;
    status_t status = gRoot->GetPartitionFor(volume, &partition);
    if (status != B_OK) {
        dprintf("register_boot_file_system(): could not locate boot volume in root!\n");
        return status;
    }

    gBootVolume.SetInt64(BOOT_VOLUME_PARTITION_OFFSET, partition->offset);

    Node *device = get_node_from(partition->FD());
    if (device == NULL) {
        dprintf("register_boot_file_system(): could not get boot device!\n");
        return B_ERROR;
    }

    return platform_register_boot_device(device);
}