45 Commits
Author SHA1 Message Date
Clayton Craft a8cd964e9f main/postmarketos-base-ui: don't use dnsmasq for filtering
This reverts 4b516916dc

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9005>
2026-08-05 11:01:57 -07:00
Clayton Craft 4121c0d740 main/postmarketos-duranium: drop subpartition script, expand udev disk hack
systemd 261 can now natively detect and mount subpartitions.

Fixes #4544

This also works around an issue where udiskie will prompt for mounting
the /usr partitions on disk, when they are subpartitions. I didn't
file a bug upstream because it's really not clear to me what to blame
(udisks2? udiskie? udev?)

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8660>
2026-05-28 22:56:37 +00:00
Stefan Hansson aa19f54ef9 Revert "ci: shellcheck: update mkinitfs hook paths"
This reverts commit 59beb3ba91.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8511>
2026-05-10 13:43:38 +00:00
Aster Boese 59beb3ba91 ci: shellcheck: update mkinitfs hook paths
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8413>
2026-04-23 19:04:55 +00:00
Clayton Craft 5d73bec629 ci/shellcheck: add duranium scripts
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8330>
2026-04-12 17:17:55 +00:00
Achill Gilgenast cb468c0b75 main/postmarketos-mvcfg: remove
Deprecated. See
https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/3580,
lets remove it.

Removed the last users in the last commits.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7750>
2026-01-23 21:04:56 +00:00
Clayton CraftandDylan Van Assche 5971d0f226 main/postmarketos-usb-moded: use a generator to configure UID/GID for umtprd
MTP transfers write files to the home folder of the user.
If no GID and UID are specified, uMTP-responder will use the GID/UID
under which it is running at the time of the file transfer.
This causes users to not be able to access the files on the device after transfering.

This patch adds a systemd generator that:

1) reads /etc/default_user, and appends config to
   /etc/umtprd/umtprd.conf to set the MTP default user/group. If this
   file doesn't exist, 10000:10000 is the fallback uid:gid.
2) installs this config to /run/umtprd/umptrd.conf
3) adds a unit override to /run for umtprd.service that runs the daemon
   with this modified config

The generator is used instead of hardcoding a uid and gid in umtprd.conf
so that this can support immutable installs or situations where the
default UID/GID is not 10000.

Co-authored-by: Dylan Van Assche <dylan@postmarketos.org>
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7658>
2026-01-05 10:15:18 +00:00
Dylan Van Assche c5a8b1b6cd CI: tethering script is removed
usb-moded takes over tethering from NM

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6531>
2025-12-27 22:44:27 -08:00
Clayton Craft 7c137628be ci: shellcheck: add device-apple-mac-aarch64 scripts
There are a few of these, and they're probably complicated enough to
justify shellchecking them.

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7112>
2025-10-28 09:38:56 +00:00
Clayton Craft 671da45525 ci: shellcheck: add os-installer's setup script
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7112>
2025-10-28 09:38:56 +00:00
Clayton Craft 39922de34e ci/shellcheck: run on pmos-base-systemd's apk trigger
This trigger has a lot going on, so let's make sure it always passes
shellcheck. It's not picked up by the normal search for triggers in this
script because the actual logic for the trigger is broken out from the
.trigger file.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6892
2025-09-08 07:33:54 -07:00
Caleb Connolly 1e7fe0c4f7 CI: introduce shell unit-test infra
Introduce some basic infrastructure to allow running per-package unit
test jobs, as well as a library to support unit-testing shell scripts.

Packages can provide their own unit tests by adding a tests/
subdirectory to the package, this should contain a .gitlab-ci.yml file
with jobs that extend the .package-test job template as well as any
supporting data and scripts.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6182
2025-04-08 13:35:31 -07:00
Caleb Connolly 036c802769 CI: shellcheck: allow informative checks to fail
There are lots of informative checks which are safe to ignore but happen
a lot especially with unit testing scripts. Adjust shellcheck to only
fail on warning or above.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6182
2025-04-08 13:35:30 -07:00
Sicelo A. Mhlongo 9b19e3e248 main/postmarketos-base: drop udev-based firmware loading
udev no longer supports using userspace to service kernel requests for
firmware. While the kernel can be configured to send such requests to
userspace, udev will not do anything about them.

Reference: https://github.com/eudev-project/eudev/commit/3b717594600fa717cdf9bcfd0c7c1b703b245482

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6332
[ci:skip-build]: already built successfully in CI
2025-04-03 10:50:28 +02:00
Clayton Craft bd4c139c4d soc-qcom: new aport (MR 6189)
This is basically a copy of soc-qcom-sdm845, which many things (even
non-sdm845 stuff) were depending on.
2025-02-19 08:13:22 -08:00
bjorn3 55a89d949c main/msm-firmware-loader: add systemd unit files (MR 5964) (MR 5563)
[ci:skip-build]: already built successfully in CI
2025-01-10 13:02:37 +01:00
Stephan Gerhold ce05d2d8ff main/postmarketos-initramfs: unify setup_usb_storage (MR 5912)
Right now we have two similar implementations of setting up a USB mass
storage gadget, in init_functions.sh and as separate script for the
debug-shell. Given that init_functions.sh is available in debug-shell
anyway, unify both in a common setup_usb_storage_configfs() function.

