| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Without that fix, the file being created isn't deleted at the end of
the test, so over time the leftover files accumulate in /tmp.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Without that fix, the file being created isn't deleted at the end of
the test, so over time the leftover files accumulate in /tmp.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without that fix, we don't ship any of the python test programs:
$ make dist
$ tar tf libsamsung-ipc-0.7.0.tar.xz | grep "\.py$"
so 'make check' fail with the following error when building from a
tarball:
make[4]: Leaving directory
'/tmp/libsamsung-ipc/libsamsung-ipc-0.7.0/samsung-ipc/tests'
fatal: making test-suite.log: failed to create libsamsung-ipc-test.trs
fatal: making test-suite.log: failed to create libsamsung-ipc-test.log
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without that fix, nv_data-imei compiles fine in git, but if we build
from a tarball, nv_data-imei.h is missing from the tarball:
$ make dist
$ tar tf libsamsung-ipc-0.7.0.tar.xz | grep "ipc-modem.*\.[ch]"
libsamsung-ipc-0.7.0/tools/ipc-modem/ipc-modem-sms.c
libsamsung-ipc-0.7.0/tools/ipc-modem/ipc-modem-log.c
libsamsung-ipc-0.7.0/tools/ipc-modem/ipc-modem.c
libsamsung-ipc-0.7.0/tools/ipc-modem/tests/ipc-modem-sms-test.c
libsamsung-ipc-0.7.0/tools/ipc-modem/tests/ipc-modem-sms-fuzz.c
which then results in a compilation failure:
ipc-modem-log.c:28:10: fatal error: ipc-modem-log.h:
No such file or directory
28 | #include "ipc-modem-log.h"
| ^~~~~~~~~~~~~~~~~
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without that fix, nv_data-imei compiles fine in git, but if we build
from a tarball, nv_data-imei.h is missing from the tarball:
$ make dist
$ tar tf libsamsung-ipc-0.7.0.tar.xz | grep nv_data-imei
libsamsung-ipc-0.7.0/tools/nv_data-imei.c
which then results in a compilation failure:
CC nv_data-imei.o
nv_data-imei.c:39:10: fatal error: nv_data-imei.h:
No such file or directory
39 | #include "nv_data-imei.h"
| ^~~~~~~~~~~~~~~~
compilation terminated.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The CFLAGS that are in the %common-strict-cflags in scripts/guix.scm
have been validated with both GCC and CLANG and they are useful to
find potential issues in the code or code that won't compile on
Android.
However while the scripts/guix.scm script is really useful to test
commits once they are ready, it is less convenient to use it when
fixing issues in commits that are still being worked on.
This is because it is not as fast as building libsamsung-ipc directly
because:
- it requires a clean source directory to work (this can be done with
make distclean) so we can't reuse the current build output
- libsamsung-ipc source code is copied and built 5 times (in different
configurations)
As for the implementation, AM_CFLAGS was used instead of appending to
the default CFLAGS as CFLAGS is meant to be a variable for users. The
effect is that both are independent, so if users don't want strict
CFLAGS, they would need to not use --enable-strict-cflags.
And it was implemented as a shell script to at the same time:
- Enable to have comments, and good formating of the flags.
- Enable to share the cflags between guix.scm and the autotools.
- Keep the complexity low to keep it working in most situations.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
| |
If the following fails:
data.client = ipc_client_create(IPC_CLIENT_TYPE_DUMMY);
then we cannot use ipc_modem_log, but we can use printf instead.
This bug was introduced in commit aa738074f34c ("tools: ipc-modem:
convert to sysexits.h").
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without that fix, when running the following commands:
$ cd tools
$ makepkg
we have:
../../../tools/nv_data-imei.c: In function ‘write_imei’:
../../../tools/nv_data-imei.c:769:9: warning:
ignoring return value of ‘asprintf’
declared with attribute ‘warn_unused_result’ [-Wunused-result]
769 | asprintf(&md5_path, "%s.md5", nv_data_path);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
| |
This handles documented return codes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
| |
CURLU_ALLOW_SPACE is available since curl 7.78.0, and not using it
could enable us to be compatible with curl 7.62.0.
Since Replicant 11 has curl 7.67.0, this should enable to run
https-send-sms on Replicant 11.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This can then be used during automatic tests, but the downside is that
for now this tool only works with one provider.
The following symbols from (lib)curl (along with their corresponding
minimal (lib)curl version) have been used:
+------------------------+---------------------------+
| curl symbols | minimum (lib)curl version |
+------------------------+---------------------------+
| CURL_HTTP_VERSION_2TLS | 7.47.0 |
| CURLUPART_URL | 7.62.0 |
| CURLUPART_QUERY | 7.62.0 |
| CURLU_URLENCODE | 7.62.0 |
| CURLU_APPENDQUERY | 7.62.0 |
| CURLU | 7.62.0 |
| CURLU_ALLOW_SPACE | 7.78.0 |
+------------------------+---------------------------+
So we need to depend on curl 7.78.0.
And we currently have the following curl version:
+----------------------------+--------------------+------------+
| Distribution | (lib)curl version | Compatible |
+----------------------------+--------------------+------------+
| Replicant 4.2 | Doesn't have curl | No |
| Guix 6b9105e557 | 7.28.1 | No |
| Trisquel 7 x86_64 | 7.35.0-1ubuntu2.20 | No |
| Replicant 6 | 7.43.0 | No |
| Debian stretch x86_64 | 7.52.1-5+deb9u10 | No |
| Replicant 11 | 7.67.0 | No |
| Parabola i686 (07/04/2022) | 7.79.0-3.0 | Yes |
| Guix i686 (07/04/2022) | 7.79.1 | Yes |
+----------------------------+--------------------+------------+
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
| |
This has several advantages:
- This makes the code cleaner as we now have a more abstract logging
and less code in the main c file.
- If new files are added, this will enable to use logging functions in
the new files.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
| |
This enables to then split ipc-modem in several files in a clean way.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This enables contributors to run Valgrind when running 'make check'
for instance before sending patches.
The --enable-valgrind option was used instead of using
--enable-checking=valgrind like GCC uses as the code for that is much
easier to get right.
As Valgrind is very slow, I had to increase the timeouts in the
ipc-modem tests. For now I settled on 60 seconds to have some margin
for machines or setups that are potentially slower than the one I use.
For the guix.scm, with Guix 1.3.0, Valgrind needs the ld.so .symtab to
work, so as Valgrind doesn't know where to find them, so we had to use
--extra-debuginfo-path for that.
This is also why we pass '-v' to valgrind as it prints message
explaining the issue when it doesn't find the required symbols.
And we also needed a trick mentioned in the Guix mailing list[1] to
find the right path for the debug information as the glibc being used
by packages isn't exported publicly.
[1]https://lists.gnu.org/archive/html/help-guix/2022-03/msg00036.html
The proper fix will be merged in the next Guix release (merging it now
is not possible since it would require to rebuild everything, and that
is only possible with new releases).
A temporary workaround with 4d1a88312cbebb10d47905d6d023953ac85bcd04
(gnu: valgrind: Allow ld.so symbols to be found.) was also merged in
the current Guix so it is possible to get it with guix pull, but here
it's probably better to stick with a workaround in the guix.scm for
now as this also enables to use older guix revisions for testing.
Thanks to the people on #guix on Liberachat for helping me to solve
this Valgrind issue.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without that fix with --call= it picks an empty string as the number:
$ ipc-modem --debug --dry-run start --call=
CC ipc-modem.o
CCLD ipc-modem
[I] Got call number!
[I] Debug enabled
[I] dry-run mode
[1] Starting dummy modem_read_loop on FMT client
[I] modem_dummy_read_loop: looping
[...]
and with --call start, it things that "start" is the number and fails
because the "start" command is not found:
$ ipc-modem --debug --dry-run --call start
make: Nothing to be done for 'all'.
[I] Got call number!
Error: No command given. You need to use a command.
See the help below for more details.
usage: ipc-modem <command>
commands:
boot boot modem only
power-on power on the modem only
power-off power off the modem only
start boot modem and start read loop
arguments:
--call=[NUMBER] call NUMBER
--debug enable debug messages
--dry-run Test the ipc-modem program without talking to the modem.
--help print this help message
--pin=[PIN] provide SIM card PIN
With this fix it handles both situation by printing the right error:
$ipc-modem --debug --dry-run start --call=
make: Nothing to be done for 'all'.
[E] Missing call number
$ make ; ./ipc-modem --debug --dry-run --call start
make: Nothing to be done for 'all'.
[E] Missing call number
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Using sysexits.h helps making testing easier by differentiating
between different types of errors.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
| |
This makes the code easier to read as the command line parsing
code is quite big, and now it's not mixed in the main function
anymore.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Since we now have a private struct for all the data we need, we don't
need to use global variables anymore.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Since we now have a private struct for all the data we need, we don't
need to use global variables anymore.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Since we now have a private struct for all the data we need, we don't
need to use global variables anymore.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Since we now have a private struct for all the data we need, we don't
need to use global variables anymore.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Since we now have a private struct for all the data we need, we don't
need to use global variables anymore.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Since we now have a private struct for all the data we need, we don't
need to use global variables anymore.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Since we now have a private struct for all the data we need, we don't
need to use global variables anymore.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Having everything needed in the same struct will simplify the code
later on as we could also move the global variables there as well.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is ongoing work to make libsamsung-ipc and the modem drivers of
the Galaxy SIII (GT-I9300) work on top of an upstream kernel instead
of kernels derived from the vendor kernels.
For that work it's convenient to be able to store the kernel the
kernel logs in systemd-journald along with the output of ipc-modem.
If the kernel is built with CONFIG_LOCALVERSION_AUTO, we can track the
exact kernel revision used. And if the modem driver crashed, we can
still have the logs in journald at the next reboot. It also enables us
to store logs over a long period of time and get back to old logs.
However when running ipc-modem through a systemd service unit, the
output is piped to systemd, and we only get the following output with
journalctl -u <service> .service:
Started [Service Unit Description].
This is because when a program is piped, line buffering changes from
line buffered (the default when outputing to stdout on a terminal
according to setbuf(3)) to fully buffered.
To fix that we add a syslog log-target. Several programs already have
a --syslog (like OpenVPN) or --log-target= (like PulseAudio) command
line argument.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
| |
This enables to add other log callbacks than printf / stdout later on.
The ipc_modem_log function is inspired from ipc_client_log.
This change should contain no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no use in making multiple calls to printf when only one call
is sufficient.
It's also a good practice to do that in general, especially when part
of the code can print to the console at any time, to ensure that that
all the buffer is printed contiguously and not interleaved with other
prints.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
| |
This enables to add more definitions later and to also add functions
prototypes there.
This change contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
This makes the code more readable. It should contain no functional
changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
This ensures that the content of theses arrays cannot be changed at
runtime.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without that fix, we have the following warnings on Replicant 6.0:
hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:245:2:
warning: missing initializer for field 'option' of 'struct
command_option' [-Wmissing-field-initializers]
{ /* Sentinel */ },
^
In file included from
hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:39:0:
hardware/replicant/libsamsung-ipc/tools/nv_data-imei.h:65:10:
note: 'option' declared here
uint8_t option;
^
hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:277:2:
warning: missing initializer for field 'name' of 'struct command'
[-Wmissing-field-initializers]
{ /* Sentinel */ },
^
In file included from
hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:39:0:
hardware/replicant/libsamsung-ipc/tools/nv_data-imei.h:57:14:
note: 'name' declared here
const char *name;
^
Note that even if the code isn't valid C17 code, the warning is
harmless since the arrays of struct is declared outside functions
(static storage duration), so the "Sentinel" will be filled with zeros
anyway.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without that fix we have compilation errors:
nv_data-imei.c: In function ‘get_imei’:
nv_data-imei.c:181:12: error: format ‘%d’ expects argument of type
‘int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’}
[-Werror=format=]
181 | printf("In addition it is also invalid"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
184 | len, IMEI_LENGTH);
| ~~~
| |
| size_t {aka long unsigned int}
nv_data-imei.c:183:14: note: format string is defined here
183 | "%d digits instead of %d.\n",
| ~^
| |
| int
| %ld
nv_data-imei.c:193:12: error: format ‘%d’ expects argument of type
‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’}
[-Werror=format=]
193 | printf("The '%s' "
| ^~~~~~~~~~~
......
196 | imei->optarg, len, IMEI_LENGTH);
| ~~~
| |
| size_t {aka long unsigned int}
nv_data-imei.c:195:14: note: format string is defined here
195 | "%d digits instead of %d.\n",
| ~^
| |
| int
| %ld
This issue was introduced in commit
1cd1a569bef21ed3bfaeda15fb210ef6fd218152 (tools: Add a new
nv_data-imei tool based on rfs-imei)
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running the tests in an out of tree build directory (here in
scripts/src/), without that fix, we have the following error in
src/samsung-ipc/tests/test-suite.log when running 'make check':
FAIL: nv_data-md5
=================
Traceback (most recent call last):
File "[...]/scripts/src/tools/../../../tools/nv_data-md5.py", line 69, in <module>
rc = main()
File "[...]/scripts/src/tools/../../../tools/nv_data-md5.py", line 64, in main
nv_data_md5 = NvDataMD5()
File "[...]/scripts/src/tools/../../../tools/nv_data-md5.py", line 39, in __init__
self.nv_data_md5 = sh.Command(srcdir + os.sep + 'nv_data-md5')
File "/usr/lib/python3.9/site-packages/sh.py", line 1342, in __init__
raise CommandNotFound(path)
sh.CommandNotFound: ../../../tools/nv_data-md5
FAIL nv_data-md5.py (exit status: 1)
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running the tests in an out of tree build directory (here in
scripts/src/), without that fix, we have the following error in
src/samsung-ipc/tests/test-suite.log when running 'make check':
FAIL: nv_data-imei
==================
Traceback (most recent call last):
File "[...]/scripts/src/tools/../../../tools/nv_data-imei.py", line 122, in <module>
rc = main()
File "[...]/scripts/src/tools/../../../tools/nv_data-imei.py", line 117, in main
nv_data_imei = NvDataImei()
File "[...]/scripts/src/tools/../../../tools/nv_data-imei.py", line 53, in __init__
self.nv_data_imei = sh.Command(srcdir + os.sep + 'nv_data-imei')
File "/usr/lib/python3.9/site-packages/sh.py", line 1342, in __init__
raise CommandNotFound(path)
sh.CommandNotFound: ../../../tools/nv_data-imei
FAIL nv_data-imei.py (exit status: 1)
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running the tests in an out of tree build directory (here in
scripts/src/), without that fix, we have the following error in
src/samsung-ipc/tests/test-suite.log when running 'make check':
FAIL: ipc-modem
===============
Traceback (most recent call last):
File "[...]/scripts/src/tools/../../../tools/ipc-modem.py", line 79, in <module>
rc = main()
File "[...]/scripts/src/tools/../../../tools/ipc-modem.py", line 74, in main
ipc_modem = IpcModem()
File "[...]/scripts/src/tools/../../../tools/ipc-modem.py", line 39, in __init__
ipc_modem = sh.Command(srcdir + os.sep + 'ipc-modem')
File "/usr/lib/python3.9/site-packages/sh.py", line 1342, in __init__
raise CommandNotFound(path)
sh.CommandNotFound: ../../../tools/ipc-modem
FAIL ipc-modem.py (exit status: 1)
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having a code style makes the code easier to read.
As for which code style to use, the code style defined by the
PEP 8 [1] is used in the python standard library and in the main
Python distribution.
Its official nature (it's standardized by python) probably makes it
the most well known and used code style adopted by python programmers.
In it we have a section about string quotes:
String Quotes
-------------
In Python, single-quoted strings and double-quoted strings are the
same. This PEP does not make a recommendation for this. Pick a rule
and stick to it. When a string contains single or double quote
characters, however, use the other one to avoid backslashes in the
string. It improves readability.
For triple-quoted strings, always use double quote characters to be
consistent with the docstring convention in PEP 257.
Since "if __name__ == '__main__':" is widely used, we choose to use the
single quotes.
[1]https://www.python.org/dev/peps/pep-0008/
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
While the tests don't talk to a real modem, they are still useful
to detect regressions with the use of threads.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
| |
This enables to test things like the threads usage without the
need for a real modem implementing the samsung-ipc protocol. This
could for instance be used in libsamsung-ipc automated tests.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
As this is done once all options have been parsed,
it enables to only print some options when debug is on.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
| |
This enables to more easily enables to share the parsed command
line arguments across different functions and it also enables
to add new command line arguments more easily.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without that fix, if some arguments were set and no
command was given, ipc-modem would proceed anyway:
$ ./tools/ipc-modem --debug
[I] Debug enabled
[...]
As it's expected to at least be used with a command
to do something meaningful, without that fix, it
could misslead users into thinking that everything
is fine when it's not or vice versa.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
| |
This makes the code easier to read as we separate the command line
handling from the IPC code.
In addition it also enables to more easily add RFS support later
on as the IPC code is not mixed with command line handling.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
While --help is parsed in the command line, it wasn't described
in the help itself.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
| |
The help and the code is sorted alphabetically.
It should contain no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When compiling nv-data-md5 under Replicant 6 we have:
hardware/replicant/libsamsung-ipc/tools/nv_data-md5.c:
In function 'main':
hardware/replicant/libsamsung-ipc/tools/nv_data-md5.c:103:1:
error:
control reaches end of non-void function [-Werror=return-type]
}
^
cc1: some warnings being treated as errors
So we simply need to add a return in the error path.
While we're at it, we use an exit code referenced in sysexits.h
to follow a standard. This can help differentiating between
different types of errors.
Thanks to that, it can also simplify the code when writing tests.
As Android doesn't have sysexits.h, we also need to use the one that
has been copied inside libsamsung-ipc in tools/include/glibc, else
it would also fail to compile because of the missing header file.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|