Commit graph

28 commits

Author SHA1 Message Date
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 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
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 Hargreaves
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
Renamed from .gitlab-ci/shellcheck.sh (Browse further)