Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libfuse (WIP) #257

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
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.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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pin a commit and add a version field.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have pinned a commit; however, there does not seem to be any version noted in the repository. Do I make one up or can this field be omitted?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make one up in that case. Never omit a version field.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made up my own for ca-certificates for example, it includes the date I pulled the data from. Just an example.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the architecture field and missing metadata.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I'm aware, echfs does not depend on a specific CPU architecture

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the confusion, but that's not what the architecture field is for. Xbbs needs to know what architecture the package is for in order to put it in the correct repository. That's nearly always just the OPTION:arch substitution but sometimes it's noarch (only data files for example). Labels then control if xbbs will attempt to build the package on a specific architecture, amd64 is always implied. For now, don't add a label, but do add that architecture field, as xbbs will choke on the fact that it's not there.

architecture: '@OPTION:arch@'
source:
subdir: 'ports'
git: 'https://github.com/libfuse/libfuse.git'
tag: 'fuse-3.16.1'
version: '3.16.1'
tools_required:
- system-gcc
- host-pkg-config
- virtual: pkgconfig-for-target
triple: "@OPTION:arch-triple@"
pkgs_required:
- mlibc
configure:
- args:
- 'meson'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just using meson seems to be deprecated. Meson recommends using meson setup. Please do so.

- '--cross-file'
- '@SOURCE_ROOT@/scripts/meson-@OPTION:[email protected]'
- '-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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing architecture field and missing metadata.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added an architecture field; what other metadata was missing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've received a reply from Leo on discord about it but for the record, everything under the metadata tag, as seen in various packages throughout the source.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing architecture field and missing metadata.

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 @@ -32,6 +32,7 @@ imports:
- file: bootstrap.d/sys-boot.yml
- file: bootstrap.d/sys-devel.yml
- file: bootstrap.d/sys-kernel.yml
- file: bootstrap.d/sys-fs.yml
- file: bootstrap.d/sys-libs.yml
- file: bootstrap.d/sys-process.yml
- file: bootstrap.d/www-client.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
From fbe2f27f8748a581641f8a88258e712e294bb8e1 Mon Sep 17 00:00:00 2001
From: ikbenlike <[email protected]>
Date: Mon, 14 Nov 2022 04:52:35 +0100
Subject: [PATCH] patch in managarm-specific compile needs

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

diff --git a/lib/fuse_i.h b/lib/fuse_i.h
index 42f0e5f..6c917d7 100644
--- a/lib/fuse_i.h
+++ b/lib/fuse_i.h
@@ -9,6 +9,8 @@
#include "fuse.h"
#include "fuse_lowlevel.h"

+#include <pthread.h>
+
struct mount_opts;

struct fuse_req {
diff --git a/lib/meson.build b/lib/meson.build
index ef0e11e..ff29bfe 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -6,6 +6,8 @@ libfuse_sources = ['fuse.c', 'fuse_i.h', 'fuse_loop.c', 'fuse_loop_mt.c',

if host_machine.system().startswith('linux')
libfuse_sources += [ 'mount.c' ]
+elif host_machine.system().startswith('managarm')
+ libfuse_sources += [ 'mount.c' ]
else
libfuse_sources += [ 'mount_bsd.c' ]
endif
diff --git a/util/install_helper.sh b/util/install_helper.sh
index 33f4a42..e2ca716 100755
--- a/util/install_helper.sh
+++ b/util/install_helper.sh
@@ -28,12 +28,12 @@ install -D -m 644 "${MESON_SOURCE_ROOT}/util/fuse.conf" \
"${DESTDIR}${sysconfdir}/fuse.conf"

if $useroot; then
- chown root:root "${DESTDIR}${bindir}/fusermount3"
+ #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
+ #mknod "${DESTDIR}/dev/fuse" -m 0666 c 10 229
fi
fi

diff --git a/util/mount.fuse.c b/util/mount.fuse.c
index a6e5629..2ae26a2 100644
--- a/util/mount.fuse.c
+++ b/util/mount.fuse.c
@@ -347,6 +347,7 @@ int main(int argc, char *argv[])
}
}

+#ifndef __managarm__
if (drop_privileges) {
uint64_t required_caps = CAP_TO_MASK(CAP_SETPCAP) |
CAP_TO_MASK(CAP_SYS_ADMIN);
@@ -356,6 +357,7 @@ int main(int argc, char *argv[])
exit(1);
}
}
+#endif

if (dev)
options = add_option("dev", options);
--
2.38.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From d4b25740057a63b78de1987e13ae5a2cb60352b7 Mon Sep 17 00:00:00 2001
From: ikbenlike <[email protected]>
Date: Sat, 5 Aug 2023 03:09:26 +0200
Subject: [PATCH] remove glibc-specific feature test macros

---
lib/fuse_lowlevel.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index fdef193..8a5b3bf 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -213,12 +213,8 @@ int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
{
struct fuse_out_header out;

-#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 32
const char *str = strerrordesc_np(error * -1);
if ((str == NULL && error != 0) || error > 0) {
-#else
- if (error <= -1000 || error > 0) {
-#endif
fuse_log(FUSE_LOG_ERR, "fuse: bad error value: %i\n", error);
error = -ERANGE;
}
--
2.34.1