Commit graph

96 commits

Author SHA1 Message Date
Stefan Hansson
b29ebae96b
CI: rename "device/unmaintained" to "device/archived" (MR 5046) 2024-05-15 17:07:51 +02:00
Stefan Hansson
b15ff1601c
CI: fix deprecation warning (MR 5126)
Fixes this warning:

    warning: `ruff <path>` is deprecated. Use `ruff check <path>` instead:
2024-05-13 16:19:06 +02:00
Stefan Hansson
6a1f7a1623
CI: clarify which commit to put [ci:ignore-count] in (MR 5126)
I've seen confusion about this in the past where people would find it
unclear which commit to put this in.
2024-05-13 16:16:18 +02:00
Stefan Hansson
79b8de8483
CI: replace lots of print statements with a single one (MR 5126)
This way it's easier to edit the text.
2024-05-13 16:16:18 +02:00
Clayton Craft
86e913235c
ci: suggest setting PMBOOTSTRAP_CMD when unable to locate pmbootstrap.py (MR 5033)
When running locally, sometimes pmbootstrap in PATH is not a symlink and
the auto-detection stuff fails. This can be resolved by setting
PMBOOTSTRAP_CMD=/path/to/pmbootstrap.py, so the error has been improved
to suggest doing this.

[ci:skip-build]: already built successfully in CI
2024-05-01 01:04:33 +02:00
Clayton Craft
c63e05246f
ci/common: use gitlab CI target branch in get_upstream_branch (MR 5082)
This prefers gitlab CI's target branch from the env, and falls back to
the old target branch detection mechanism (using pmaports.cfg, etc) if
it's not set. This fixes CI in gitlab where the target branch is
something different than expected, e.g. if using stacked branches.

[ci:skip-build]: already built successfully in CI
2024-05-01 00:58:32 +02:00
Clayton Craft
28f8f3135e
Revert "ci: allow specifying pmbootstrap path to aid running locally (MR 4994)"
This was merged erroneously as a part of another MR. See
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/5033#note_1877584477

This reverts commit 40a46fd4e5.
2024-04-24 11:53:27 -07:00
Clayton Craft
a263494c1c
ci: fix failure with check_changed_aports when testing new aport
Apparently some callers of `get_package_version` expect it to return
None if a package wasn't found...  e.g. when CI is testing a branch that
introduces a new aport and it's trying to get the upstream version for
it, which doesn't exist.

This leads to a spectacular crash in CI:

      upstream = get_package_version(args, package, commit, False)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/clayton/src/pmaports/./.ci/lib/check_changed_aports_versions.py", line 47, in get_package_version
        return parsed["pkgver"] + "-r" + parsed["pkgrel"]
               ~~~~~~^^^^^^^^^^
    TypeError: 'NoneType' object is not subscriptable

When I refactored this method in 07812a918 I goofed up and changed this
behavior, so let's restore it to fix the crash.
2024-04-23 17:59:30 -07:00
Arnav Singh
deb676fba2
ci/check_changed_aports_ver: fix pkgrel check (MR 5061)
The apkbuild parser returns `pkgrel` key as a `str`, not an `int`,
so the `!= 0` check would always succeed even if the file set it to `0`.

[ci:skip-build]: already built successfully in CI
2024-04-23 10:43:03 -07:00
Clayton Craft
970bc34c45
ci/check_changed_aports_ver: add tests for new dev pkg rules (MR 4994)
[ci:ignore-count]

[ci:skip-vercheck]
[ci:skip-build]: already built successfully in CI
2024-04-22 16:37:41 -07:00
Clayton Craft
40a46fd4e5
ci: allow specifying pmbootstrap path to aid running locally (MR 4994)
I don't like how CI requires pmbootstrap in PATH to be a symlink, I use
a wrapper script to handle running pmbootstrap how I want and the
current pmbootstrap path detection is kinda annoying since it depends on
it being a symlink.

