Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions bootstrap.d/sys-fs.y4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
sources:
- name: echfs
subdir: 'ports'
git: 'https://github.com/echfs/echfs.git'
commit: '7d842e78fbe39be54bd93917a85eb9a12a50a763'
branch: 'master'
tools_required:
- host-autoconf-v2.69
- host-automake-v1.15
- host-libtool
- host-pkg-config
regenerate:
- args: ['@THIS_SOURCE_DIR@/echfs-utils/bootstrap']
- args: ['@THIS_SOURCE_DIR@/echfs-fuse/bootstrap']

packages:
- name: libfuse
architecture: '@OPTION:arch@'
source:
subdir: 'ports'
git: 'https://github.com/libfuse/libfuse.git'
tag: 'fuse-3.17.1'
version: '3.17.1'
tools_required:
- system-gcc
- host-pkg-config
- virtual: pkgconfig-for-target
triple: "@OPTION:arch-triple@"
pkgs_required:
- mlibc
configure:
- args:
- 'meson'
- '--cross-file'
- '@SOURCE_ROOT@/scripts/meson-@OPTION:arch-triple@.cross-file'
- '-Dprefix=/usr'
- '-Dexamples=false'
- '-Dtests=false'
- '-Dudevrulesdir="/etc/udev/rules.d/'
- '@THIS_SOURCE_DIR@'
build:
- args: ['meson', '@THIS_BUILD_DIR@', '@THIS_SOURCE_DIR@']
- args: ['meson', 'install', '-C', '@THIS_BUILD_DIR@']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'

- name: echfs-utils
architecture: '@OPTION:arch@'
from_source: 'echfs'
tools_required:
- system-gcc
- host-pkg-config
- host-automake-v1.15
- host-autoconf-v2.69
- virtual: pkgconfig-for-target
triple: "@OPTION:arch-triple@"
pkgs_required:
- mlibc
- util-linux-libs
configure:
- args:
- '@THIS_SOURCE_DIR@/echfs-utils/configure'
- '--host=@OPTION:arch-triple@'
- '--prefix=/usr'
build:
- args: ['make', '-j@PARALLELISM@']
- args: ['make', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'

- name: echfs-fuse
architecture: '@OPTION:arch@'
from_source: 'echfs'
tools_required:
- system-gcc
- host-pkg-config
- host-automake-v1.15
- host-autoconf-v2.69
- virtual: pkgconfig-for-target
triple: "@OPTION:arch-triple@"
pkgs_required:
- mlibc
- libfuse
configure:
- args:
- '@THIS_SOURCE_DIR@/echfs-fuse/configure'
- '--host=@OPTION:arch-triple@'
- '--prefix=/usr'
build:
- args: ['make', '-j@PARALLELISM@']
- args: ['make', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
1 change: 1 addition & 0 deletions bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ imports:
- file: bootstrap.d/sys-devel.y4.yml
- file: bootstrap.d/sys-kernel.y4.yml
- file: bootstrap.d/sys-libs.y4.yml
- file: bootstrap.d/sys-fs.y4.yml
- file: bootstrap.d/sys-process.y4.yml
- file: bootstrap.d/tasks.y4.yml
- file: bootstrap.d/www-client.y4.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
From 131a7688e445ca28cb90aa582f7a93fe7e02bc02 Mon Sep 17 00:00:00 2001
From: ikbenlike <thewatcheriswatchinu@gmail.com>
Date: Thu, 17 Apr 2025 00:09:38 +0200
Subject: [PATCH] patch in managarm specific compile needs

---
lib/fuse_i.h | 1 +
lib/meson.build | 2 +-
util/fusermount.c | 2 ++
util/install_helper.sh | 2 --
util/mount.fuse.c | 4 ++--
5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/fuse_i.h b/lib/fuse_i.h
index 6fbfc2d..6f78b84 100644
--- a/lib/fuse_i.h
+++ b/lib/fuse_i.h
@@ -13,6 +13,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
+#include <pthread.h>

#define MIN(a, b) \
({ \
diff --git a/lib/meson.build b/lib/meson.build
index 6a52d06..1ae6f85 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -4,7 +4,7 @@ libfuse_sources = ['fuse.c', 'fuse_i.h', 'fuse_loop.c', 'fuse_loop_mt.c',
'helper.c', 'modules/subdir.c', 'mount_util.c',
'fuse_log.c', 'compat.c', 'util.c', 'util.h' ]

-if host_machine.system().startswith('linux')
+if host_machine.system().startswith('linux') or host_machine.system().startswith('managarm')
libfuse_sources += [ 'mount.c' ]
else
libfuse_sources += [ 'mount_bsd.c' ]
diff --git a/util/fusermount.c b/util/fusermount.c
index dbd947c..ee1796c 100644
--- a/util/fusermount.c
+++ b/util/fusermount.c
@@ -36,6 +36,8 @@
#include <stdbool.h>
#include <sys/vfs.h>

+#include <signal.h>
+
#ifdef HAVE_CLOSE_RANGE
#include <linux/close_range.h>
#endif
diff --git a/util/install_helper.sh b/util/install_helper.sh
index 76f2b47..fab3b78 100755
--- a/util/install_helper.sh
+++ b/util/install_helper.sh
@@ -28,12 +28,10 @@ install -D -m 644 "${MESON_SOURCE_ROOT}/util/fuse.conf" \
"${DESTDIR}${sysconfdir}/fuse.conf"

if $useroot; then
- chown root:root "${DESTDIR}${bindir}/fusermount3"
chmod u+s "${DESTDIR}${bindir}/fusermount3"

if test ! -e "${DESTDIR}/dev/fuse"; then
mkdir -p "${DESTDIR}/dev"
- mknod "${DESTDIR}/dev/fuse" -m 0666 c 10 229
fi
fi

diff --git a/util/mount.fuse.c b/util/mount.fuse.c
index b98fb2a..0b6f1b7 100644
--- a/util/mount.fuse.c
+++ b/util/mount.fuse.c
@@ -350,7 +350,7 @@ int main(int argc, char *argv[])
free(opts);
}
}
-
+#ifndef __managarm__
if (drop_privileges) {
uint64_t required_caps = CAP_TO_MASK(CAP_SETPCAP) |
CAP_TO_MASK(CAP_SYS_ADMIN);
@@ -360,7 +360,7 @@ int main(int argc, char *argv[])
exit(1);
}
}
-
+#endif /* if defined(__managarm__) */
if (dev)
options = add_option("dev", options);
if (suid)
--
2.49.0