Skip to content

quick buildfs fix #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def _parse_ld_sizes(ldscript_path):
r"irom0_0_seg\s*:.+len\s*=\s*(0x[\da-f]+)", flags=re.I)
spiffs_re = re.compile(
r"PROVIDE\s*\(\s*_SPIFFS_(\w+)\s*=\s*(0x[\da-f]+)\s*\)", flags=re.I)
fs_re = re.compile(
r"PROVIDE\s*\(\s*_FS_(\w+)\s*=\s*(0x[\da-f]+)\s*\)", flags=re.I)
with open(ldscript_path) as fp:
for line in fp.readlines():
line = line.strip()
Expand All @@ -75,6 +77,13 @@ def _parse_ld_sizes(ldscript_path):
if match:
result['spiffs_%s' % match.group(1)] = _parse_size(
match.group(2))
else:
# if spiffs_ failed to match try fs_
match = fs_re.search(line)
if match:
result['spiffs_%s' % match.group(1)] = _parse_size(
match.group(2))

return result


Expand All @@ -90,6 +99,8 @@ def fetch_spiffs_size(env):
for key in ldsizes:
if key.startswith("spiffs_"):
env[key.upper()] = ldsizes[key]
elif key.startswith("fs_"):
env[key.upper()] = ldsizes[key]

assert all([
k in env
Expand Down