From 713c253fdee9875df60d6d1e7307bb80511b8152 Mon Sep 17 00:00:00 2001 From: ikbenlike Date: Mon, 14 Nov 2022 05:02:52 +0100 Subject: [PATCH 1/2] ports: add libfuse port --- bootstrap.d/sys-fs.y4.yml | 30 ++++++ bootstrap.yml | 1 + ...h-in-managarm-specific-compile-needs.patch | 93 +++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 bootstrap.d/sys-fs.y4.yml create mode 100644 patches/libfuse/0001-patch-in-managarm-specific-compile-needs.patch diff --git a/bootstrap.d/sys-fs.y4.yml b/bootstrap.d/sys-fs.y4.yml new file mode 100644 index 000000000..469b313db --- /dev/null +++ b/bootstrap.d/sys-fs.y4.yml @@ -0,0 +1,30 @@ +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@' diff --git a/bootstrap.yml b/bootstrap.yml index 3cd767b23..87dfc34b3 100644 --- a/bootstrap.yml +++ b/bootstrap.yml @@ -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 diff --git a/patches/libfuse/0001-patch-in-managarm-specific-compile-needs.patch b/patches/libfuse/0001-patch-in-managarm-specific-compile-needs.patch new file mode 100644 index 000000000..87974cbc5 --- /dev/null +++ b/patches/libfuse/0001-patch-in-managarm-specific-compile-needs.patch @@ -0,0 +1,93 @@ +From 131a7688e445ca28cb90aa582f7a93fe7e02bc02 Mon Sep 17 00:00:00 2001 +From: ikbenlike +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 + #include + #include ++#include + + #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 + #include + ++#include ++ + #ifdef HAVE_CLOSE_RANGE + #include + #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 + From b8878aaa71e823fe64f447ae64b8d530df16617b Mon Sep 17 00:00:00 2001 From: ikbenlike Date: Wed, 2 Aug 2023 11:31:13 +0200 Subject: [PATCH 2/2] ports: port echfs --- bootstrap.d/sys-fs.y4.yml | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/bootstrap.d/sys-fs.y4.yml b/bootstrap.d/sys-fs.y4.yml index 469b313db..5d92c1a8e 100644 --- a/bootstrap.d/sys-fs.y4.yml +++ b/bootstrap.d/sys-fs.y4.yml @@ -1,3 +1,18 @@ +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@' @@ -28,3 +43,51 @@ packages: - 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@'