| OLD | NEW |
| 1 Original fuseiso is a standalone app, however for naclport, | 1 Original fuseiso is a standalone app, however for naclport, |
| 2 we chagned it to a library so that we can use it in other app. | 2 we chagned it to a library so that we can use it in other app. |
| 3 | 3 |
| 4 Major Changes for port fuseiso: | 4 Major Changes for port fuseiso: |
| 5 1. added 'nacl_fuseiso_lib_init' and removed 'main' function in fuseiso.c. | 5 1. added 'nacl_fuseiso_lib_init' and removed 'main' function in fuseiso.c. |
| 6 | 6 |
| 7 2. disabled the check for mnttab(fuseiso.c). | 7 2. disabled the check for mnttab(fuseiso.c). |
| 8 | 8 |
| 9 3. disabled isofs_real_statfs, the parameters we have in nacl_io is statvfs, | 9 3. disabled isofs_real_statfs, the parameters we have in nacl_io is statvfs, |
| 10 but in fuseiso, it requires statfs, also since we nacl_io currently | 10 but in fuseiso, it requires statfs, also since we nacl_io currently |
| 11 doesn't support statfs(more details see nacl_io/fuse.h in nacl_sdk). | 11 doesn't support statfs(more details see nacl_io/fuse.h in nacl_sdk). |
| 12 | 12 |
| 13 4. in currenl newlib, we don't have "bswap_16", using "__byte_swap_16" | 13 4. in currenl newlib, we don't have "bswap_16", using "__byte_swap_16" |
| 14 from sys/endian.h instead. | 14 from sys/endian.h instead. |
| 15 | 15 |
| 16 5. created a seperate Makefile.in for fuseisolib. | 16 5. created a seperate Makefile.in for fuseisolib. |
| 17 | 17 |
| 18 Some sample code to test this lib(newlib version): | 18 Some sample code to test this lib(newlib version): |
| 19 | 19 |
| 20 //fusefoo.c | 20 //fusefoo.c |
| 21 | 21 |
| 22 #include <fuseiso_lib.h> | 22 #include <fuseiso_lib.h> |
| 23 #include <stdio.h> | 23 #include <stdio.h> |
| 24 #include <fcntl.h> | 24 #include <fcntl.h> |
| 25 #include <unistd.h> | 25 #include <unistd.h> |
| 26 | 26 |
| 27 int nacl_main(int argc, char* argv[]) { | 27 int main(int argc, char* argv[]) { |
| 28 | |
| 29 char* path = "<YOUR ISO PATH>"; | 28 char* path = "<YOUR ISO PATH>"; |
| 30 char* mount_point = "/foo"; | 29 char* mount_point = "/foo"; |
| 31 char* fs_name = "fuseiso_fs"; | 30 char* fs_name = "fuseiso_fs"; |
| 32 mkdir(mount_point, 0777); | 31 mkdir(mount_point, 0777); |
| 33 nacl_fuseiso_lib_init(path, mount_point, fs_name); | 32 nacl_fuseiso_lib_init(path, mount_point, fs_name); |
| 34 | 33 |
| 35 char buffer[1024]; | 34 char buffer[1024]; |
| 36 int fd = open("/foo/<PATH_IN_ISO>", O_RDONLY); | 35 int fd = open("/foo/<PATH_IN_ISO>", O_RDONLY); |
| 37 | 36 |
| 38 read(fd, &buffer,1024); | 37 read(fd, &buffer,1024); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 54 | 53 |
| 55 $NACLSDKPATH/toolchain/linux_x86_newlib/bin/x86_64-nacl-gcc \ | 54 $NACLSDKPATH/toolchain/linux_x86_newlib/bin/x86_64-nacl-gcc \ |
| 56 -I$NACLSDKPATH/include -L$NACLSDKPATH/lib/newlib_x86_64/Release \ | 55 -I$NACLSDKPATH/include -L$NACLSDKPATH/lib/newlib_x86_64/Release \ |
| 57 -L$NACLSDKPATH/toolchain/linux_x86_newlib/x86_64-nacl/usr/lib \ | 56 -L$NACLSDKPATH/toolchain/linux_x86_newlib/x86_64-nacl/usr/lib \ |
| 58 -L$NACLSDKPATH/toolchain/linux_x86_glibc/x86_64-nacl/usr/lib \ | 57 -L$NACLSDKPATH/toolchain/linux_x86_glibc/x86_64-nacl/usr/lib \ |
| 59 -o fusefoo_newlib.nexe fusefoo.o -Wl,--undefined=PSUserMainGet \ | 58 -o fusefoo_newlib.nexe fusefoo.o -Wl,--undefined=PSUserMainGet \ |
| 60 -Xlinker -uPSUserMainGet -lcli_main -lnacl_spawn -lppapi_simple \ | 59 -Xlinker -uPSUserMainGet -lcli_main -lnacl_spawn -lppapi_simple \ |
| 61 -lnacl_io -lppapi -lfuseiso -lstdc++ -lncurses -lglib-2.0 -lz -lintl | 60 -lnacl_io -lppapi -lfuseiso -lstdc++ -lncurses -lglib-2.0 -lz -lintl |
| 62 | 61 |
| 63 Should be able to get a fusefoo_newlib.nexe after complie and link. | 62 Should be able to get a fusefoo_newlib.nexe after complie and link. |
| 64 Copy fusefoo_newlib.nexe and the iso file to devenv to test it. | 63 Copy fusefoo_newlib.nexe and the iso file to devenv to test it. |
| OLD | NEW |