vfs: initcpio: read initramfs.cpio file into vfs
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
bbf23100fc
commit
acf469ff71
7 changed files with 28 additions and 14 deletions
12
init/main.c
12
init/main.c
|
|
@ -23,6 +23,7 @@
|
|||
#include <drivers/apic.h>
|
||||
|
||||
#include <fs/vfs.h>
|
||||
#include <fs/cpio.h>
|
||||
|
||||
#include <lib/stdio.h>
|
||||
#include <lib/list.h>
|
||||
|
|
@ -67,7 +68,16 @@ static void kmain()
|
|||
page_init();
|
||||
do_initcalls();
|
||||
|
||||
/* do nothing, for now :) */
|
||||
struct limine_file *file = module_res->modules[0];
|
||||
|
||||
fs_t *initramfs;
|
||||
|
||||
int res = cpio_read_and_init(file->address, file->size, &initramfs);
|
||||
|
||||
if (res < 0)
|
||||
panic("failed to load initramfs: %s\n", strerror(-res));
|
||||
|
||||
/* do nothing, for now :) */
|
||||
yield();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue