Skip to content

Commit cf27f08

Browse files
yf13xiaoxiang781216
authored andcommitted
add const for romfs_img_len
this makes both declarations read-only as they are corelated. Signed-off-by: Yanfeng Liu <[email protected]>
1 parent 41a4963 commit cf27f08

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/mkromfsimg.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ genromfs -h 1>/dev/null 2>&1 || { \
5757

5858
# Now we are ready to make the ROMFS image
5959

60-
genromfs -f ${romfsimg} -d ${fsdir} -V "NuttXBootVol" || { echo "genromfs failed" ; exit 1 ; }
60+
genromfs -f ${romfsimg} -d ${fsdir} -V "NuttXBootVol" || \
61+
{ echo "genromfs failed" ; exit 1 ; }
6162

6263
# And, finally, create the header file
6364

6465
echo '#include <nuttx/compiler.h>' >${headerfile}
65-
xxd -i ${romfsimg} | sed 's/^unsigned char/const unsigned char aligned_data(4)/g' >>${headerfile} || \
66+
xxd -i ${romfsimg} | sed -e 's/^unsigned /const unsigned /' \
67+
-e 's/char /char aligned_data(4) /' >>${headerfile} || \
6668
{ echo "ERROR: xxd of $< failed" ; rm -f ${romfsimg}; exit 1 ; }
6769
rm -f ${romfsimg}

0 commit comments

Comments
 (0)