register_boot_file_system() now also fills in the kernel_args data about
the boot partition, and calls platform_register_boot_device() for the rest. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9961 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2003-2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2003-2004, Axel Dörfler, [email protected].
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "RootFileSystem.h"
|
#include "RootFileSystem.h"
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <boot/platform.h>
|
#include <boot/platform.h>
|
||||||
#include <boot/partitions.h>
|
#include <boot/partitions.h>
|
||||||
#include <boot/stdio.h>
|
#include <boot/stdio.h>
|
||||||
|
#include <boot/stage2.h>
|
||||||
#include <util/kernel_cpp.h>
|
#include <util/kernel_cpp.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -295,10 +296,27 @@ vfs_init(stage2_args *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
status_t
|
||||||
register_boot_file_system(Directory *volume)
|
register_boot_file_system(Directory *volume)
|
||||||
{
|
{
|
||||||
gRoot->AddLink("boot", 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
gKernelArgs.boot_disk.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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user