This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 15c90ac17e1aae61505a8a263b8fdc33b23dc4d5 Author: dongjiuzhu1 <[email protected]> AuthorDate: Sat Nov 18 21:18:30 2023 +0800 examples/sotest/elf: rename romfs_img to run test with CONFIG_NSH_ROMFSETC Signed-off-by: dongjiuzhu1 <[email protected]> --- examples/elf/elf_main.c | 8 ++++---- examples/elf/tests/Makefile | 3 ++- examples/sotest/lib/Makefile | 3 ++- examples/sotest/sotest_main.c | 10 +++++----- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/elf/elf_main.c b/examples/elf/elf_main.c index 83eb92f06..0cc1e47a0 100644 --- a/examples/elf/elf_main.c +++ b/examples/elf/elf_main.c @@ -124,8 +124,8 @@ static char fullpath[128]; ****************************************************************************/ #if defined(CONFIG_EXAMPLES_ELF_ROMFS) || defined(CONFIG_EXAMPLES_ELF_CROMFS) -extern const unsigned char romfs_img[]; -extern const unsigned int romfs_img_len; +extern const unsigned char elf_romfs_img[]; +extern const unsigned int elf_romfs_img_len; #elif !defined(CONFIG_EXAMPLES_ELF_EXTERN) # error "No file system selected" #endif @@ -223,9 +223,9 @@ int main(int argc, FAR char *argv[]) CONFIG_EXAMPLES_ELF_DEVMINOR); desc.minor = CONFIG_EXAMPLES_ELF_DEVMINOR; /* Minor device number of the ROM disk. */ - desc.nsectors = NSECTORS(romfs_img_len); /* The number of sectors in the ROM disk */ + desc.nsectors = NSECTORS(elf_romfs_img_len); /* The number of sectors in the ROM disk */ desc.sectsize = SECTORSIZE; /* The size of one sector in bytes */ - desc.image = (FAR uint8_t *)romfs_img; /* File system image */ + desc.image = (FAR uint8_t *)elf_romfs_img; /* File system image */ ret = boardctl(BOARDIOC_ROMDISK, (uintptr_t)&desc); if (ret < 0) diff --git a/examples/elf/tests/Makefile b/examples/elf/tests/Makefile index 1ade3b106..b72020917 100644 --- a/examples/elf/tests/Makefile +++ b/examples/elf/tests/Makefile @@ -85,7 +85,8 @@ $(ROMFS_IMG): install $(FSIMG_SRC): $(ROMFS_IMG) $(Q) (cd $(TESTS_DIR) && echo "#include <nuttx/compiler.h>" >$@ && \ - xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" >>$@) + xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" | \ + sed -e "s/romfs_img/elf_romfs_img/g" >>$@) else # Make sure that the NuttX gencromfs tool has been built diff --git a/examples/sotest/lib/Makefile b/examples/sotest/lib/Makefile index 734944203..ce1aa3748 100644 --- a/examples/sotest/lib/Makefile +++ b/examples/sotest/lib/Makefile @@ -64,7 +64,8 @@ $(ROMFS_IMG): install $(ROMFS_SRC): $(ROMFS_IMG) $(Q) (cd $(LIB_DIR) && echo "#include <nuttx/compiler.h>" >$@ && \ - xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" >>$@) + xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" | \ + sed -e "s/romfs_img/sotest_romfs_img/g" >>$@) endif # Create the exported symbol table diff --git a/examples/sotest/sotest_main.c b/examples/sotest/sotest_main.c index de2f5d74e..1b63ee81e 100644 --- a/examples/sotest/sotest_main.c +++ b/examples/sotest/sotest_main.c @@ -85,8 +85,8 @@ ****************************************************************************/ #ifdef CONFIG_EXAMPLES_SOTEST_BUILTINFS -extern const unsigned char romfs_img[]; -extern const unsigned int romfs_img_len; +extern const unsigned char sotest_romfs_img[]; +extern const unsigned int sotest_romfs_img_len; #endif extern const struct symtab_s g_sot_exports[]; @@ -127,10 +127,10 @@ int main(int argc, FAR char *argv[]) #ifdef CONFIG_EXAMPLES_SOTEST_BUILTINFS /* Create a ROM disk for the ROMFS filesystem */ - desc.minor = 0; /* Minor device number of the ROM disk. */ - desc.nsectors = NSECTORS(romfs_img_len); /* The number of sectors in the ROM disk */ + desc.minor = CONFIG_EXAMPLES_SOTEST_DEVMINOR; /* Minor device number of the ROM disk. */ + desc.nsectors = NSECTORS(sotest_romfs_img_len); /* The number of sectors in the ROM disk */ desc.sectsize = SECTORSIZE; /* The size of one sector in bytes */ - desc.image = (FAR uint8_t *)romfs_img; /* File system image */ + desc.image = (FAR uint8_t *)sotest_romfs_img; /* File system image */ for (; desc.minor <= CONFIG_EXAMPLES_SOTEST_DEVMINOR_MAX; desc.minor++) {
