Export a mount function for ext2
This commit is contained in:
parent
7ecf83f32a
commit
2f7fbfb5a7
@ -922,11 +922,19 @@ static fs_node_t * mount_ext2(fs_node_t * block_device) {
|
||||
return RN;
|
||||
}
|
||||
|
||||
fs_node_t * ext2_fs_mount(char * device, char * mount_path) {
|
||||
fs_node_t * dev = kopen(device, 0);
|
||||
if (!dev) return NULL;
|
||||
fs_node_t * fs = mount_ext2(dev);
|
||||
if (!fs) return NULL;
|
||||
vfs_mount(mount_path, fs);
|
||||
return fs;
|
||||
}
|
||||
|
||||
int ext2_initialize(void) {
|
||||
|
||||
if (args_present("root")) {
|
||||
fs_node_t * hda = kopen(args_value("root"), 0);
|
||||
vfs_mount("/", mount_ext2(hda));
|
||||
ext2_fs_mount(args_value("root"), "/");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user