Skip to content

Commit

Permalink
AP_HAL_ChibiOS: chibios_hwdef.py tidy embedding of files into ROMFS
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jan 29, 2025
1 parent 8425bf4 commit 13980eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -2980,13 +2980,19 @@ def romfs_wildcard(self, pattern):

def romfs_add_dir(self, subdirs, relative_to_base=False):
'''add a filesystem directory to ROMFS'''
if self.is_bootloader_fw():
# FIXME: why were we called?!
return
for dirname in subdirs:
if relative_to_base:
romfs_dir = os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', dirname)
else:
romfs_dir = os.path.join(os.path.dirname(self.hwdef[0]), dirname)
if not self.is_bootloader_fw() and os.path.exists(romfs_dir):
for root, d, files in os.walk(romfs_dir):
if not os.path.exists(romfs_dir):
continue

if True:
for root, dirs, files in os.walk(romfs_dir):
for f in files:
if fnmatch.fnmatch(f, '*~'):
# skip editor backup files
Expand Down

0 comments on commit 13980eb

Please sign in to comment.