Add kernel args boot volume "packaged" flag
* Add BOOT_VOLUME_PACKAGED boot volume message field name constant.
* register_boot_file_system():
- Now takes a BootVolume& parameter.
- If the boot volume is packaged, add that info to the boot volume
message.
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
#define BOOT_METHOD "boot method"
|
#define BOOT_METHOD "boot method"
|
||||||
#define BOOT_VOLUME_USER_SELECTED "user selected"
|
#define BOOT_VOLUME_USER_SELECTED "user selected"
|
||||||
#define BOOT_VOLUME_BOOTED_FROM_IMAGE "booted from image"
|
#define BOOT_VOLUME_BOOTED_FROM_IMAGE "booted from image"
|
||||||
|
#define BOOT_VOLUME_PACKAGED "packaged"
|
||||||
#define BOOT_VOLUME_PARTITION_OFFSET "partition offset"
|
#define BOOT_VOLUME_PARTITION_OFFSET "partition offset"
|
||||||
#define BOOT_VOLUME_DISK_IDENTIFIER "disk identifier"
|
#define BOOT_VOLUME_DISK_IDENTIFIER "disk identifier"
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ private:
|
|||||||
/* function prototypes */
|
/* function prototypes */
|
||||||
|
|
||||||
extern status_t vfs_init(stage2_args *args);
|
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,
|
extern status_t get_boot_file_system(stage2_args* args,
|
||||||
BootVolume& _bootVolume);
|
BootVolume& _bootVolume);
|
||||||
extern status_t mount_file_systems(stage2_args *args);
|
extern status_t mount_file_systems(stage2_args *args);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ main(stage2_args *args)
|
|||||||
// is already loaded at this point and we definitely
|
// is already loaded at this point and we definitely
|
||||||
// know our boot volume, too
|
// know our boot volume, too
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
register_boot_file_system(bootVolume.RootDirectory());
|
register_boot_file_system(bootVolume);
|
||||||
|
|
||||||
if ((platform_boot_options() & BOOT_OPTION_DEBUG_OUTPUT) == 0)
|
if ((platform_boot_options() & BOOT_OPTION_DEBUG_OUTPUT) == 0)
|
||||||
platform_switch_to_logo();
|
platform_switch_to_logo();
|
||||||
|
|||||||
@@ -490,19 +490,23 @@ vfs_init(stage2_args *args)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
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;
|
Partition *partition;
|
||||||
status_t status = gRoot->GetPartitionFor(volume, &partition);
|
status_t status = gRoot->GetPartitionFor(rootDirectory, &partition);
|
||||||
if (status != B_OK) {
|
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;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
gKernelArgs.boot_volume.SetInt64(BOOT_VOLUME_PARTITION_OFFSET,
|
gKernelArgs.boot_volume.SetInt64(BOOT_VOLUME_PARTITION_OFFSET,
|
||||||
partition->offset);
|
partition->offset);
|
||||||
|
if (bootVolume.IsPackaged())
|
||||||
|
gKernelArgs.boot_volume.SetBool(BOOT_VOLUME_PACKAGED, true);
|
||||||
|
|
||||||
Node *device = get_node_from(partition->FD());
|
Node *device = get_node_from(partition->FD());
|
||||||
if (device == NULL) {
|
if (device == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user