From 28b7c7e970146b8b702835bba4b243933bac1731 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 29 Apr 2026 20:28:08 +1200 Subject: [PATCH] fix(rcS): use awk instead of bc for scaled timeout math bc isn't installed in the px4-dev CI container we now use. awk is required by POSIX so it's always present. Same float math, no extra dependency. --- ROMFS/px4fmu_common/init.d-posix/rcS | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 4d826ddc046..e16c33a1323 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -186,20 +186,21 @@ param set-default UXRCE_DDS_AG_IP 2130706433 # 127.0.0.1 # Adapt timeout parameters if simulation runs faster or slower than realtime. +# Uses awk for the float multiplication; bc is not installed in all CI containers. if [ -n "$PX4_SIM_SPEED_FACTOR" ]; then - COM_DL_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 10" | bc) + COM_DL_LOSS_T_LONGER=$(awk -v f="$PX4_SIM_SPEED_FACTOR" 'BEGIN{print f * 10}') echo "COM_DL_LOSS_T set to $COM_DL_LOSS_T_LONGER" param set COM_DL_LOSS_T $COM_DL_LOSS_T_LONGER - COM_RC_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 1.0" | bc) + COM_RC_LOSS_T_LONGER=$(awk -v f="$PX4_SIM_SPEED_FACTOR" 'BEGIN{print f * 1.0}') echo "COM_RC_LOSS_T set to $COM_RC_LOSS_T_LONGER" param set COM_RC_LOSS_T $COM_RC_LOSS_T_LONGER - COM_OF_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 1.0" | bc) + COM_OF_LOSS_T_LONGER=$(awk -v f="$PX4_SIM_SPEED_FACTOR" 'BEGIN{print f * 1.0}') echo "COM_OF_LOSS_T set to $COM_OF_LOSS_T_LONGER" param set COM_OF_LOSS_T $COM_OF_LOSS_T_LONGER - COM_DISARM_PRFLT_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 10.0" | bc) + COM_DISARM_PRFLT_LONGER=$(awk -v f="$PX4_SIM_SPEED_FACTOR" 'BEGIN{print f * 10.0}') echo "COM_DISARM_PRFLT set to $COM_DISARM_PRFLT_LONGER" param set COM_DISARM_PRFLT $COM_DISARM_PRFLT_LONGER fi