This allows using an environment variable, PMBOOTSTRAP_PATH, to set the
pmbootstrap path and skip all of the symlink resolving stuff.
2024-04-22 16:37:41 -07:00
Clayton Craft
07812a9189
ci/check_changed_aports_ver: move apkbuild reading from get_version (MR 4994)
This allows reusing the logic to read apkbuild contents in future
methods
2024-04-22 16:37:41 -07:00
Clayton Craft
284fd42c0a
ci: add test for validating pkgver for device packages (MR 4994) 2024-04-22 16:37:41 -07:00
Stefan Hansson
824647ea3a
CI: remove flash_kernel_on_update dependency check (MR 5045)
This property is now handled by boot-deploy, which devices shouldn't
depend on directly anyway.
2024-04-20 11:15:33 +02:00
Stefan Hansson
66d84cc745
CI: remove postmarketos-update-kernel from Shellcheck check (MR 5045)
This script has been integrated into boot-deploy.
2024-04-20 11:15:33 +02:00
Vitaliy Ognev
5cef8d31ca
ci: fix format specifier typo in wiki script (MR 5038) 2024-04-16 09:05:05 +03:00
Oliver Smith
2d0a7aa6dc
CI: add more tests for CODEOWNERS (MR 4940)
* Parse the file in python and ensure it is ordered alphabetically
* Ensure that we have at least as many gitlab nicknames in CODEOWNERS,
  as there are listed maintainers in main and community devices. This
  should help with enforcing that every maintainer is also listed in
  CODEOWNERS, so they can be easily pinged via their gitlab nickname if
  something for the device they maintain is happening.

[ci:skip-build]: already built successfully in CI
2024-03-18 08:01:26 +00:00
Stefan Hansson
fc9c3c1fef
CI: don't check for executable files in temp (MR 4858)
Most things in temp come from Alpine's aports repository, which has
different rules and does not for example mandate that files are not
marked as executable. As such, let's not require packages in there
to conform to our rules.

[ci:skip-build]: already built successfully in CI
2024-02-27 08:24:53 -08:00
Stefan Hansson
ec5b59eb77
CI: check for "before wpa_supplicant" in OpenRC service files (MR 4769)
See https://gitlab.com/postmarketOS/pmaports/-/merge_requests/4564
2024-02-21 21:19:12 +01:00
Oliver Smith
ff20316ff3
CI: allow firmware packages as deps of device pkgs (MR 4839)
We have decided to not use the non-free firmware subpackages anymore,
read the details in the blog post. Allow direct dependencies from the
device packages to the firmware packages.

Related: https://postmarketos.org/edge/2024/02/15/default-nonfree-fw/
[ci:skip-build]: already built successfully in CI
2024-02-19 21:35:33 +01:00
Clayton Craft
4dac896160
pmos-base-ui: disable DNS filtering to work around dnsmasq hang (MR 4824)
Crappy workaround, it's better than having DNS broken...
See: https://gitlab.com/postmarketOS/pmaports/-/issues/2601

Also removed it from shellcheck, because SC doesn't like all of the
unused/unreachable things after the `exit 0`. This commit should be
reverted when the issue is actually fixed later...

[ci:skip-build] already built successfully in CI
2024-02-14 12:17:55 -08:00
Sicelo A. Mhlongo
bdf9697cd9
ci: perform wallpaper checks on N900 too (MR 4810)
[ci:skip-build]: already built successfully in CI
2024-02-12 19:57:26 +01:00
David Heidelberg
bdea74f041
main/osk-sdl: drop (MR 4732)
Prequisite for dropping DirectFB support from SDL2 builds.

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-02-07 21:44:46 +00:00
Stefan Hansson
73b1a493b9
ci: replace Flake8 with Ruff (MR 4741)
See similar patch in pmbootstrap for rationale:
27618d5ffd

W504 ignore is removed as the rule does not exist in Ruff. But, since it
was ignored anyway, this does not matter.
2024-01-19 18:06:09 +01:00
Clayton Craft
b5b7983ade
ci/grep.sh: always run all tests (MR 4740)
fixes #2543
2024-01-19 17:02:21 +01:00
Stefan Hansson
d8b97a440f
CI: check for wallpaper being set in device packages (MR 4738)
We do not want this going forward as we will be changing the wallpaper
on a bi-yearly basis and we do not want to have perform shotgun surgery
every time we do so.

[ci:skip-build]: already built successfully in CI
2024-01-18 22:39:49 +01:00
Luca Weiss
e5c26d38f8
CI: add CODEOWNERS file sanity check (MR 4662)
* Check for space indentation instead of tabs
* Check that an entry actually exists
* Check that a directory ends in a slash, otherwise GitLab seems to
  ignore it
2023-12-29 15:02:10 +01:00
Ion Agorria
c43e9f45a8
CI: add setup_usb_storage.sh to shellcheck.sh (MR 4450)
[ci:skip-build] already built successfully in CI
2023-11-19 10:27:42 -08:00
Stefan Hansson
93c04ff4a6
CI: don't shadow built-in dir function (MR 4500)
Not related to the deprecation fixes.

