diff --git a/src/add-ons/kernel/file_systems/packagefs/Volume.cpp b/src/add-ons/kernel/file_systems/packagefs/Volume.cpp index b46f93a794..198f63b050 100644 --- a/src/add-ons/kernel/file_systems/packagefs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/Volume.cpp @@ -343,25 +343,30 @@ Volume::Mount(const char* parameterString) if (error != B_OK) RETURN_ERROR(error); - // create the root node - fRootDirectory = new(std::nothrow) Directory(kRootDirectoryID); - if (fRootDirectory == NULL) - RETURN_ERROR(B_NO_MEMORY); - fNodes.Insert(fRootDirectory); - - const char* domain = NULL; + const char* packages = NULL; + const char* volumeName = "Package FS"; void* parameterHandle = parse_driver_settings_string(parameterString); if (parameterHandle != NULL) { - domain = get_driver_parameter(parameterHandle, "packages", NULL, NULL); + packages + = get_driver_parameter(parameterHandle, "packages", NULL, NULL); + volumeName + = get_driver_parameter(parameterHandle, "volume-name", NULL, NULL); delete_driver_settings(parameterHandle); } - if (domain == NULL || domain[0] == '\0') { + if (packages == NULL || packages[0] == '\0') { ERROR("need package folder ('packages' parameter)!\n"); RETURN_ERROR(B_BAD_VALUE); } + // create the root node + fRootDirectory = new(std::nothrow) Directory(kRootDirectoryID); + if (fRootDirectory == NULL) + RETURN_ERROR(B_NO_MEMORY); + fRootDirectory->Init(NULL, volumeName); + fNodes.Insert(fRootDirectory); + // create default package domain - error = _AddInitialPackageDomain(domain); + error = _AddInitialPackageDomain(packages); if (error != B_OK) RETURN_ERROR(error); diff --git a/src/add-ons/kernel/file_systems/packagefs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/packagefs/kernel_interface.cpp index e478739756..08685f4906 100644 --- a/src/add-ons/kernel/file_systems/packagefs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/kernel_interface.cpp @@ -143,13 +143,16 @@ packagefs_unmount(fs_volume* fsVolume) static status_t packagefs_read_fs_info(fs_volume* fsVolume, struct fs_info* info) { - FUNCTION("volume: %p, info: %p\n", fsVolume->private_volume, info); + Volume* volume = (Volume*)fsVolume->private_volume; + + FUNCTION("volume: %p, info: %p\n", volume, info); info->flags = B_FS_IS_READONLY; info->block_size = 4096; info->io_size = kOptimalIOSize; info->total_blocks = info->free_blocks = 1; - strlcpy(info->volume_name, "Package FS", sizeof(info->volume_name)); + strlcpy(info->volume_name, volume->RootDirectory()->Name(), + sizeof(info->volume_name)); return B_OK; }