aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* scripts: guix.scm: sync %commit definition with guix styleDenis 'GNUtoo' Carikli2023-02-141-3/+2
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the %commit definition with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: sync %local-source definition with guix styleDenis 'GNUtoo' Carikli2023-02-141-3/+2
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the %local-source definition with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: sync android-make definition with guix styleDenis 'GNUtoo' Carikli2023-02-141-35/+24
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the android-make definition with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: sync android-phases definition with guix styleDenis 'GNUtoo' Carikli2023-02-141-7/+10
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the android-phases definition with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: sync libsamsung-ipc with guix styleDenis 'GNUtoo' Carikli2023-02-141-1/+2
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the libsamsung-ipc package with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: sync libsamsung-ipc-gcc-android with guix styleDenis 'GNUtoo' Carikli2023-02-141-4/+4
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the libsamsung-ipc-gcc-android package with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: sync libsamsung-ipc-gcc-autotools with guix styleDenis 'GNUtoo' Carikli2023-02-141-13/+11
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the libsamsung-ipc-gcc-autotools package with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: sync libsamsung-ipc-clang-autotools with guix styleDenis 'GNUtoo' Carikli2023-02-141-10/+9
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the libsamsung-ipc-clang-autotools package with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: sync libsamsung-ipc-clang-android with guix styleDenis 'GNUtoo' Carikli2023-02-141-4/+4
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the libsamsung-ipc-clang-android package with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: sync package imports with guix styleDenis 'GNUtoo' Carikli2023-02-141-27/+27
| | | | | | | | | | | | The guix style command reformats a package or a file to use the code style used by Guix. This commits sync the package imports with the output produced by guix style. This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: libcurl is an input, not a native-inputDenis 'GNUtoo' Carikli2023-02-141-3/+1
| | | | | | | The https-send-sms tool is linked to libcurl, so libcurl is needed at runtime. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: Use new input styleDenis 'GNUtoo' Carikli2023-02-141-49/+35
| | | | | | This commit should contain no functional changes. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* python tests: use python3Denis 'GNUtoo' Carikli2022-08-251-6/+1
| | | | | | | | | | | | | Using python instead of python3 has several issues: - Distributions and users can choose python2 as their default python interpreter. For users this can be done by making a symlink in /usr/local for instance. - Guix doesn't have python but has python3 in the PATH. Changing to python3 makes tests work for Guix system users that use the scripts/manifest.scm file with guix shell / guix environment. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: fix whitespace issuesDenis 'GNUtoo' Carikli2022-08-251-18/+18
| | | | | | | Tabs were added by the commit 43983cdb532303224be896ec37e67fa515d87e3e ("Android.mk: fix missing files and build local-modules in guix.scm"). Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: PKGBUILD: use --enable-strict-cflagsDenis 'GNUtoo' Carikli2022-07-261-1/+1
| | | | | | | This should help us catch more issues as the PKGBUILD doesn't necessarily use the same compiler versions than in the guix.scm. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Android.mk: fix missing files and build local-modules in guix.scmDenis 'GNUtoo' Carikli2022-07-261-31/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the commit 5f97bb60091a1c4d4335fd02eff2b01e27e7a881 ("tools: ipc-modem: Move log functions in their own file"), we added new files for ipc-modem. That commit was then tested with scripts/guix.scm, which at the time didn't build ipc-modem, so the issue slipped through the automatic tests. So in addition of adding back these missing files in Android.mk, this commit also makes guix.scm actually build all the local modules. This was not done before as it required some extensive work. That work consisted in adding code to retrieve the LOCAL_MODULEs from the Android.mk, and passing that to the package build and install procedures (which had to be converted into Guix's G-Expressions (gexp)[1] to be able to more cleanly get that data). In addition, making contributions to android-make-stub was needed as well. Having some of the parsing done in the guix.scm file instead of android-make-stub is needed because otherwise the android-make-stub design would probably need to be redone: android-make-stub consists of some Makefiles that are passed to make via -f, and that in turn these Makefiles include the Android.mk in the local directory. This doesn't make it possible to handle dependencies cleanly, as to do that, the Android.mk would need to first be parsed through another mean to understand the dependencies tree, and then to build the local modules in order. And that would need to be done in some compatible way not to break existing users of android-make-stub (like Guix that builds some Android packages with it). [1]https://guix.gnu.org/en/manual/devel/en/guix.html#G_002dExpressions Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* configure.ac: Add an option to use scripts/guix.scm's strict CFLAGSDenis 'GNUtoo' Carikli2022-07-221-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* tools: Add tool to send SMS from a provider HTTPS interfaceDenis 'GNUtoo' Carikli2022-06-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Autotools: add support for Valgrind for checksDenis 'GNUtoo' Carikli2022-05-232-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* scripts: guix.scm: use --enable-debugDenis 'GNUtoo' Carikli2022-05-231-1/+7
| | | | | | | | Replicant 6.0 is currently the main project using libsamsung-ipc and it uses --enable-debug to show the hexadecimal dump of the samsung-ipc packets, so it's a good idea to do compilation tests with it. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: add -Werror=pedantic to detect Replicant 6.0 warningsDenis 'GNUtoo' Carikli2022-03-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without the commit 355433ab5f17f25ca202ec092d989b267fd78c19 (tools: nv_data_imei: get rid of missing initializer warning), we have the following warnings when building 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; ^ The addition of -Werror=pedantic in guix.scm enables to detect these as the build would then fail: CC nv_data-imei.o nv_data-imei.c:245:2: error: ISO C forbids empty initializer braces [-Werror=pedantic] 245 | { /* Sentinel */ }, | ^ nv_data-imei.c:277:2: error: ISO C forbids empty initializer braces [-Werror=pedantic] 277 | { /* Sentinel */ }, | ^ CC nv_data-md5.o Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Add tools to build all the last commitsDenis 'GNUtoo' Carikli2022-03-282-0/+183
| | | | | | | This makes it easier to build-test all the latest commits before sending patches or pushing patches. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Add PKGBUILDDenis 'GNUtoo' Carikli2022-01-241-0/+52
| | | | | | | The usage of this PKGBUILD is similar to the guix.scm file in the same directory: it can be used to test the build of the current source. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: Add manifest.scmDenis 'GNUtoo' Carikli2022-01-041-0/+48
| | | | | | | | | | | | | | | | | On Guix, if we have all the required dependencies installed, running ./autogen.sh && ./configure && make fails with the following error: CCLD libsamsung-ipc-test ld: /gnu/store/cm6wv72061h65lri2aqgwa8bvncls51h-openssl-1.1.1l/lib/libcrypto.so: undefined reference to `fstat@GLIBC_2.33' ld: /gnu/store/cm6wv72061h65lri2aqgwa8bvncls51h-openssl-1.1.1l/lib/libcrypto.so: undefined reference to `stat@GLIBC_2.33' The same command works when using guix shell or guix environment (still with all the dependencies). Having a manifest file in libsamsung-ipc will enable Guix system users to easily work on libsamsung-ipc without having to use trial and error to get a working setup. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Partitions: android: add tests for open_android_modem_partitionDenis 'GNUtoo' Carikli2021-03-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Libraries typically have a public API and some internal implementation of that API. In libsamsung-ipc, the public API is defined in the include/ directory from the top directory. When compiling and installing libsamsung-ipc, that include/ directory is installed as well. Anything that is not defined in include/ is not part of that public API. However here we need to precisely test functions that are not part of that public API: The open_android_modem_partition function being tested here is only used by the herolte device, and that device doesn't have a battery that is easily replaceable, so most Replicant contributors will not want to get that device. As currently all the non static symbols of libsamsung-ipc are exported and that open_android_modem_partition isn't static, we can simply link to libsamsung-ipc for now and use its internal headers to access the functions to test. If at some point, libsamsung-ipc only exports the symbols defined in include/ we would need to find other ways to run such tests, for instance by using test frameworks that take care of that or by compiling libsamsung-ipc source code into the test programs. Some of the code of the libsamsung-ipc-test utility was adapted from code from the nv_data-md5 utility (which is currently in tools/). Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: Add Replicant 6 TARGET_ERROR_FLAGSDenis 'GNUtoo' Carikli2021-02-101-5/+12
| | | | | | | | | | | | The TARGET_ERROR_FLAGS are available from build/core/config.mk in Replicant 6. -Werror=non-virtual-dtor was only added to CLANG because it fails to be recognized with GCC: cc1: error: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C [-Werror] Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: Add Replicant 6 COMMON_GLOBAL_CFLAGSDenis 'GNUtoo' Carikli2021-02-101-0/+3
| | | | | | | The COMMON_GLOBAL_CFLAGS are available from build/core/config.mk in Replicant 6. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: reorder CLFAGSDenis 'GNUtoo' Carikli2021-02-101-1/+8
| | | | | | This enables to more easily add new flags. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: use latest clangDenis 'GNUtoo' Carikli2021-02-101-2/+2
| | | | | | | | | | | | | | Without that, it will end up using clang-10 while we now have clang-11. This will make Guix build clang-10 which is time consuming. Instead by using the latest clang we can use binary packages (Guix calls that substitutes) of clang which speeds up the build of libsamsung-ipc a lot, since most of the time we don't need to build any dependencies. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Move guix.scm to scriptsDenis 'GNUtoo' Carikli2021-01-111-0/+215
| | | | | | | | | | | | | | | | | The scripts directory already has several scripts that are not needed to use libsamsung-ipc, but all of them are (or were) useful to work on patches for libsamsung-ipc. As this also applies to the guix.scm and that scheme is a scripting language, it would be more clear to have it moved in the scripts directory. In addition it could also make it more simple for distributions to not ship these files if they aren't interested in having them and/or if they only want files compatibles with the license currently used by libsamsung-ipc (GPLv2 or later). Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* check_code_style_conversion.py: also check files that are not the revision rangeDenis 'GNUtoo' Carikli2020-06-251-7/+10
| | | | | | | | | | | | | | | | | | | | This checks the files that aren't modified by any of the commits that are in the revision range. This is not completely failsafe as checkpatch.pl tend to check better what's touched by a patch, in the case of modifications that do not touch C code: - Checking for scripts/spelling.txt with checkpatch.pl -f doesn't raise any errors or warnings. - Checking the patch that adds scripts/spelling.txt raise a lot of warnings. However checkpatch.pl seem to find issues in C code regardless of whether the code is checked as part of individual files or as part of a patch. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* check_code_style_conversion.py: make sure we don't miss any filesDenis 'GNUtoo' Carikli2020-06-251-6/+28
| | | | | | | | | This adds an option to check if all the repository files were "converted" by checking if they all have been modified by a patch in the git revision range given. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Add a tool to help check the conversion to Linux code styleDenis 'GNUtoo' Carikli2020-06-251-0/+83
| | | | | | | | | | | | | | | | | | | When sending a patch for Linux, and running checkpatch.pl, you typically only need to check the patch with it. However since we're doing an initial conversion to the Linux code style, we also need to check all the content of the files as well, as otherwise the parts that are not being touched by the patches won't be checked at all. We also need to get it right, as otherwise running checkpatch.pl on subsequent patches could trigger some errors that would not come from the patches being checked, but that would instead come from previous code style errors, that were left unfixed. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Import checkpatch.pl from Linux v5.6 and configure it.Denis 'GNUtoo' Carikli2020-06-253-0/+8352
This will be used to check if the patches match Linux code style. The configuration is needed because otherwise the this tool has defaults parameters which are made for Linux. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>