From 09ddf7f1b3e79bd37227520610847fbcf94187ce Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 21 Jan 2013 08:16:03 +1100 Subject: [PATCH 1/2] ROMFS: add support for EXTERNAL_SCRIPTS this adds support for an EXTERNAL_SCRIPTS directory, to complement the EXTERNAL_APPS option. It allows external apps to install scripts in ROMFS --- ROMFS/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ROMFS/Makefile b/ROMFS/Makefile index ec4221b93a..3b024de06d 100644 --- a/ROMFS/Makefile +++ b/ROMFS/Makefile @@ -35,6 +35,10 @@ ROMFS_FSSPEC := $(SRCROOT)/scripts/rcS~init.d/rcS \ $(SRCROOT)/mixers/FMU_octo_+.mix~mixers/FMU_octo_+.mix \ $(SRCROOT)/logging/logconv.m~logging/logconv.m +# the EXTERNAL_SCRIPTS variable is used to add out of tree scripts +# to ROMFS. +ROMFS_FSSPEC += $(EXTERNAL_SCRIPTS) + # # Add the PX4IO firmware to the spec if someone has dropped it into the # source directory, or otherwise specified its location. From ff35e5a58347f4d03d097f5939f19751ed82ae06 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 21 Jan 2013 08:15:13 +1100 Subject: [PATCH 2/2] if rc.APM is installed, run it --- ROMFS/scripts/rcS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ROMFS/scripts/rcS b/ROMFS/scripts/rcS index 69d791da52..660bf61e9d 100755 --- a/ROMFS/scripts/rcS +++ b/ROMFS/scripts/rcS @@ -69,6 +69,16 @@ else fi fi +# if this is an APM build then there will be a rc.APM script +# from an EXTERNAL_SCRIPTS build option +if [ -f /etc/init.d/rc.APM ] +then + echo Running rc.APM + # if APM startup is successful then nsh will exit + sh /etc/init.d/rc.APM +fi + + # # If we are still in flight mode, work out what airframe # configuration we have and start up accordingly.