jetson_stats
jetson_stats copied to clipboard
Crash if dpkg is missing
Describe the bug
If dpkg is missing, for example if the system is a custom built yocto with meta-tegra then the following line will cuse an exception https://github.com/rbonghi/jetson_stats/blob/e22b49f0250cd1b81aaa4a311af51d01cf219cf1/jtop/core/jetson_variables.py#L203 on line 204
To Reproduce
- Install jetson_stats on a system without dpkg; or forcefully unistall dpkg; or change line 203 to an invalid command
- Remove or rename
/etc/nv_tegra_release
if it exists - (re-)start the jtop service
- See error in service log
Expected behavior
Looking at the function get_nvidia_l4t
the intended behavior I would expect is to fail the version detection and return an empty string instead of crashing.
Perhaps check that dpkg exist first and if not then return false from check_dpkg_nvidia_l4t_core
.
Board
- jetson-stats version: 4.2.7
- Jetpack: 5.1.3
- L4T: 35.5.0