summaryrefslogtreecommitdiff
path: root/sys/fs/initramfs.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-17 20:59:31 -0400
committerIan Moffett <ian@osmora.org>2024-03-17 20:59:31 -0400
commit0776264c266e7c1619b8b8b84d2da5384979bb3c (patch)
tree80b6ded012336e24c72cc2c16e4c3ce952b7b739 /sys/fs/initramfs.c
parent7895aaff402a021a1b04645ca8d251f760e5662e (diff)
parent2896f4126de2ee0fd1bab4b960bfb2213c359f18 (diff)
Merge branch 'user' into dev
Diffstat (limited to 'sys/fs/initramfs.c')
-rw-r--r--sys/fs/initramfs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/fs/initramfs.c b/sys/fs/initramfs.c
index c0eaa0c..6da0929 100644
--- a/sys/fs/initramfs.c
+++ b/sys/fs/initramfs.c
@@ -103,7 +103,7 @@ vop_vget(struct vnode *parent, const char *name, struct vnode **vp)
return -ENOENT;
}
- if (hdr->type != TAR_TYPEFLAG_DIR) {
+ if (hdr->type == TAR_TYPEFLAG_DIR) {
vtype = VDIR;
}
@@ -149,8 +149,8 @@ static char *
get_module(const char *path, uint64_t *size) {
for (uint64_t i = 0; i < mod_req.response->module_count; ++i) {
if (strcmp(mod_req.response->modules[i]->path, path) == 0) {
- *size = mod_req.response->modules[i]->size;
- return mod_req.response->modules[i]->address;
+ *size = mod_req.response->modules[i]->size;
+ return mod_req.response->modules[i]->address;
}
}
@@ -173,6 +173,7 @@ static int
initramfs_init(struct fs_info *info)
{
initramfs = get_module("/boot/initramfs.tar", &initramfs_size);
+ info->caps = FSCAP_FULLPATH;
if (initramfs == NULL) {
panic("Failed to load initramfs\n");
@@ -221,7 +222,7 @@ initramfs_open(const char *path)
}
hdr = initramfs_from_path((void *)initramfs, path);
- return hdr_to_contents(hdr);
+ return (hdr == NULL) ? NULL : hdr_to_contents(hdr);
}
struct vfsops g_initramfs_ops = {