diff --git a/headers/private/kernel/boot/kernel_args.h b/headers/private/kernel/boot/kernel_args.h index 5d226e5aa1..78d2d2fc8a 100644 --- a/headers/private/kernel/boot/kernel_args.h +++ b/headers/private/kernel/boot/kernel_args.h @@ -27,6 +27,7 @@ #define BOOT_METHOD "boot method" #define BOOT_VOLUME_USER_SELECTED "user selected" #define BOOT_VOLUME_BOOTED_FROM_IMAGE "booted from image" +#define BOOT_VOLUME_PACKAGED "packaged" #define BOOT_VOLUME_PARTITION_OFFSET "partition offset" #define BOOT_VOLUME_DISK_IDENTIFIER "disk identifier" diff --git a/headers/private/kernel/boot/vfs.h b/headers/private/kernel/boot/vfs.h index e936160498..f00e282686 100644 --- a/headers/private/kernel/boot/vfs.h +++ b/headers/private/kernel/boot/vfs.h @@ -136,7 +136,7 @@ private: /* function prototypes */ extern status_t vfs_init(stage2_args *args); -extern status_t register_boot_file_system(Directory *directory); +extern status_t register_boot_file_system(BootVolume& bootVolume); extern status_t get_boot_file_system(stage2_args* args, BootVolume& _bootVolume); extern status_t mount_file_systems(stage2_args *args); diff --git a/src/system/boot/loader/main.cpp b/src/system/boot/loader/main.cpp index 309df34cd5..3c310c1144 100644 --- a/src/system/boot/loader/main.cpp +++ b/src/system/boot/loader/main.cpp @@ -106,7 +106,7 @@ main(stage2_args *args) // is already loaded at this point and we definitely // know our boot volume, too if (status == B_OK) { - register_boot_file_system(bootVolume.RootDirectory()); + register_boot_file_system(bootVolume); if ((platform_boot_options() & BOOT_OPTION_DEBUG_OUTPUT) == 0) platform_switch_to_logo(); diff --git a/src/system/boot/loader/vfs.cpp b/src/system/boot/loader/vfs.cpp index eeb6e6c979..a0bed30fa5 100644 --- a/src/system/boot/loader/vfs.cpp +++ b/src/system/boot/loader/vfs.cpp @@ -490,19 +490,23 @@ vfs_init(stage2_args *args) status_t -register_boot_file_system(Directory *volume) +register_boot_file_system(BootVolume& bootVolume) { - gRoot->AddLink("boot", volume); + Directory* rootDirectory = bootVolume.RootDirectory(); + gRoot->AddLink("boot", rootDirectory); Partition *partition; - status_t status = gRoot->GetPartitionFor(volume, &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"); + dprintf("register_boot_file_system(): could not locate boot volume in " + "root!\n"); return status; } gKernelArgs.boot_volume.SetInt64(BOOT_VOLUME_PARTITION_OFFSET, partition->offset); + if (bootVolume.IsPackaged()) + gKernelArgs.boot_volume.SetBool(BOOT_VOLUME_PACKAGED, true); Node *device = get_node_from(partition->FD()); if (device == NULL) {