The 'strings' utility is installed by binutils whereas 'tr' belongs with
coreutils. Minimal systems will only contain the latter, due to binutils'
size (20-50 MB). So, convert all uses of 'strings' to 'tr' so as to
avoid the package dependency.
The second 'tr' usage converts non-ASCII characters into newlines so as
to isolate the "BUILD_TIMESTAMP=1234567890" statement (similar to what
'strings' does). There is no need for this in the first one: non-ASCII
characters are simply discarded as DT aliases have a fixed one line
format.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Move to to the old directory now that it's no longer referenced by rpi-eeprom-update.
Add a dependency check for 'lspci' which is normally provided by
pciutils or busybox and remove the failover to the vl805 helper.
Tweak the failure messages for missing dependencies to be slightly less
OS specific.
The muxing of the SPI EEPROM and analog audio pins makes flashrom
usage unreliable and having two flashing mechanisms adds unnecessary
complexity to this script.
The bootloader supports EEPROM updates from USB-MSD, Network
and rpiboot there is no real need to support flashrom within this
utility. Therefore, the option to use flashrom can be removed from this
script.
Some users might forcibly install this on a board that isn't an rpi4.
Exit early, and explain why the program can't be run.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Update the human readable version of the version information to indicate
that raspi-config may be used to change the release type.
raspi-config can be replaced with other program names if necessary.
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>
Change default FIRMWARE_RELEASE_STATUS variable to 'default' rather
than 'critical'.
Update the built in help for new release names which align the
rpi-eeprom release names with raspi-config documentation.
Always use the current EEPROM configuration unless there is an
update pending in which case use that to support incremental edits.
Update help and update message to indicate that
'sudo rpi-eeprom-update -r'
may be used to cancel a pending update.
Fix a few comments