Commit Graph
93 Commits
Author SHA1 Message Date
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:
https://gitlab.com/postmarketOS/pmaports/-/commit/9a48b41a2362ba0dd2b0901cae966011b37d1856
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 SmithandBart Ribbers 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
Minecrell ae4931816b CI: apkbuild-linting: use get_changed_files() instead of get_changed_packages() (!1069)
For APKBUILD linting we care only about APKBUILD files that were changed,
not to which package they belong or whatever.

The "with_directory" option of get_changed_packages() really meant
"just give me changed files", which means that we can just use
get_changed_files() instead.
2020-03-21 22:32:48 +01:00
Minecrell 87e1b9f0b5 CI: common: get_changed_files: return set, add "removed" parameter (!1069)
All users of get_changed_files() check if the file was removed,
so it seems like most of them do not need files that were removed.

Also, there is no need to have files listed twice,
so we should return a set instead of a list.
2020-03-21 22:32:48 +01:00
Oliver Smith e87f2ec27b CI: test_directory_structure.py: fix flake8 (!1069)
It seems that the .gitlab-ci.yml did not trigger properly when the file
was changed last time, and now it does in this MR. Fix the file to make
it pass.
2020-03-21 22:31:57 +01:00
Oliver Smith 0e5ba649a5 CI: remove upstream compatibility checks (!1085)
Do not run upstream compatibility checks whenever pushing to master.
This is confusing, because if the upstream compatibility check fails,
then it appears that the last patch was broken in some way although it
isn't related.

I've moved the upstream compatibility checks to a separate repository
already, and added a badge to the pmaports gitlab project that indicates
whether they are currently succeding or not. The checks run hourly now.

Related: https://gitlab.com/postmarketOS/monitoring
Fixes: #457
2020-03-21 18:21:16 +01:00
Minecrell 01e064c733 CI: add tests to ensure directory structure stays clean (!1070)
pmbootstrap now allows APKBUILDs in arbitrarily nested directories
within pmaports. This means that we really need some checks to ensure
APKBUILDs don't end up all over the place.

Add a test case with a whitelist of allowed directories.
Having this list in pmaports allows changing it without a new pmbootstrap
release.
2020-03-18 12:44:35 +00:00
Minecrell 796f2d097d CI: skip all dot folders for now (!1068)
At the moment we assume that all files except in /.* belong to
a package. Now that .shared-patches was moved to device/.shared-patches
that does not work correctly anymore.

This method should really check to which package the files belong
(e.g. walk up directories until it finds an APKBUILD) instead of
assuming they are directly in the same directory as the APKBUILD.

For now just ignore **/.* (i.e. all files in dot folders),
to unblock the MR since it's a critical fix.
2020-03-15 16:24:28 +03:00
Minecrell 2bfba9106a CI: update for device/* -> device/testing/* move (!1067) 2020-03-14 09:41:26 +01:00
Oliver Smith 7c5f01d892 run_testcases.sh: adjust to new device structure (!1066)
Fix error:
ERROR: Could not find deviceinfo file for selected device
2020-03-14 09:12:57 +01:00
Oliver Smith 77e4902dfb CI: install_pmb: use git clone, not tarball (!980)
GitLab disabled downloads of tarballs currently, because it was being
exploited for DoS agains their infrastructure. Work around this by using
git clone for now. I've thought about using --depth=1, but that would
break the ability to choose different branches.

Related: https://status.gitlab.com
2020-02-22 21:46:49 +01:00
Minecrell f7a4fcc3e7 CI: stop verifying kernel subpackage names (!907)
At the moment we check that the kernel variants for a device package
match the suffix of an existing linux-postmarketos-<suffix> package.

However, in most cases the name of the kernel subpackage has nothing
to do with the actual kernel that is used:

  - the kernel subpackages usually have generic names like "mainline" or
    "downstream", which have nothing to do with the actual suffixes like
    "qcom-msm8916", "allwinner" or "novathor"

  - pine64-dontbeevil uses kernel subpackages to switch between
    "longts" and "shortts" device tree variants. Both are actually
    using linux-postmarketos-allwinner.

So far we have been whitelisting names like "longts" or "shortts",
but the check does not seem very useful overall.

Removing it fixes the following CI failure for MSM8916:
  RuntimeError: Invalid kernel subpackage name 'mainline-modem',
  valid: ['downstream', 'rpi', 'rpi2', 'longts', 'shortts', 'stable', 'mainline',
          'allwinner', 'qcom-msm8916', 'qcom-msm8974', 'novathor']
2020-02-16 12:48:00 +01:00
Daniele Debernardi 3c9c61eb48 CI: skip linting check for cross/ folder (!881) 2020-01-16 00:47:16 +01:00
Alexey Min c203ee697d CI: add new requirements for pmbootstrap
https://gitlab.com/postmarketOS/pmbootstrap/commit/02e514f4d375e8c6956df2a69b505adf6b7296da
added a new required program from host system: git
2020-01-12 15:46:10 +03:00
Bart Ribbers d6ea9107bd CI: fix linter checking non-APKBUILDs (!867)
Only check APKBUILD files
2020-01-10 02:23:54 +03:00
Bart Ribbers 7c31d47745 CI: skip linting check for temp/ folder (!864)
Since we copy these aports directly from Alpine and try to keep them in
sync, we don't want to differ from upstream because our CI doesn't pass
on linting. If the APKBUILD should be improved, it should be done
upstream which is then synced back to us.
2020-01-09 02:40:38 +03:00