vfs: initcpio: read initramfs.cpio file into vfs

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-09 21:18:57 -04:00
commit acf469ff71
7 changed files with 28 additions and 14 deletions

View file

@ -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();
}