mirror of https://github.com/ArduPilot/ardupilot
build: px4: allow to embed defaults file into ROMFS
This commit is contained in:
parent
eb70dbc6f5
commit
f6d43aea25
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue