Commit graph

107 commits

Author SHA1 Message Date
Caleb Connolly
9e3b3700d1
gitlab-ci: shellcheck ttyescape (MR 2309)
[ci:skip-build] already built successfully in CI
2021-08-09 23:57:24 -07:00
Clayton Craft
274dbe9fbb
ci/testcases: check for nftables support in kernels used by main & community devices (MR 2366) 2021-07-23 16:45:28 -07:00
Alexey Minnekhanov
13c34b9793
CI: test for cross-compilers in makedepends (MR 2272)
Related: #1128

[ci:skip-build] Will not finish in 3h on CI. Builds locally.
2021-06-25 18:43:00 +03:00
Alexey Minnekhanov
33c62a1f58
CI: fix broken test_aports_kernel (MR 2272)
Missing '/' in aports path will make glob below invalid.
It will find 0 files and thus effectively skip all tests.
Construct full path using f-strings.

Double '/' in path that can be there if args.aports ends
with slash is harmless.
2021-06-25 18:42:11 +03:00
Jakob Hauser
e6b0103b8c
main/swclock-offset: new package (MR 2191)
Some devices have a working but non-writable real-time clock (RTC).
This package contains two shell scripts: One writes the offset between
'hwclock' and 'swclock' to a file at shutdown, another one reads the
offset from the file at boot and sets the 'swclock'. This way the system
time in userspace is kept in present time.

[ci:skip-build] already built successfully in CI
2021-06-08 19:45:11 -07:00
Caleb Connolly
5e5d23959b
CI: make sure devices that support kernel updates install the script (MR 2215)
To prevent accidental bricks, postmarketos-update-kernel is not
installed by default. If it works for your device and you've added the
deviceinfo variable, you also need to depend on the package for the
updates to actually happen.

[ci:skip-build] already built successfully in CI
2021-06-08 10:44:42 -07:00
Bart Ribbers
0dfc3da218
CI: remove obsolete directories from test_directory_structure 2021-04-16 10:46:00 +02:00
Clayton Craft
17720fa870
gitlab-ci: disable ccache when building changed aports (MR 2020)
This disables ccache in the CI when building packages. I think ccache is
not necessary since the CI will never build a package twice in the same
pipeline, and ccache dir is not preserved for use between pipelines.
There is a real time cost to compiling with ccache enabled on the
initial compile (compressing objects for cache, etc), and some testing
with building the linux-purism-librem5 kernel in the CI shows this cost
can be significant... ~160 minutes when ccache is enabled vs ~105
minutes when it is disabled with this patch.

kernel compile CI runs referenced:
https://gitlab.com/postmarketOS/pmaports/-/jobs/1087602863
https://gitlab.com/postmarketOS/pmaports/-/jobs/1087956999

Some testing on my laptop using osk-sdl with and without ccache for
initial compile:

ccache disabled:
$ rm _build -r && CCACHE_DISABLE=1 meson _build >/dev/null && CCACHE_DISABLE=1 time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
7.76
$ rm _build -r && CCACHE_DISABLE=1 meson _build >/dev/null && CCACHE_DISABLE=1 time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
7.89
$ rm _build -r && CCACHE_DISABLE=1 meson _build >/dev/null && CCACHE_DISABLE=1 time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
7.71

