Commit Graph

19 Commits

Author SHA1 Message Date
sonika.rathi
7fe0c2392f fix(spiffs): shorten obj_name_len guard comment 2026-07-16 09:52:08 +02:00
yi chen
e628a207ac fix(spiffs): fix off-by-one in spiffsgen.py obj name length check
SpiffsFS.create_file() rejected names only when strictly longer than
obj_name_len, but CONFIG_SPIFFS_OBJ_NAME_LEN's documented semantics
(see components/spiffs/Kconfig) are that the length includes the
zero-termination character, so the maximum number of actual name
characters is obj_name_len - 1.

With the old check, a name exactly obj_name_len characters long was
accepted. SpiffsObjIndexPage.to_binary() then computes the NUL padding
after the name as (obj_name_len - len(name)), which is 0 in that case,
so the generated image's fixed-size name field ends up with no NUL
terminator anywhere in its reserved region.

Fix the boundary so the generator enforces the same maximum length
that the Kconfig help text documents.
2026-07-13 08:29:48 +08:00
sonika.rathi
eda2d97bdb fix(spiffs): normalize spiffsgen CLI output with esp-pylib 2026-06-05 15:09:16 +08:00
Ivan Grokhotkov
10cc15b150 fix(storage): applied spelling fixes by codespell pre-commit hook 2024-03-28 13:00:54 +01:00
Roland Dobai
bab3830797 Tools: Fix flake8 version 5 warnings 2022-08-12 08:13:13 +00:00
Ivan Grokhotkov
911a8fc714 spiffs, wear_levelling: update copyright headers 2022-02-22 00:09:24 +03:00
Roland Dobai
407053592e Drop support for unsupported Python versions 2021-06-21 21:48:49 +02:00
Ivan Grokhotkov
0bd9f6fe12 tools: spiffsgen: fix length error, add test case 2021-05-03 11:37:42 +02:00
Ivan Grokhotkov
9af485307e tools: spiffsgen.py: minor lint fixes
Not squashing these since they should have gone into the commit before
adding type hints.
2021-04-30 18:07:48 +02:00
Ivan Grokhotkov
a9b81341ca tools: spiffsgen.py: make default arguments meaningful
Without this, defaults of inverse options (--no-magic-len) were based
on the 'dest' value. In this case, dest='use_magic_len’, and the
default value is True. Which is confusing, because both
—use-magic-len and --no-magic-len show the same default value.

This adds a custom help formatter class which doesn’t add default
to the option help text if the help string already includes it.
2021-04-30 18:07:48 +02:00
Ivan Grokhotkov
9f20eeb1c0 tools: spiffsgen.py: add type annotations 2021-04-30 18:07:48 +02:00
Ivan Grokhotkov
930ee51b8f tools: spiffsgen.py: avoid reallocating byte array for each new block
On large filesystems (~15 MB), this reduces execution time from
11s to 0.3s.
2021-04-30 18:07:48 +02:00
Ivan Grokhotkov
ad1606ae1d tools: spiffsgen.py: esp8266 compatibility options
1. Implement --aligned-obj-ix-tables which is used by default on the
   ESP8266 in NodeMCU and Arduino.
2. Introduce --no-magic and --no-magic-len to allow disabling options
   --use-magic-len and --use-magic. As these have been declared with
   default=True and action='store_true', they couldn't be disabled
   otherwise.

Closes https://github.com/espressif/esp-idf/issues/6717
2021-04-30 18:07:48 +02:00
Fu Hanxi
0146f258d7 style: format python files with isort and double-quote-string-fixer 2021-01-26 10:49:01 +08:00
Anton Maklakov
df544dee30 tools: Redirect some warnings to stderr 2020-12-15 12:41:20 +07:00
martin.gano
f4ea2dcb74 Tools: add Python 2 deprecation warning 2020-12-02 11:08:48 +01:00
Marcin Borowicz
6153a0ab62 spiffs: follow symlinks feature during partition in spiffsgen 2019-10-08 17:55:59 +08:00
V.Dudnik
867ea68d5a fix spiffsgen.py wrong path delimiter on windows 2019-05-05 17:50:15 +08:00
Renz Christian Bagaporo
8ba10bf3dc spiffs: Implement spiffs image generation 2019-03-25 12:51:52 +08:00