diff --git a/init/main.c b/init/main.c index 336ea01..3a37c76 100644 --- a/init/main.c +++ b/init/main.c @@ -50,35 +50,6 @@ static void indent(int indent) } } -void printf_dir_recursive(dirent_t *dir, int ind) -{ - if (!dir || !dir->inode) - return; - - dirent_t *cursor; - struct dir_context ctx = {0}; - int res; - - while (!(res = vfs_readdir(dir, &ctx, &cursor))) { - if (!cursor || !cursor->inode) - continue; - - indent(ind); - kprintf("[inode] %s\n", cursor->name); - - if (cursor->inode->mode & S_IFDIR) { - printf_dir_recursive(cursor, ind + 2); - } else { - indent(ind + 1); - char *buf = kalloc(cursor->inode->file_size + 1, ALLOC_KERN); - buf[cursor->inode->file_size] = 0; - vfs_read(cursor->inode, buf, cursor->inode->file_size, 0); - kprintf("%s", buf); - kfree(buf); - } - } -} - static void kmain() { /* data types */ @@ -114,11 +85,6 @@ static void kmain() if (res < 0) panic("failed to load initramfs: %s\n", strerror(-res)); - krdy("initramfs loaded\n"); - - /* read entire initramfs filesystem */ - printf_dir_recursive(initramfs->root_dirent, 0); - /* do nothing, for now :) */ yield(); }