Having this included in the initramfs debug-shell by default (without
installing postmarketos-mkinitfs-hook-debug-shell) also simplifies
recovery, since you can set up the USB storage for repairing the flashed
postmarketOS installation in case of boot failures. The size overhead is
minimal, since this has no extra dependencies.
2024-12-17 23:24:15 +03:00
Caleb Connolly dd28314ba2 postmarketos-initramfs: debug-shell 3.0 (MR 5000)
This incorprates the debug-shell functionality directly into the
initramfs, so it's no longer necessary to build and boot a custom
initramfs in order to debug your device.

Additionally, the behaviour of the debug-shell is entirely reworked, It
now creates an ACM serial gadget which can be accessed via any normal
terminal emulator (picocom, minicom, etc; or PuTTY on windows). Rather
than just invoking sh, the debug-shell now creates a respawning getty on
both the new virtual console and the active console (this will either be
the UART console or tty0/1).

It is necessary to spawn these shells via getty since the logging rework
means we can no longer assume that stdin/out/err reference a TTY.

In addition to the above, it is now possible to trigger a log dump by
holding volume up during boot. This can be useful for helping users
debug their devices if the issue doesn't result in a failure that can be
detected in the initramfs.

With these changes, the console-shell and debug-shell hook packages are
reduced to only adding the additional tools/features. console-shell is
still required for fbkeyboard, and debug-shell for the setup_usb_storage
tool.

Co-Developed-by: Clayton Craft <craftyguy@postmarketos.org>
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-18 12:35:05 -07:00
Clayton Craft 45dec6cc73 pmos-base-ui: re-enable DNS filtering (MR 4846)
Alpine aports will have a patch[1] to fix the bug this was working around,
so let's re-enable it.

This reverts commit 4dac896160.

1. https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/61103

fixes #2601

Also see #1430
2024-06-04 09:42:33 -07: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
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
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
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
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
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
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 CraftandArnavion 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
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
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
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 245d41d7c5 CI scripts: fix typo in URL (MR 3655)
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.
2022-11-20 16:50:42 +01:00
Oliver Smith c88cfa516f CI: shellcheck: adjust for 'pmbootstrap ci' (MR 3608)
Split out the grep for CHANGEME into a separate .ci/grep.sh script, as
it's not related to shellcheck and also there's another grep check that
I'll move there in a follow-up patch.
2022-11-17 19:10:56 +01:00
Jakob Hauser 67b5dd49dd main/swclock-offset: move to its own repository (MR 3642)
To make "swclock-offset" available to other projects as well, it was
moved to its own repository.
2022-11-15 10:32:29 +01:00
Newbyte 7e94b27b71 CI: remove msm-firmware-loader from shellcheck (MR 3260)
msm-firmware-loader is in its own repo now.
2022-06-29 08:07:58 +02:00
Caleb Connolly 6ec43fbbb4 ci: remove shellcheck for TTYEscape (MR 3017)
It's been moved to it's own repo.
2022-03-23 00:09:03 +00:00
Johannes Marbach 4f3ed7f70e main/osk-sdl: add fde-unlock script (MR 2687) 2022-02-03 15:39:48 -08:00
Johannes Marbach 816937b1ef main/unl0kr: new aport (MR 2687)
Fixes: #1309
2022-02-03 15:39:48 -08:00
Mark HargreavesandLuca Weiss ac23869e4c postmarketos-mkinitfs-hook-netboot: new aport (MR 2222)
Co-authored-by: Luca Weiss <luca@z3ntu.xyz>
2022-01-22 13:40:05 +01:00
Newbyte 70be414133 CI: use shellcheck from Alpine again (MR 2691)
Shellcheck is back in Alpine's repos.

This reverts commit 80e35c5eb0.
2021-11-18 18:22:29 +01:00
Oliver Smith 80e35c5eb0 CI: download shellcheck as static binary (MR 2673)
Adjust to shellcheck removal in Alpine. Currently it's still in edge for
x86_64, but installation fails with:

  ERROR: unable to select packages:
    so:libffi.so.7 (no such package):
      required by: shellcheck-0.7.2-r1[so:libffi.so.7]

Use the official static binary release from shellcheck instead of the
Alpine package. Version 0.7.2 is intentionally used instead of latest
8.0.0, since the latter generates a new warning. Let's unbreak CI first
before adjusting to a newer shellcheck version.

Related: https://lists.alpinelinux.org/~alpine/devel/%3C20211021133615.32f08070%40ncopa-desktop.lan%3E
2021-11-10 08:26:42 +01:00
Alexey Minnekhanov b4d73a717f CI: add installkernel-pmos to shellcheck (MR 2586) 2021-10-14 12:27:55 +03:00
Nikita Travkin bc50dd0279 main/msm-firmware-loader: add a package to load firmware on msm devices (MR 2431)
Many devices need proprietary firmware blobs. So far those blobs were
packaged and installed from the repository but this approach has many
drawbacks:

- The rootfs can only be used on a single device model.
 - If a model has multiple variants that have diferent secire-boot key,
   each must have it's own firmware blobs.

This makes maintaining packaged firmware very hard and outweights the
benefits of having a repeatable installation in most cases.

Instead we can load blobs dynamically from preexisting firmware
partitions that usually have same structure and contain the blobs we are
interested in.

The proposed scripts place symlinks to the blobs in a special dir that
then given to the kernel. Blobs from firmware/postmarketos (or another
dir that was set as extra path prior the script execution) will take
priority which allows to override some blobs (e.g. for deviecs with no
secure-boot)
2021-09-27 15:23:47 +03:00
bo41 ef0117cc4e CI: rename ci folder to consistent naming (MR 2514)
part of https://gitlab.com/postmarketOS/postmarketos/-/issues/26
2021-09-14 09:36:39 +02:00