From a33de6210f06eec0e1e126983327eab9a6581a6e Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sun, 31 May 2020 22:51:31 +0100 Subject: [PATCH] mkspiffs.sh: generalize for multiple configurations --- mkspiffs.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mkspiffs.sh b/mkspiffs.sh index b4108de..3cea19c 100755 --- a/mkspiffs.sh +++ b/mkspiffs.sh @@ -2,23 +2,27 @@ set -e -u -x -FWSZ=$(stat --printf="%s" ./core/firm/bin/nodemcu_integer_lamp.bin) -FWSZ=$((FWSZ + 131072)) # Pad for LFS +: ${BOARDNAME:=test} + +if [ -z "${FWSZ-}" ]; then + FWSZ=${FWSZ:$(stat --printf="%s" ./core/firm/bin/nodemcu_integer_expect-tests.bin)} + FWSZ=$((FWSZ + 131072)) # Pad for LFS +fi ( # Init is the only core Lua that does not live in LFS. echo import core/init.lua init.lua # Configuration - echo import conf/test/nwfnet.conf nwfnet.conf - echo import conf/test/nwfmqtt.conf nwfmqtt.conf - echo import conf/test/nwfmqtt.subs nwfmqtt.subs + echo import conf/${BOARDNAME}/nwfnet.conf nwfnet.conf + echo import conf/${BOARDNAME}/nwfmqtt.conf nwfmqtt.conf + echo import conf/${BOARDNAME}/nwfmqtt.subs nwfmqtt.subs # And the LFS image with the rest of everything # We could, and used to, but we now go via the nodemcu partition tool # echo import _lfs_build/luac.out luac.out ) | ./core/firm/tools/spiffsimg/spiffsimg \ - -f spiffs.img \ + -f spiffs-${BOARDNAME}.img \ -S 4MB -U ${FWSZ} \ -r /dev/fd/0 -- 2.50.1