From 7f245d25adf15ebddb7129668cfc78498cfff7c2 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Wed, 18 Apr 2018 23:23:02 +0100 Subject: [PATCH 1/5] delete placeholder --- fs/romfs/romfs | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 fs/romfs/romfs diff --git a/fs/romfs/romfs b/fs/romfs/romfs deleted file mode 100644 index e69de29..0000000 From 23f89a9c8690830e1d15b96c97311217bf80c372 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Wed, 18 Apr 2018 23:23:44 +0100 Subject: [PATCH 2/5] add romfs building --- fs/romfs/Makefile | 2 +- fs/romfs/romfs/folder/file.txt | 6 ++++++ fs/romfs/romfs/フォルダ/ファイル.txt | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 fs/romfs/romfs/folder/file.txt create mode 100644 fs/romfs/romfs/フォルダ/ファイル.txt diff --git a/fs/romfs/Makefile b/fs/romfs/Makefile index da8cfb6..2848913 100644 --- a/fs/romfs/Makefile +++ b/fs/romfs/Makefile @@ -132,7 +132,7 @@ ifneq ($(APP_TITLEID),) endif ifneq ($(ROMFS),) - export NROFLAGS += --romfs=$(CURDIR)/$(ROMFS) + export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS) endif .PHONY: $(BUILD) clean all diff --git a/fs/romfs/romfs/folder/file.txt b/fs/romfs/romfs/folder/file.txt new file mode 100644 index 0000000..7c81319 --- /dev/null +++ b/fs/romfs/romfs/folder/file.txt @@ -0,0 +1,6 @@ +Hello, this is the libnx romfs example. +This text is being read off a file in romfs. + + >>Switch Homebrew is Cool<< + +Signed off, fincs & WinterMute diff --git a/fs/romfs/romfs/フォルダ/ファイル.txt b/fs/romfs/romfs/フォルダ/ファイル.txt new file mode 100644 index 0000000..2cd922e --- /dev/null +++ b/fs/romfs/romfs/フォルダ/ファイル.txt @@ -0,0 +1,2 @@ +The path to this file contains UTF-16 +characters that fall outside ASCII. From b8bee5d4ee3bc1a78f1b74d46fbd6ea53aad0443 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Wed, 18 Apr 2018 23:24:19 +0100 Subject: [PATCH 3/5] report error on failure --- fs/romfs/source/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/romfs/source/main.c b/fs/romfs/source/main.c index 3510a1f..b881995 100644 --- a/fs/romfs/source/main.c +++ b/fs/romfs/source/main.c @@ -1,5 +1,6 @@ #include #include +#include #include @@ -22,6 +23,8 @@ void printfile(const char* path) } printf(">>EOF<<\n"); fclose(f); + } else { + printf("errno is %d, %s\n", errno, strerror(errno)); } } From a5cf099c14662147a4a7fe4aede29d1884865fa8 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Thu, 19 Apr 2018 00:23:05 +0100 Subject: [PATCH 4/5] add comment explaining ROMFS --- fs/romfs/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/romfs/Makefile b/fs/romfs/Makefile index 2848913..9cb1b76 100644 --- a/fs/romfs/Makefile +++ b/fs/romfs/Makefile @@ -16,6 +16,7 @@ include $(DEVKITPRO)/libnx/switch_rules # DATA is a list of directories containing data files # INCLUDES is a list of directories containing header files # EXEFS_SRC is the optional input directory containing data copied into exefs, if anything this normally should only contain "main.npdm". +# ROMFS is the directory containing data to be added to RomFS, relative to the Makefile (Optional) # # NO_ICON: if set to anything, do not use icon. # NO_NACP: if set to anything, no .nacp file is generated. From 3f428ffc98e804aaa54fb168683f9f4e5e4927a3 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Thu, 19 Apr 2018 00:39:41 +0100 Subject: [PATCH 5/5] unicode, not utf16 --- fs/romfs/romfs/フォルダ/ファイル.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/romfs/romfs/フォルダ/ファイル.txt b/fs/romfs/romfs/フォルダ/ファイル.txt index 2cd922e..370c85b 100644 --- a/fs/romfs/romfs/フォルダ/ファイル.txt +++ b/fs/romfs/romfs/フォルダ/ファイル.txt @@ -1,2 +1,2 @@ -The path to this file contains UTF-16 +The path to this file contains Unicode characters that fall outside ASCII.