Skip to content

Commit 15c90ac

Browse files
Donny9xiaoxiang781216
authored andcommitted
examples/sotest/elf: rename romfs_img to run test with CONFIG_NSH_ROMFSETC
Signed-off-by: dongjiuzhu1 <[email protected]>
1 parent fdc35d0 commit 15c90ac

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

examples/elf/elf_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ static char fullpath[128];
124124
****************************************************************************/
125125

126126
#if defined(CONFIG_EXAMPLES_ELF_ROMFS) || defined(CONFIG_EXAMPLES_ELF_CROMFS)
127-
extern const unsigned char romfs_img[];
128-
extern const unsigned int romfs_img_len;
127+
extern const unsigned char elf_romfs_img[];
128+
extern const unsigned int elf_romfs_img_len;
129129
#elif !defined(CONFIG_EXAMPLES_ELF_EXTERN)
130130
# error "No file system selected"
131131
#endif
@@ -223,9 +223,9 @@ int main(int argc, FAR char *argv[])
223223
CONFIG_EXAMPLES_ELF_DEVMINOR);
224224

225225
desc.minor = CONFIG_EXAMPLES_ELF_DEVMINOR; /* Minor device number of the ROM disk. */
226-
desc.nsectors = NSECTORS(romfs_img_len); /* The number of sectors in the ROM disk */
226+
desc.nsectors = NSECTORS(elf_romfs_img_len); /* The number of sectors in the ROM disk */
227227
desc.sectsize = SECTORSIZE; /* The size of one sector in bytes */
228-
desc.image = (FAR uint8_t *)romfs_img; /* File system image */
228+
desc.image = (FAR uint8_t *)elf_romfs_img; /* File system image */
229229

230230
ret = boardctl(BOARDIOC_ROMDISK, (uintptr_t)&desc);
231231
if (ret < 0)

examples/elf/tests/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ $(ROMFS_IMG): install
8585

8686
$(FSIMG_SRC): $(ROMFS_IMG)
8787
$(Q) (cd $(TESTS_DIR) && echo "#include <nuttx/compiler.h>" >$@ && \
88-
xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" >>$@)
88+
xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" | \
89+
sed -e "s/romfs_img/elf_romfs_img/g" >>$@)
8990

9091
else
9192
# Make sure that the NuttX gencromfs tool has been built

examples/sotest/lib/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ $(ROMFS_IMG): install
6464

6565
$(ROMFS_SRC): $(ROMFS_IMG)
6666
$(Q) (cd $(LIB_DIR) && echo "#include <nuttx/compiler.h>" >$@ && \
67-
xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" >>$@)
67+
xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" | \
68+
sed -e "s/romfs_img/sotest_romfs_img/g" >>$@)
6869
endif
6970

7071
# Create the exported symbol table

examples/sotest/sotest_main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
****************************************************************************/
8686

8787
#ifdef CONFIG_EXAMPLES_SOTEST_BUILTINFS
88-
extern const unsigned char romfs_img[];
89-
extern const unsigned int romfs_img_len;
88+
extern const unsigned char sotest_romfs_img[];
89+
extern const unsigned int sotest_romfs_img_len;
9090
#endif
9191

9292
extern const struct symtab_s g_sot_exports[];
@@ -127,10 +127,10 @@ int main(int argc, FAR char *argv[])
127127
#ifdef CONFIG_EXAMPLES_SOTEST_BUILTINFS
128128
/* Create a ROM disk for the ROMFS filesystem */
129129

130-
desc.minor = 0; /* Minor device number of the ROM disk. */
131-
desc.nsectors = NSECTORS(romfs_img_len); /* The number of sectors in the ROM disk */
130+
desc.minor = CONFIG_EXAMPLES_SOTEST_DEVMINOR; /* Minor device number of the ROM disk. */
131+
desc.nsectors = NSECTORS(sotest_romfs_img_len); /* The number of sectors in the ROM disk */
132132
desc.sectsize = SECTORSIZE; /* The size of one sector in bytes */
133-
desc.image = (FAR uint8_t *)romfs_img; /* File system image */
133+
desc.image = (FAR uint8_t *)sotest_romfs_img; /* File system image */
134134

135135
for (; desc.minor <= CONFIG_EXAMPLES_SOTEST_DEVMINOR_MAX; desc.minor++)
136136
{

0 commit comments

Comments
 (0)