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
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
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.
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
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.
* 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
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
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
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
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.
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
* 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
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.
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
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.
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
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>
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
- 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
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
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.
Note that the URLs in these scripts are not only for information, but
they are also used as marker by pmbootstrap so it knows these are
compatible with 'pmbootstrap ci'. I just fixed the typo in the
pmbootstrap code as well and made a new release, use pmbootstrap 1.50.0
or above to have it recognize these scripts with 'pmbootstrap ci' again.
Reimplement the distfile-check as python test inside this git
repository, so we don't need to download a tarball of ci-common.git to
run it. This would not have been nice for running the test with
'pmbootstrap ci', as we don't want it to get downloaded every time the
test runs.
This new implementation is done in less than 40 lines of code, very fast
and doesn't need to create a lot of files in /tmp to build a
"distfiletree".
Prepare to add a new test making use of the
parse_source_from_checksums() function in test_unreferenced_files.py by
extending the function to not only return the checksum file names, but
also the checksums. Also rename the file from test_unreferenced_files.py
to test_source.py.