[ci:skip-build]: already built successfully in CI
2023-10-27 08:37:43 +02:00
Stefan Hansson
c5b66e4090
CI: replace depreciated module (MR 4500)
See PEP 632: https://peps.python.org/pep-0632

Closes https://gitlab.com/postmarketOS/pmaports/-/issues/2207
2023-10-27 08:37:37 +02:00
Clayton Craft
a8bf624bb4
ci/shellcheck: ignore SC3043 warnings about use of 'local' (MR 4340)
This configures shellcheck in CI to ignore the use of the 'local'. Using
'local' to support variable scoping can prevent a lot of nasty bugs in
shell scripts.
Ash supports 'local', even though it's not a POSIX sh thing. It's used
extensively in our init.sh script, and many Alpine scripts use it.
2023-08-21 11:16:55 +02:00
Pablo Correa Gómez
f0d314793d
ci: make sure deviceinfo_modules_initfs is not re-introduced in pmaports (MR 4169)
[ci:ignore-count]
2023-08-04 08:27:44 +02:00
Arnav Singh
de08bca311
main/postmarketos-{base-ui,config-nftables}: reorganize NM configs and scripts (MR 4254)
1. Move all configs from /etc/NetworkManager/conf.d to
   /usr/lib/NetworkManager/conf.d since the latter is more appropriate for
   distribution-provided config files. In particular this means apk will
   update them when the package file is changed rather than creating
   `.apk-new` files. If a user wants to override such a file, they can create
   a file with the same name under /etc/NetworkManager/conf.d

2. Move all dispatcher scripts from /etc/NetworkManager/dispatcher.d to
   /usr/lib/NetworkManager/dispatcher.d for the same reason.

3. Rename all configs to have a "50-" prefix so that users can add their own
   "99-" overrides with a guarantee that they'll be processed after
   distribution-provided configs.

4. Rename dispatcher scripts to have a "50-" prefix instead of "85-" and "99-"
   since they're distribution-provided files.

5. Move 50-tethering.conf from the base-ui package to
   the base-ui-networkmanager package.

There are also some device packages that put config files without a numeric
prefix in /etc/NetworkManager/conf.d . This MR doesn't change those.

[ci:skip-build] already built successfully in CI
2023-07-17 10:06:52 -07:00
Newbyte
96a21ace3f
CI: check for direct sourcing of deviceinfo (MR 4129)
See https://gitlab.com/postmarketOS/pmaports/-/issues/2086
2023-06-03 17:44:24 +02:00
Newbyte
ca976d487c
CI: CI runs for three hours, not one hour (MR 4135)
In 11682fb0ab, the timeout was set to 10
hours. This means that the CI no longer just runs for one hour. However,
we are still limited by GitLab's runners which only give us three hours
of CI time per job, so given the status quo, this is the most likely
duration for someone who hasn't set up their own CI runners.
2023-05-30 09:12:52 +02:00
Dylan Van Assche
4b92e922ef
main/postmarketos-base-ui: enable USB tethering (MR 3819)
USB tethering allows users to use their phone's WiFi or WWAN interface
as an access point for the device they connect the phone with over USB.
This way, they can use their data plan with a laptop or desktop when
regular Internet access is absent.

Configure NetworkManager to manage the usb0 iface from initfs so users
can configure it in GNOME Settings or KDE. Include a NetworkManager
dispatcher script as well to handle postmarketOS' setup with unudhcpd as
we want to provide an SSH login over USB when tethering is disabled. If
tethering is enabled, unudhpcd is stopped and its functionality is taken
over by NetworkManager through an instance of dnsmasq. NetworkManager
will also configure the necessary settings to allow IP forwarding and
firewall rules during tethering. Once disabled, NetworkManager cleans up
these settings and our dispatcher script starts unudhcpd again.

Due to upstream changes, NetworkManager requires networkmanager-dnsmasq
subpackage as dependency as dnsmasq needs DBus support for
NetworkManager. Without it, NetworkManager will silently fail spawning
dnsmasq instances.
[ci:skip-build]: already built successfully in CI
2023-05-21 19:42:14 +02:00
Clayton Craft
4b516916dc
pmos-base-ui-networkmanager: set up dnsmasq for filtering lookups (MR 3823)
This uses a dispatcher script to configure filtering A and AAAA records
based on which IP versions are routable on the NM primary connection.

gojq is preferred over the 'standard' jq because it's considerably
faster... the dispatcher script took 0.89s on my L5 with jq, and 0.07s
with gojq. the difference is probably greater on slower phones... so it
seemed worth installing it.

fixes #1430

