本文整理汇总了C++中KPartition::ContentType方法的典型用法代码示例。如果您正苦于以下问题:C++ KPartition::ContentType方法的具体用法?C++ KPartition::ContentType怎么用?C++ KPartition::ContentType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPartition
的用法示例。
在下文中一共展示了KPartition::ContentType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
vfs_mount_boot_file_system(kernel_args* args)
{
PartitionStack partitions;
status_t status = get_boot_partitions(args, partitions);
if (status < B_OK) {
panic("get_boot_partitions failed!");
}
if (partitions.IsEmpty()) {
panic("did not find any boot partitions!");
}
KPartition* bootPartition;
while (partitions.Pop(&bootPartition)) {
KPath path;
if (bootPartition->GetPath(&path) != B_OK)
panic("could not get boot device!\n");
const char* fsName = NULL;
bool readOnly = false;
if (strcmp(bootPartition->ContentType(), "ISO9660 File System") == 0) {
fsName = "iso9660:write_overlay:attribute_overlay";
readOnly = true;
} else if (bootPartition->IsReadOnly()
&& strcmp(bootPartition->ContentType(), "Be File System") == 0) {
fsName = "bfs:write_overlay";
readOnly = true;
}
TRACE(("trying to mount boot partition: %s\n", path.Path()));
gBootDevice = _kern_mount("/boot", path.Path(), fsName, 0, NULL, 0);
if (gBootDevice >= B_OK) {
gReadOnlyBootDevice = readOnly;
break;
}
}
if (gBootDevice < B_OK)
panic("could not mount boot device!\n");
// create link for the name of the boot device
fs_info info;
if (_kern_read_fs_info(gBootDevice, &info) == B_OK) {
char path[B_FILE_NAME_LENGTH + 1];
snprintf(path, sizeof(path), "/%s", info.volume_name);
_kern_create_symlink(-1, path, "/boot", 0);
}
// Do post-boot-volume module initialization. The module code wants to know
// whether the module images the boot loader has pre-loaded are the same as
// on the boot volume. That is the case when booting from hard disk or CD,
// but not via network.
int32 bootMethodType = args->boot_volume.GetInt32(BOOT_METHOD,
BOOT_METHOD_DEFAULT);
bool bootingFromBootLoaderVolume = bootMethodType == BOOT_METHOD_HARD_DISK
|| bootMethodType == BOOT_METHOD_CD;
module_init_post_boot_device(bootingFromBootLoaderVolume);
file_cache_init_post_boot_device();
// search for other disk systems
KDiskDeviceManager *manager = KDiskDeviceManager::Default();
manager->RescanDiskSystems();
manager->StartMonitoring();
}