The hardware platform was checked in the above code. Check the SoC
identifier here, instead of checking the hardware platform against the
command-line SoC identifier.
The arguments may include options, in which case the optind variable
contains the point where the program should continue reading arguments.
Start accepting directory names from the first non-option argument,
instead of the second argument.
The option character is being compared to -1, but this -1 is an integer.
With GCC 12.2.1 on aarch64 platforms, the 8-bit character is not
properly sign-extended to 32 bits. Store the option character as an
integer so it is properly sign-extended.
Further investigation is needed to determine whether this is an
optimization bug and what value the 8-bit signed -1 is equal to.
GCC is a bit picky on Alpine Linux and wants `-ljson-c` to be at the end
of the command-line arguments. Move it to the end so the tools can be
built with this requirement.
This is sometimes necessary on Linux, but some C libraries define it.
Only redefine O_SEARCH if it is not defined already, otherwise the
existing macro definition can be used.
This debugfs value outputs a number. Sensor configuration matches the
platform against a textual representation for this. Since the registry
generator doesn't convert between these, hardcode this in the example
command so it isn't broken.
The sensor registry is generated from the configuration on the vendor
partition. Add a registry generator so this registry can be generated,
even without access to the partition of a given device.