From: Nathaniel Wesley Filardo Date: Sun, 31 May 2020 21:51:31 +0000 (+0100) Subject: mkspiffs.sh: generalize for multiple configurations X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=a33de6210f06eec0e1e126983327eab9a6581a6e;p=acmetensortoys-esp-lua_lamp mkspiffs.sh: generalize for multiple configurations --- 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