nxp-archive / openil_sja1105-tool

The sja1105-tool is a Linux userspace application for configuring the NXP SJA1105 Automotive Ethernet L2 switch.
BSD 3-Clause "New" or "Revised" License
25 stars 20 forks source link

Hexdump returns error even when successful #62

Open gregokent opened 3 years ago

gregokent commented 3 years ago

If the hexdump command succeeds, it'll still end up returning an error as the success case will end up falling through to filesystem_error1: where it gets remapped to SJA1105_ERR_FILESYSTEM before returning. https://github.com/openil/sja1105-tool/blob/085d42c72c4e9508aa7bc9bfbbb5fe41082fcdec/src/tool/staging-area.c#L122-L132

As a result, the sja1105-init startup script will always find the config to be invalid and create it anew: https://github.com/openil/sja1105-tool/blob/085d42c72c4e9508aa7bc9bfbbb5fe41082fcdec/etc/sja1105-init#L25-L28

vladimiroltean commented 3 years ago

Hi, It looks like you found a bug. Would you mind sending a pull request with a patch? Thanks, Vladimir