-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmkspiffs.sh
executable file
·46 lines (37 loc) · 1.32 KB
/
mkspiffs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
FWIMG=${FWIMG:-firm/bin/nodemcu_integer_test.bin}
BOARDNAME=${BOARDNAME:-home}
[ -r firm ] || {
echo "./firm should be a symlink to a built firmware repo"
exit 1
}
[ -r ${FWIMG} ] || {
echo "No firmware image ${FWIMG}"
exit 1
}
FWSZ=$(stat --printf="%s" ${FWIMG})
# Now made external
# LUACROSS=$(readlink -f ./firm/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
if [ -r conf/${BOARDNAME}/rewrites.sed ]; then
for i in conf/_common/*.conf.in; do
sed -f conf/${BOARDNAME}/rewrites.sed < $i \
> conf/${BOARDNAME}/`basename $i .in`
done
elif [ ! -r conf/${BOARDNAME}/nwfmqtt.conf ]; then
echo 'NO MQTT CONFIGURATION KNOWN; THIS IS UNLIKELY TO WORK!'
fi
for i in conf/${BOARDNAME}/*.conf; do echo import $i `basename $i`; done
[ -r conf/${BOARDNAME}/nwfnet.cert ] && echo import conf/${BOARDNAME}/nwfnet.cert nwfnet.cert
# And all our Lua files; now in LFS
# find . -maxdepth 1 -name \*.lua ! -name ctfws-lfs-strings.lua -printf "import %f %f\n"
# 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
) | ./firm/tools/spiffsimg/spiffsimg \
-f spiffs-${BOARDNAME}.img \
-c 262144 \
-r /dev/fd/0