mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
parent
3a0922001b
commit
aba67e365f
1
libports/lib/import/import-libexfat.mk
Normal file
1
libports/lib/import/import-libexfat.mk
Normal file
@ -0,0 +1 @@
|
||||
REP_INC_DIR += include/exfat
|
12
libports/lib/mk/libc_fuse_exfat.mk
Normal file
12
libports/lib/mk/libc_fuse_exfat.mk
Normal file
@ -0,0 +1,12 @@
|
||||
include $(REP_DIR)/ports/exfat.inc
|
||||
EXFAT_DIR = $(REP_DIR)/contrib/$(EXFAT)
|
||||
|
||||
SRC_C = $(notdir $(EXFAT_DIR)/fuse/main.c)
|
||||
SRC_CC = init.cc
|
||||
|
||||
LIBS = libc libc_block libc_fuse libfuse libexfat
|
||||
|
||||
vpath %.c $(EXFAT_DIR)/fuse
|
||||
vpath %.cc $(REP_DIR)/src/lib/exfat
|
||||
|
||||
SHARED_LIB = yes
|
16
libports/lib/mk/libexfat.mk
Normal file
16
libports/lib/mk/libexfat.mk
Normal file
@ -0,0 +1,16 @@
|
||||
include $(REP_DIR)/ports/exfat.inc
|
||||
EXFAT_DIR = $(REP_DIR)/contrib/$(EXFAT)
|
||||
|
||||
#FILTER_OUT = win32_io.c
|
||||
#SRC_C = $(filter-out $(FILTER_OUT),$(notdir $(wildcard $(EXFAT_DIR)/libexfat/*.c)))
|
||||
|
||||
SRC_C = $(notdir $(wildcard $(EXFAT_DIR)/libexfat/*.c))
|
||||
|
||||
INC_DIR += $(REP_DIR)/include/exfat \
|
||||
$(EXFAT_DIR)/libexfat
|
||||
|
||||
#CC_OPT += -DHAVE_CONFIG_H -DRECORD_LOCKING_NOT_IMPLEMENTED
|
||||
|
||||
LIBS += libc
|
||||
|
||||
vpath %.c $(EXFAT_DIR)/libexfat
|
2
libports/ports/exfat.inc
Normal file
2
libports/ports/exfat.inc
Normal file
@ -0,0 +1,2 @@
|
||||
EXFAT_VERSION = 1.0.1
|
||||
EXFAT = fuse-exfat-$(EXFAT_VERSION)
|
35
libports/ports/exfat.mk
Normal file
35
libports/ports/exfat.mk
Normal file
@ -0,0 +1,35 @@
|
||||
include ports/exfat.inc
|
||||
|
||||
EXFAT_TGZ = $(EXFAT).tar.gz
|
||||
EXFAT_BASE_URL = https://exfat.googlecode.com/files
|
||||
EXFAT_URL = $(EXFAT_BASE_URL)/$(EXFAT_TGZ)
|
||||
|
||||
#
|
||||
# Interface to top-level prepare Makefile
|
||||
#
|
||||
PORTS += exfat
|
||||
|
||||
prepare-exfat: $(CONTRIB_DIR)/$(EXFAT) include/exfat
|
||||
|
||||
#
|
||||
# Port-specific local rules
|
||||
#
|
||||
$(DOWNLOAD_DIR)/$(EXFAT_TGZ):
|
||||
$(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(EXFAT_URL) && touch $@
|
||||
|
||||
$(CONTRIB_DIR)/$(EXFAT): $(DOWNLOAD_DIR)/$(EXFAT_TGZ)
|
||||
$(VERBOSE)tar xfz $< -C $(CONTRIB_DIR) && touch $@
|
||||
$(VERBOSE)patch -N -p0 < src/lib/exfat/main.c.patch
|
||||
|
||||
#
|
||||
# Install exfat headers
|
||||
#
|
||||
|
||||
include/exfat:
|
||||
$(VERBOSE)mkdir -p $@
|
||||
$(VERBOSE)for i in `find $(CONTRIB_DIR)/$(EXFAT)/libexfat -name *.h`; do \
|
||||
ln -fs ../../$$i $@; done
|
||||
|
||||
clean-exfat:
|
||||
$(VERBOSE)rm -rf include/exfat
|
||||
$(VERBOSE)rm -rf $(CONTRIB_DIR)/$(EXFAT)
|
5
libports/run/libc_fuse_exfat.run
Normal file
5
libports/run/libc_fuse_exfat.run
Normal file
@ -0,0 +1,5 @@
|
||||
set mkfs_cmd mkfs.exfat
|
||||
set mkfs_opts ""
|
||||
set filesystem fuse_exfat
|
||||
|
||||
source ${genode_dir}/libports/run/libc_filesystem_test.inc
|
53
libports/src/lib/exfat/init.cc
Normal file
53
libports/src/lib/exfat/init.cc
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* \brief libc_fuse_exfat
|
||||
* \author Josef Soentgen
|
||||
* \date 2013-11-11
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
|
||||
#include <fuse_private.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include <exfat.h>
|
||||
|
||||
extern struct fuse_operations fuse_exfat_ops;
|
||||
|
||||
struct fuse_chan *fc;
|
||||
struct fuse *fh;
|
||||
|
||||
struct exfat ef;
|
||||
|
||||
}
|
||||
|
||||
void Fuse::init_fs(void)
|
||||
{
|
||||
PLOG("libc_fuse_exfat: try to mount /dev/blkdev...");
|
||||
|
||||
int err = exfat_mount(&ef, "/dev/blkdev", "");
|
||||
if (err) {
|
||||
PERR("libc_fuse_exfat: could not mount /dev/blkdev");
|
||||
return;
|
||||
}
|
||||
|
||||
fh = fuse_new(fc, NULL, &fuse_exfat_ops, sizeof (struct fuse_operations), NULL);
|
||||
if (fh == 0) {
|
||||
PERR("libc_fuse_exfat: fuse_new() failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Fuse::deinit_fs(void)
|
||||
{
|
||||
PLOG("libc_fuse_exfat: umount /dev/blkdev...");
|
||||
exfat_unmount(&ef);
|
||||
}
|
26
libports/src/lib/exfat/main.c.patch
Normal file
26
libports/src/lib/exfat/main.c.patch
Normal file
@ -0,0 +1,26 @@
|
||||
Make fuse_operation struct globally accessible and comment-out
|
||||
main() function.
|
||||
--- contrib/fuse-exfat-1.0.1/fuse/main.c.orig 2013-11-11 14:34:42.668119109 +0100
|
||||
+++ contrib/fuse-exfat-1.0.1/fuse/main.c 2013-11-11 14:36:25.728122089 +0100
|
||||
@@ -296,7 +296,7 @@
|
||||
exit(1);
|
||||
}
|
||||
|
||||
-static struct fuse_operations fuse_exfat_ops =
|
||||
+struct fuse_operations fuse_exfat_ops =
|
||||
{
|
||||
.getattr = fuse_exfat_getattr,
|
||||
.truncate = fuse_exfat_truncate,
|
||||
@@ -403,6 +403,7 @@
|
||||
return options;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
struct fuse_args mount_args = FUSE_ARGS_INIT(0, NULL);
|
||||
@@ -550,3 +551,4 @@
|
||||
fuse_destroy(fh);
|
||||
return 0;
|
||||
}
|
||||
+#endif
|
5
libports/src/test/libc_fuse_exfat/target.mk
Normal file
5
libports/src/test/libc_fuse_exfat/target.mk
Normal file
@ -0,0 +1,5 @@
|
||||
TARGET = test-libc_fuse_exfat
|
||||
LIBS = libc libc_log libc_fuse_exfat
|
||||
SRC_CC = main.cc
|
||||
|
||||
vpath %.cc $(PRG_DIR)/../libc_ffat/
|
5
libports/src/test/libports/libexfat/target.mk
Normal file
5
libports/src/test/libports/libexfat/target.mk
Normal file
@ -0,0 +1,5 @@
|
||||
TARGET = test-libexfat
|
||||
LIBS = libc libexfat
|
||||
SRC_CC = main.cc
|
||||
|
||||
vpath main.cc $(PRG_DIR)/..
|
Loading…
x
Reference in New Issue
Block a user