Co-authored-by: Arnavion <me@arnavion.dev>
2023-04-29 23:40:52 -07:00
Newbyte
239aa4da8f
CI: Support not having "pmbootstrap" in $PATH (MR 3977)
Not everyone's setup includes "pmbootstrap" as a command in $PATH.
Currently, in such setups, $ pmbootstrap ci kconfig (and potentially
other testcases) in the pmaports repository do not work as they expect
the "pmbootstrap" command to exist. Resolve this by checking whether
PMBOOTSTRAP_CMD is set and use that as command for invoking pmbootstrap.
If it isn't set (because you're using an old pmbootstrap version or
invoking a script directly for some reason), fall back to the old
behaviour as to not break compatibility.

Depends on pmbootstrap patch that sets PMBOOTSTRAP_CMD to argv[0]:
https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/39995
2023-04-02 15:04:13 +02:00
Oliver Smith
cfb582cba0
CI: kconfig: don't print unrelated warnings (MR 3961)
Run the "pmbootstrap kconfig check" only on the kernels that have been
modified.

[ci:skip-build] already built successfully in CI
2023-03-22 09:40:39 -07:00
Oliver Smith
3ec22cb65e
CI: run shellcheck against CI scripts (MR 3960)
Fix that CI scripts weren't actually getting checked.
2023-03-20 09:30:55 +01:00
Oliver Smith
eb37732514
CI: adjust scripts to pass shellcheck (MR 3960) 2023-03-20 09:30:55 +01:00
Clayton Craft
4eda07153a
postmarketos-mkinitfs: upgrade to 2.0 (MR 3895)
- Move base files/modules out of package, this package now only provides
  the mkinitfs tool.

- Add all required modules, these were copied over from
  postmarketos-mkinitfs and sorted

- Use new exe name in trigger

- Update triggers to ignore /etc, add /usr/share/mkinitfs. No packages
  should be installing into /etc/mkinitfs/

- Support building/installing docs

- Add vendored deps

- Change trigger path
2023-03-08 21:35:04 -08:00
Clayton Craft
536264bac0
main/postmarketos-initramfs: new aport (MR 3895)
This package contains base file and module lists for the initramfs /
initramfs-extra archives, along with the init.sh

The primary reason for doing this is so that changes to these
files/lists can be properly versioned (in pkgver), and (re)building
mkinitfs itself is no longer required for these changes.

- Add base file list for initramfs. The dirs at path
  /usr/share/postmarketos-mkinitfs/* are "new" in mkinitfs 2.0

- Install default modules to /usr/share

- Install system config to /usr/share/mkinifs

- Add base files for -extra archive

- Create user config dirs

- Update hook dirs in init.sh, change from mkinitfs 2.0

- Remove splash images, obsolete since pbsplash

- Support uncompressed initramfs-extra
2023-03-08 21:34:37 -08:00
Clayton Craft
5a01a67634
ci: grep for old mkinitfs paths (MR 3895)
Co-authored-by: Oliver Smith <ollieparanoid@postmarketos.org>
2023-03-08 21:30:30 -08:00
Newbyte
3fa300ecdb
CI: fix dtb check detecting itself and improve message (MR 3801)
Previously, the grep command would detect the /usr/bin/share string
inside of the .ci/grep.sh file, so only check the device folder to
avoid this. Other folders shouldn't contain any kernels anyway.

[ci:skip-build]: Everything but linux-postmarketos-qcom-sm7150
built fine in CI, and linux-postmarketos-qcom-sm7150 built fine
locally. Building linux-postmarketos-qcom-sm7150 via the CI failed
because it took over 3 hours so the CI timed out.
2023-03-03 23:09:01 +01:00
Newbyte
14d50e1c06
CI: re-enable dtb path check (MR 3801) 2023-03-03 23:09:01 +01:00
Anton Bambura
d7ec2e46dc
CI: test_device: fix versioned depends for postmarketos-base (MR 3791)
[ci:skip-build]: already built successfully in CI
2023-02-13 08:52:20 +01:00
Oliver Smith
d502d02a0b
CI: bump copyright to 2023 2023-01-26 08:40:40 +01:00
Joel Selvaraj
eab0457e00
CI: shellcheck: include call_audio_idle_suspend_workaround script (MR 3639)
[ci:skip-build]: already built successfully in CI
2022-11-28 09:07:52 +01:00
Oliver Smith
1af1eafd23
CI: mark deviceinfo_usb_rndis_function as obsolete (MR 3669)
[ci:skip-build]: already built successfully in CI
2022-11-27 17:30:03 +01:00