diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index c0f2743f4c936..fb9cd62a61bdc 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -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