From 33301764e4fd6fd03246ca4654c8541b429600dc Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 14 Oct 2025 06:56:27 +0200 Subject: [PATCH] Handle `SYS_AUTOSTART` 0 the same as no valid airframe being available (#25645) * ROMFS: do not exit airframe loading if SYS_AUTOSTART is 0 Do not treat 0 as a magic value that skips the aiframe loading. Instead leave it tot he rc.autostart to load an airframe that if finds appropriate (can be defined in external aiframe). Signed-off-by: Silvan * ROMFS: adjust airframe load spacing and message/comment wording --------- Signed-off-by: Silvan Co-authored-by: Silvan --- ROMFS/px4fmu_common/init.d/rcS | 36 +++++++++++++++------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index f747966e03..1337a777c8 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -228,30 +228,26 @@ else fi unset BOARD_RC_ADDITIONAL_INIT - # Load airframe configuration based on SYS_AUTOSTART parameter - if ! param compare SYS_AUTOSTART 0 + # Load airframe configuration based on SYS_AUTOSTART parameter if successful VEHICLE_TYPE gets set + # Run autogenerated ROMFS airframe script + . ${R}etc/init.d/rc.autostart + + if [ ${VEHICLE_TYPE} = none ] then - # rc.autostart directly run the right airframe script which sets the VEHICLE_TYPE - # Look for airframe in ROMFS - . ${R}etc/init.d/rc.autostart - - if [ ${VEHICLE_TYPE} = none ] + # Run external airframe script on SD card + if [ $STORAGE_AVAILABLE = yes ] then - # Use external startup file - if [ $STORAGE_AVAILABLE = yes ] - then - . ${R}etc/init.d/rc.autostart_ext - else - echo "ERROR [init] SD card not mounted - can't load external airframe" - fi + . ${R}etc/init.d/rc.autostart_ext + else + echo "ERROR [init] SD not mounted, skipping external airframe" fi + fi - if [ ${VEHICLE_TYPE} = none ] - then - echo "ERROR [init] No airframe file found for SYS_AUTOSTART value" - param set SYS_AUTOSTART 0 - tune_control play error - fi + if [ ${VEHICLE_TYPE} = none ] + then + echo "ERROR [init] No airframe file found for SYS_AUTOSTART value" + param set SYS_AUTOSTART 0 + tune_control play error fi # Check parameter version and reset upon airframe configuration version mismatch.