build: px4: allow to embed defaults file into ROMFS

(cherry picked from commit f6d43aea25)
This commit is contained in:
Lucas De Marchi 2017-06-05 14:19:37 -07:00
parent 462334f605
commit 8b9aaddd27
2 changed files with 10 additions and 0 deletions

View File

@ -460,6 +460,12 @@ class px4(Board):
# be searched for in sources and installed in ROMFS as rc.board. This
# init script is used to change the init behavior among different boards.
self.board_rc = False
# Path relative to the ROMFS directory where to find a file with default
# parameters. If set this file will be copied to /etc/defaults.parm
# inside the ROMFS
self.param_defaults = None
self.ROMFS_EXCLUDE = []
def configure(self, cfg):
@ -504,6 +510,7 @@ class px4(Board):
env.PX4_BOARD_NAME = self.board_name
env.PX4_BOARD_RC = self.board_rc
env.PX4_PX4IO_NAME = self.px4io_name
env.PX4_PARAM_DEFAULTS = self.param_defaults
env.AP_PROGRAM_AS_STLIB = True

View File

@ -200,6 +200,9 @@ def _process_romfs(self):
board_rc = 'init.d/rc.%s' % bld.env.get_flat('PX4_BOARD_NAME')
file_list.append((board_rc, 'init.d/rc.board'))
if bld.env.PX4_PARAM_DEFAULTS:
file_list.append((bld.env.PX4_PARAM_DEFAULTS, 'defaults.parm'))
romfs_src = bld.srcnode.find_dir(bld.env.PX4_ROMFS_SRC)
romfs_bld = bld.bldnode.make_node(bld.env.PX4_ROMFS_BLD)