ccache enabled:
$ rm /tmp/ccache _build -r && CCACHE_DIR=/tmp/ccache meson _build >/dev/null&& CCACHE_DIR=/tmp/ccache time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
8.62
$ rm /tmp/ccache _build -r && CCACHE_DIR=/tmp/ccache meson _build >/dev/null&& CCACHE_DIR=/tmp/ccache time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
8.46
$ rm /tmp/ccache _build -r && CCACHE_DIR=/tmp/ccache meson _build >/dev/null&& CCACHE_DIR=/tmp/ccache time meson compile -C _build
ninja: Entering directory `_build'
[10/10] Linking target osk-sdl
8.54
2021-03-11 19:40:43 +01:00
Jonathan Bakker
1018a95ddd
CI: Add non-free as an expected directory APKBUILDs (MR 1868)
We may wish to distribute some files that are explicitly
non-free, and it makes sense to place them in a separate
non-free directory rather than in main.
2021-02-23 22:10:07 +01:00
Minecrell
b7d90580b3
Introduce support for "unmaintained" devices (MR 1912)
Unmaintained devices are device packages that:
  - Are known to be broken in some way without an active maintainer
    who can investigate how to fix it, or
  - Have not received any updates for a very long time, or
  - Are discouraged from using because they are just intended for testing.
    An example for this are ports using the downstream kernel for devices
    which have a mainline port that is working quite well.

Unmaintained devices are still built by bpo (otherwise it would not make
sense to keep them), but they do not show up in "pmbootstrap init".
However, it is possible to manually select them by entering the name.
pmbootstrap will warn in that case.

Unmaintained packages should have a # Unmaintained: <reason> comment
in the APKBUILD, this comment is displayed in "pmbootstrap init"
so that the user knows why the device should not be used unless they
know what they are doing.
2021-02-15 23:24:06 +01:00
Minecrell
f2acd86a08
CI: Check that devices in main/community have necessary maintainers (MR 1912)
Devices in
  - main should have >= 2 maintainers
  - community should have at least one maintainer

Use the new functions in pmbootstrap to ensure that.
2021-02-15 23:24:01 +01:00
Sebastià Serra Rigo
962a64697d
CI: Change test file names to remove redundant aports. (MR 1938)
In this git repository, everything is about aports, this distinction was only
useful back in the day when pmbootstrap and pmaports were in the same git
repository.
2021-02-13 22:02:51 +01:00
Sebastià Serra Rigo
e86ac9a493
CI: Extracted args pytest fixture to a different file (MR 1938) 2021-02-13 22:02:51 +01:00
Sebastià Serra Rigo
6a31acecfe
CI: Moved test outside the file containing all pmaports tests (MR 1938) 2021-02-13 22:02:51 +01:00
Oliver Smith
45657e430c
CI: bump copyright to 2021 2021-01-08 00:16:08 +01:00
clayton craft
5298584f14
gitlab-ci: remove shellcheck for elogind-system-suspend hook (MR 1825) 2020-12-28 00:36:53 +01:00
Oliver Smith
0105a1d8ef
main/postmarketos-base: put full path in filenames (MR 1713)
Refactor the install code to be generic, so we only need to add the new
path in one place when adding a new file. Put the full path into the
filename to make this possible.

I've tried to mimic the final directory structure in the aport first
(e.g. $pkgdir/sbin/swapfile -> main/postmarketos-base/sbin/swapfile),
but that leads to conflicts as abuild only takes the filename for
checksums (conflict with etc/conf.d/swapfile):
https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10013

We don't really need checksum verification for the files shipped in the
same directory (not downloaded), but nevertheless this is a bug. It
leads to confusing behavior and might be fixed by letting abuild demand
that there is only one source file with the same name, as I suggested in
the issue linked above. So let's avoid this altogether with the flat
file name.
2020-12-03 13:11:03 +01:00
Oliver Smith
4d6a1a2458
main/postmarketos-mvcfg: new package (MR 1713)
Add scripts to move configs from legacy packaging, as described at:
https://postmarketos.org/mvcfg
2020-12-03 13:10:58 +01:00
Oliver Smith
88ebc699f3
CI: unreferenced files: parse source from checksums (MR 1759)
postmarketos-base will soon build its source="" variable with a shell
function. Support this use case by not trying to parse source="" with
pmbootstrap anymore, but rather parsing the trivial sha512sums
variable.
2020-12-03 09:35:00 +03:00
Oliver Smith
52e1621408
CI: unreferenced files: be less verbose (MR 1759)
Don't print a message for each APKBUILD that is getting parsed. pytest
will display the stdout below the raised exception, so with the print
one had to scroll up a lot to find the actual error message. Now it is
printed at the bottom.
2020-12-03 09:35:00 +03:00
Oliver Smith
d6eb5dc5b2
CI: test_aports: use realpath for pmaports (MR 1759)
Do not print ".gitlab-ci/testcases/../../" in the paths to the
APKBUILDs.
2020-12-03 09:34:57 +03:00
Luca Weiss
f2a2764a35
CI: add check for unreferenced files in aports (MR 1731)
[ci:ignore-count] [ci:skip-vercheck] [ci:skip-build]
2020-11-18 11:24:19 +01:00
clayton craft
96c4ec84f5
gitlab ci: add pinephone elogind hook script to shellcheck (MR 1665) 2020-11-13 00:33:31 -08:00
Oliver Smith
3731ba09ea
CI: build_changed_aports: fix checksum for 0 pkgs (MR 1705)
When using '[ci:skip-build]' without any changed packages, do not
attempt to run "pmbootstrap checksum" without any package arguments.
This may happen, because CI in MRs runs across all patches in the MR,
but CI on branches (master, v20.05) only run on the last commit.

Prevents CI failures like this one:
9a48b41a23
2020-11-11 22:49:10 +03:00
Bhushan Shah
378904d076
device-pine64-pinephone: remove the elogind hook (MR 1651)
musb_hrdc bug is fixed properly with kernel patch, so we do not need to
do this bind/unbind dance anymore.

This partially reverts commit f7d743a213.
2020-10-27 13:58:34 +05:30
clayton craft
3c8943148c
gitlab ci: add pinephone elogind hook script to shellcheck (MR 1636) 2020-10-25 11:17:34 -07:00
Miles Alan
5aff6dfaa4
Add sxmo/ as an expected directory for gitlab CI directory structure testcase (MR 1472) 2020-09-14 09:37:24 +02:00
Oliver Smith
e5b8b8631f
CI: build packages on all arches (MR 802)
Split the aports-build job into arch-specific build-x86_64,
build-aarch64, ... jobs. Extend build_changed_aports.py to accept the
architecture as argument, and to build all packages for that arch where
possible.

Import and use pmbootstrap code for APKBUILD parsing etc, as we do this
already in various testcases running in this repository.

Co-Authored-By: Bart Ribbers <bribbers@disroot.org>
2020-09-10 22:22:57 -07:00
Oliver Smith
a5b75f3072
CI: remove unused common.check_build() (MR 802)
The function is also present in build_changed_aports.py, and it is only
used there.
2020-09-10 22:22:55 -07:00
Oliver Smith
67c0e167d2
CI: add_pmbootstrap_to_import_path: add import (MR 802)
Fix error on my machine:
	AttributeError: module 'importlib' has no attribute 'util'
2020-09-10 22:22:47 -07:00
Oliver Smith
cedd5331e5
CI: test_aports_ui: don't take arches from binary (MR 1508)
Verify _pmb_recommends for architectures listed in the APKBUILD of
postmarketos-ui-* packages, not from their binary packages. Otherwise
disabling an architecture in a merge request will not be respected, as
the binary package still has the arch enabled.
2020-08-28 12:28:05 +02:00
Dolphin von Chips
178558cb3d
CI: allow running testcases with pmbootstrap from pip (MR 1467) 2020-08-15 20:39:29 +02:00
Dolphin von Chips
2bfb1417f7
CI: check if packages in _pmb_recommends exist (MR 1467) 2020-08-15 20:39:24 +02:00
Oliver Smith
e1a3324e5a
hybris: remove
Libhybris is failing to build for armhf too. Instead of adding !armhf
everywhere, let's just remove it: as it became clear in #703, nobody is
willing to put in the effort to maintain this properly.

If you would like to continue with libhybris on postmarketOS, please
create your own aports repository and put the aports there.

Related: https://wiki.postmarketos.org/wiki/Hybris
Closes: #703, #700, #678
2020-08-03 10:16:10 +02:00
Oliver Smith
3e012e3714
CI: test_directory_structure: mention firmware mv (MR 1362)
Instead of encouraging the user to add the directory to
test_directory_structure.py, mention that we just moved the firmware to
device/{main,community,testing}/. This will be more helpful for users
who get the message after rebasing on master.

In the rare case that we need to change the directory structure, we will
figure out which file to edit.

[ci skip]: various firmware packages fail when built at the same time
           (they use generic source files like "bcmdhd.cal" with different checksums)
2020-07-07 16:06:02 +02:00
Minecrell
c590ed74cf
firmware/*: move rest of firmware packages to device/testing (MR 1362)
After moving the firmware packages used by devices in community to
device/community, move the rest of the firmware packages to device/testing.
2020-07-07 16:05:58 +02:00
Oliver Smith
24b83e2415
CI: use check_mr_settings.py from ci-common.git (MR 1320) 2020-06-17 16:29:34 +02:00
Oliver Smith
f415d413c5
CI: support release channels (v20.05 branch) (MR 1321)
Add common.get_upstream_branch() and use it instead of assuming "master"
as upstream branch.

Example: user forks v20.05 to v20.05_some-fix, then creates a merge
request. CI must use v20.05 as upstream branch, when comparing for
modified files etc.
2020-06-17 16:26:38 +02:00
Oliver Smith
4d116177ac
CI: common.py: add cache (MR 1321)
Don't query the pmaports dir more than once. This cache will also be
used to store the upstream branch in the next commit.
2020-06-17 16:26:38 +02:00
Antoine Fontaine
11b60e838b
ci: check for executable files (MR 1257)
fix https://gitlab.com/postmarketOS/pmaports/-/issues/593.
2020-05-23 17:40:00 +02:00
Antoine Fontaine
307f4f19e6
ci: check that kernels have pmb:cross-native enabled (MR 1247)
follow up to
https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1910,
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1169 and
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1187.

Fixing the repo is good, but keeping it clean is better. Ensuring it
before merge will avoid yet another fixup commit.
2020-05-21 07:29:16 +03:00
Anjandev Momi
bcfdb0f914
CI: check for pkgrel=0 in new aports (MR 1211)
closes #573
2020-05-13 14:37:09 +03:00
Daniele Debernardi
5ead73e86c
CI: use pmbootstrap lint for checking packages (MR 1132) 2020-04-18 11:50:02 +02:00
Daniele Debernardi
233ec0d21c
CI: return output of common.run_pmbootstrap (MR 1132) 2020-04-18 11:49:57 +02:00
Oliver Smith
8f79b6f5b2
CI: use install-pmbootstrap.sh from ci-common repo (MR 1147)
This script is used by multiple repositories by now, let's make sure we
only have one place where we need to maintain it. The version in
ci-common is shellchecked and displays less output for 'pmbootstrap
init' again (unless it fails, then it shows the whole log).
2020-04-14 00:43:44 +02:00
Oliver Smith
23c58a681f
main/postmarketos-mkinitfs: modules from files (!1123)
Read kernel module names from files in
/etc/postmarketos-mkinitfs/modules and print out which modules are
required by which of these files as the initramfs gets generated. Put
the default modules into a new 00-default.modules. This allows mkinitfs
hooks to add modules to the initramfs.

Parse the modules from a file similar to modules-load.d, with commented
lines and empty lines ignored. Add a simple test script for that and run
it in check().
2020-04-12 00:56:22 +02:00
Oliver Smith
3e7604601a
main/postmarketos-mkinitfs: split mkinitfs funcs (!1123)
Split mkinitfs.sh into two files, so the functions (now in
mkinitfs_functions.sh) can be sourced in a test. Such a test will be
added in the next commit.

Move $BINARIES_EXTRA into the get_binaries_extra() function, so its
$(find...) does not get executed when sourcing the functions file. Move
$BINARIES into get_binaries() too for consistency.
2020-04-12 00:56:22 +02:00
Oliver Smith
74f42ebeb0
main/postmarketos-mkinitfs: pass shellcheck (!1123)
Make it pass shellcheck by fixing obvious mistakes like '==' instead of
'='. Add "shellcheck disable" lines for things that are intentionally done
or would be a bit more complicated to rewrite. It would be nice to
refactor some things like '${outfile/initramfs-/uImage-}', but this should
be done in a separate change (patches welcome).

Remove unused variable "modules_path". While at it, add two new fatal
error messages instead of just "exit 1" without any comment and remove
redundant mkdir in APKBUILD.
2020-04-12 00:56:17 +02:00
Minecrell
69efae2e0b
CI: test_directory_structure: Allow device/{community,main} (!1121) 2020-04-11 15:47:49 +02:00
Minecrell
0ffb448de4
CI: common: fixup get_changed_packages() (!1069)
At the moment the function does not handle all cases correctly.
For example, it cannot say which package was changed when a file
in a subdirectory of a package was changed.

This is used e.g. in device-samsung-golden:

    device-samsung-golden
    ├── APKBUILD
    ├── deviceinfo
    ├── downstream
    │   ├── init-usb-hook.sh
    │   ├── module-config.conf
    │   └── modules-load.conf
    └── kwin.sh

At the moment, changing a file under "downstream" would attempt
building a "downstream" package, instead of device-samsung-golden.

Refactor the function a bit to walk up the directory hierarchy,
until we find an APKBUILD.
2020-03-21 22:32:48 +01:00