init: make echo consistent with printfs

This commit is contained in:
Julian Oes
2016-06-02 17:25:02 +01:00
committed by Lorenz Meier
parent b24eded7a0
commit c87f9a1f8a
2 changed files with 35 additions and 35 deletions
+8 -8
View File
@@ -45,10 +45,10 @@ then
if mixer load $OUTPUT_DEV $MIXER_FILE if mixer load $OUTPUT_DEV $MIXER_FILE
then then
echo "[i] Mixer: $MIXER_FILE on $OUTPUT_DEV" echo "INFO [init] Mixer: $MIXER_FILE on $OUTPUT_DEV"
else else
echo "[i] Error loading mixer: $MIXER_FILE" echo "ERROR [init] Error loading mixer: $MIXER_FILE"
echo "ERROR: Could not load mixer: $MIXER_FILE" >> $LOG_FILE echo "ERROR:[init] Could not load mixer: $MIXER_FILE" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
@@ -56,8 +56,8 @@ then
else else
if [ $MIXER != skip ] if [ $MIXER != skip ]
then then
echo "[i] Mixer not defined" echo "ERROR [init] Mixer not defined"
echo "ERROR: Mixer not defined" >> $LOG_FILE echo "ERROR [init] Mixer not defined" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
fi fi
@@ -137,10 +137,10 @@ then
then then
if mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE if mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE
then then
echo "[i] Mixer: $MIXER_AUX_FILE on $OUTPUT_AUX_DEV" echo "INFO [init] Mixer: $MIXER_AUX_FILE on $OUTPUT_AUX_DEV"
else else
echo "[i] Error loading mixer: $MIXER_AUX_FILE" echo "ERROR [init] Error loading mixer: $MIXER_AUX_FILE"
echo "ERROR: Could not load mixer: $MIXER_AUX_FILE" >> $LOG_FILE echo "ERROR [init] Could not load mixer: $MIXER_AUX_FILE" >> $LOG_FILE
fi fi
else else
set PWM_AUX_OUT none set PWM_AUX_OUT none
+27 -27
View File
@@ -32,9 +32,9 @@ else
then then
if mount -t vfat /dev/mmcsd0 /fs/microsd if mount -t vfat /dev/mmcsd0 /fs/microsd
then then
echo "[i] microSD card formatted" echo "INFO [init] MicroSD card formatted"
else else
echo "[i] format failed" echo "ERROR [init] Format failed"
tone_alarm MNBG tone_alarm MNBG
set LOG_FILE /dev/null set LOG_FILE /dev/null
fi fi
@@ -50,7 +50,7 @@ fi
set FRC /fs/microsd/etc/rc.txt set FRC /fs/microsd/etc/rc.txt
if [ -f $FRC ] if [ -f $FRC ]
then then
echo "[i] Executing script: $FRC" echo "INFO [init] Executing script: $FRC"
sh $FRC sh $FRC
set MODE custom set MODE custom
fi fi
@@ -173,7 +173,7 @@ then
# #
if param compare SYS_AUTOSTART 0 if param compare SYS_AUTOSTART 0
then then
echo "[i] No autostart" echo "INFO [init] No autostart"
else else
sh /etc/init.d/rc.autostart sh /etc/init.d/rc.autostart
fi fi
@@ -192,7 +192,7 @@ then
set FCONFIG /fs/microsd/etc/config.txt set FCONFIG /fs/microsd/etc/config.txt
if [ -f $FCONFIG ] if [ -f $FCONFIG ]
then then
echo "[i] Custom: $FCONFIG" echo "INFO [init] Custom: $FCONFIG"
sh $FCONFIG sh $FCONFIG
fi fi
unset FCONFIG unset FCONFIG
@@ -223,7 +223,7 @@ then
if px4io checkcrc ${IO_FILE} if px4io checkcrc ${IO_FILE}
then then
echo "PX4IO CRC OK" >> $LOG_FILE echo "INFO [init] PX4IO CRC OK" >> $LOG_FILE
set IO_PRESENT yes set IO_PRESENT yes
else else
@@ -246,16 +246,16 @@ then
usleep 500000 usleep 500000
if px4io checkcrc $IO_FILE if px4io checkcrc $IO_FILE
then then
echo "PX4IO CRC OK after updating" >> $LOG_FILE echo "INFO [init] PX4IO CRC OK after updating" >> $LOG_FILE
tone_alarm MLL8CDE tone_alarm MLL8CDE
set IO_PRESENT yes set IO_PRESENT yes
else else
echo "PX4IO update failed" >> $LOG_FILE echo "ERROR [init] PX4IO update failed" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
else else
echo "PX4IO update failed" >> $LOG_FILE echo "ERROR [init] PX4IO update failed" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
fi fi
@@ -263,7 +263,7 @@ then
if [ $IO_PRESENT == no ] if [ $IO_PRESENT == no ]
then then
echo "ERROR: PX4IO not found" >> $LOG_FILE echo "ERROR [init] PX4IO not found" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
fi fi
@@ -355,7 +355,7 @@ then
then then
if param compare UAVCAN_ENABLE 0 if param compare UAVCAN_ENABLE 0
then then
echo "[i] OVERRIDING UAVCAN_ENABLE = 1" echo "INFO [init] OVERRIDING UAVCAN_ENABLE = 1" >> $LOG_FILE
param set UAVCAN_ENABLE 1 param set UAVCAN_ENABLE 1
fi fi
fi fi
@@ -366,7 +366,7 @@ then
then then
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
else else
echo "PX4IO start failed" >> $LOG_FILE echo "INFO [init] PX4IO start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
fi fi
@@ -376,7 +376,7 @@ then
if fmu mode_$FMU_MODE if fmu mode_$FMU_MODE
then then
else else
echo "FMU start failed" >> $LOG_FILE echo "ERR [init] FMU start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
@@ -408,7 +408,7 @@ then
if mkblctrl $MKBLCTRL_ARG if mkblctrl $MKBLCTRL_ARG
then then
else else
echo "ERROR: MK start failed" >> $LOG_FILE echo "ERROR [init] MK start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
unset MKBLCTRL_ARG unset MKBLCTRL_ARG
@@ -420,7 +420,7 @@ then
if pwm_out_sim mode_port2_pwm8 if pwm_out_sim mode_port2_pwm8
then then
else else
echo "PWM SIM start failed" >> $LOG_FILE echo "ERROR [init] PWM SIM start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
fi fi
@@ -436,7 +436,7 @@ then
then then
sh /etc/init.d/rc.io sh /etc/init.d/rc.io
else else
echo "PX4IO start failed" >> $LOG_FILE echo "ERROR [init] PX4IO start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
fi fi
@@ -446,7 +446,7 @@ then
if fmu mode_$FMU_MODE if fmu mode_$FMU_MODE
then then
else else
echo "FMU mode_$FMU_MODE start failed" >> $LOG_FILE echo "ERROR [init] FMU mode_$FMU_MODE start failed" >> $LOG_FILE
tone_alarm $TUNE_ERR tone_alarm $TUNE_ERR
fi fi
@@ -658,7 +658,7 @@ then
# #
if [ $VEHICLE_TYPE == fw ] if [ $VEHICLE_TYPE == fw ]
then then
echo "FIXED WING" echo "INFO [init] Fixedwing"
if [ $MIXER == none ] if [ $MIXER == none ]
then then
@@ -686,11 +686,11 @@ then
# #
if [ $VEHICLE_TYPE == mc ] if [ $VEHICLE_TYPE == mc ]
then then
echo "MULTICOPTER" echo "INFO [init] Multicopter"
if [ $MIXER == none ] if [ $MIXER == none ]
then then
echo "Mixer undefined" echo "INFO [init] Mixer undefined"
fi fi
if [ $MAV_TYPE == none ] if [ $MAV_TYPE == none ]
@@ -737,7 +737,7 @@ then
# Still no MAV_TYPE found # Still no MAV_TYPE found
if [ $MAV_TYPE == none ] if [ $MAV_TYPE == none ]
then then
echo "Unknown MAV_TYPE" echo "WARN [init] Unknown MAV_TYPE"
param set MAV_TYPE 2 param set MAV_TYPE 2
else else
param set MAV_TYPE $MAV_TYPE param set MAV_TYPE $MAV_TYPE
@@ -755,11 +755,11 @@ then
# #
if [ $VEHICLE_TYPE == vtol ] if [ $VEHICLE_TYPE == vtol ]
then then
echo "VTOL" echo "INFO [init] VTOL"
if [ $MIXER == none ] if [ $MIXER == none ]
then then
echo "VTOL mixer undefined" echo "WARN [init] VTOL mixer undefined"
fi fi
if [ $MAV_TYPE == none ] if [ $MAV_TYPE == none ]
@@ -782,7 +782,7 @@ then
# Still no MAV_TYPE found # Still no MAV_TYPE found
if [ $MAV_TYPE == none ] if [ $MAV_TYPE == none ]
then then
echo "Unknown MAV_TYPE" echo "WARN [init] Unknown MAV_TYPE"
param set MAV_TYPE 19 param set MAV_TYPE 19
else else
param set MAV_TYPE $MAV_TYPE param set MAV_TYPE $MAV_TYPE
@@ -866,14 +866,14 @@ then
# #
if [ $VEHICLE_TYPE == none ] if [ $VEHICLE_TYPE == none ]
then then
echo "[i] No autostart ID found" echo "WARN [init] No autostart ID found"
fi fi
# Start any custom addons # Start any custom addons
set FEXTRAS /fs/microsd/etc/extras.txt set FEXTRAS /fs/microsd/etc/extras.txt
if [ -f $FEXTRAS ] if [ -f $FEXTRAS ]
then then
echo "[i] Addons script: $FEXTRAS" echo "INFO [init] Addons script: $FEXTRAS"
sh $FEXTRAS sh $FEXTRAS
fi fi
unset FEXTRAS unset FEXTRAS
@@ -897,7 +897,7 @@ mavlink boot_complete
if [ $EXIT_ON_END == yes ] if [ $EXIT_ON_END == yes ]
then then
echo "NSH EXIT" echo "INFO [init] NSH exit"
exit exit
fi fi
unset EXIT_ON_END unset EXIT_ON_END