]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_ctfws/commitdiff
Initial commit of mkspiffs.sh script
authorNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sun, 11 Nov 2018 10:57:08 +0000 (10:57 +0000)
committerNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sun, 11 Nov 2018 13:15:33 +0000 (13:15 +0000)
mkspiffs.sh [new file with mode: 0755]

diff --git a/mkspiffs.sh b/mkspiffs.sh
new file mode 100755 (executable)
index 0000000..dc3f781
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+FWDIR=${FWDIR:-/home/nwf/ee/esp/nodemcu-firmware}
+FWIMG=${FWIMG:-${FWDIR}/bin/nodemcu_integer_test.bin}
+CONFNAME=${CONFNAME:-home}
+
+FWSZ=$(stat --printf="%s" ${FWIMG})
+
+LUACROSS=${FWDIR}/luac.cross ./mklfs.sh
+
+(
+       # Init is the only core Lua that does not live in LFS
+       echo import core/init.lua init.lua
+
+       # Grab our configuration
+       for i in conf/${CONFNAME}/*; do echo import $i `basename $i`; done
+
+       # And all our Lua files
+       for i in *.lua; do echo import $i $i; done
+
+       # And the LFS image with the rest of everything
+       echo import _lfs_build/luac.out luac.out
+) | ${FWDIR}/tools/spiffsimg/spiffsimg \
+     -f spiffs-${CONFNAME}.img \
+     -S 32m -U ${FWSZ} \
+     -o /dev/fd/1 -r /dev/fd/0
+
+echo