Skip to content

Commit

Permalink
add const for romfs_img_len
Browse files Browse the repository at this point in the history
this makes both declarations read-only as they are corelated.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 committed Jan 2, 2024
1 parent 4c0bd14 commit b55c98f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/mkromfsimg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ genromfs -h 1>/dev/null 2>&1 || { \

# Now we are ready to make the ROMFS image

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

# And, finally, create the header file

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

0 comments on commit b55c98f

Please sign in to comment.