mirror of
https://github.com/raspberrypi/rpi-eeprom.git
synced 2026-01-20 21:13:36 +08:00
The previous implementation was reading the sysfs files as plain text and encoding them as 'ascii' to remove all the trailing zeros. This is wrong twofold. To start with, the sysfs file we're querying are binary files[1], and we're reading it as a string. On top of that we're benefiting that *some* python implementations of string.encode() will deal with trailing zeros. Fix this by marking the files as binary and decoding them as strings before consuming them. [1] sysfs files are generally text based, but there is also the option to output binary data. Our configuration file does the later. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
13 KiB
Executable File
13 KiB
Executable File