firmware/bin
Neil Hanlon 622023de8b
fix(device-update.sh): safely filter args without breaking parsing (#7305)
The previous method of removing `--change-mode` from the argument list used a
string (`NEW_ARGS`) and `eval set -- $NEW_ARGS` to reconstruct the positional
parameters. This was both unsafe and incorrect.

Because `NEW_ARGS` was built using quoted literal `$arg` strings instead of the
actual values, it resulted in all filtered arguments being set to the same last
value of `$arg`. This caused `getopts` to receive incorrect input and silently
fail to parse options like `-p` and `-f`, leading to broken behavior and unset
variables (e.g., `ESPTOOL_CMD` never got a port).

This patch rewrites the logic to use an array (`NEW_ARGS+=("$arg")`), and
resets positional parameters via `set -- "${NEW_ARGS[@]}"`. This preserves
argument integrity and avoids the unsafe use of `eval`.

Example of the broken behavior before this fix:

  ./device-update.sh -p /dev/ttyACM0 -f firmware.bin

Resulted in:

  set -- firmware.bin firmware.bin firmware.bin firmware.bin

Now:

  set -- -p /dev/ttyACM0 -f firmware.bin

as expected.

Signed-off-by: Neil Hanlon <neil@shrug.pw>
2025-07-13 06:19:58 -05:00
..
bump_metainfo
config.d
generic
.gitignore
99-meshtasticd-udev.rules
base64_to_hex.py
build-esp32.sh Build: Update platformio with pkg install (#7315) 2025-07-12 14:35:57 -05:00
build-firmware.sh
build-native.sh
build-nrf52.sh Build: Update platformio with pkg install (#7315) 2025-07-12 14:35:57 -05:00
build-rp2xx0.sh
build-stm32wl.sh
build-userprefs-json.py Convert userprefs to a json file instead of header file which has to be included everywhere (#5471) 2024-12-03 06:17:25 -06:00
buildinfo.py bin: remove unused import in buildinfo.py 2024-05-15 23:00:12 +02:00
bump_version.py
check-all.sh
check-dependencies.sh
config-dist.yaml
device-install_test.ps1
device-install.bat
device-install.sh
device-update.bat
device-update.sh
dump-ram-users.sh Back out changes to non-source files 2023-01-21 21:23:24 +01:00
exception_decoder.py
gen-images.sh
generate_ci_matrix.py
genpartitions.py
lilygo_techo_bootloader-0.6.1.zip
mergehex
Meshtastic_nRF52_factory_erase_v3_S140_6.1.0.uf2
Meshtastic_nRF52_factory_erase_v3_S140_7.3.0.uf2 - use setRfSwitchTable 2024-09-02 15:06:06 +02:00
meshtasticd.service
native-gdbserver.sh
native-install.sh
native-run.sh
org.meshtastic.meshtasticd.desktop
org.meshtastic.meshtasticd.metainfo.xml
org.meshtastic.meshtasticd.svg
platformio-custom.py
promote-release.sh
read-system-info.sh
readprops.py meshtasticd-debian: Fix versioning compliance, add OBS (#5785) 2025-01-07 17:16:56 -06:00
regen-protos.bat
regen-protos.sh
rpkg.macros Update web, use centrally defined version (#6500) 2025-04-08 09:09:23 -05:00
s140_nrf52_7.3.0_softdevice.hex Merge hex for wm1110 target(s) 2024-07-04 08:10:40 -05:00
setup-python-for-esp-debug.sh
test-simulator.sh Back out changes to non-source files 2023-01-21 21:23:24 +01:00
uf2-convert.bat
uf2conv.py
update-lilygo_techo_bootloader-0.6.1_nosd.uf2
view-map.sh
web.version
wio_tracker_bootloader_update.bin Generalize SWD debugging stuff so it works on all nrf52 targets. (#4377) 2024-08-03 07:41:35 -05:00