This adds a script that can be used to set the "channel" for images to
"staging" or "main." "Staging" will come from a separate pipeline in the
duranium mkosi config repo, it may build images with patches or whatever
for testing, and won't be available to users running the "main" channel.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8330>
This is hopefully temporary. The proximity and accelerometer sensor tags
were removed upstream(1) citing an open issue on a specific device
and the desire to have more testing. Enabling it in pmOS will help get testing.
This udev rule shouldn't have any impact on devices that don't have
fastrpc. Installing it conditionally on iio-sensor-proxy just seems adds
packaging complexity for basically no benefit.
1. a9d7ff148c
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7788>
Duranium is an immutable variant of postmarketOS that uses systemd's
image-based OS model: dm-verity verified /usr, A/B slots managed by
systemd-sysupdate, LUKS2-encrypted root, and systemd-boot with UKIs.
This package ships systemd-repart, systemd-sysusers, tmpfiles, and
first-boot service configuration needed at runtime in both the initramfs
and the booted system, as well as sysupdate transfer definitions for
finding and upgrading images. Build-time repart and sysupdate config
lives in the mkosi config repo[1].
The pmOS initramfs is not used. Rather than re-implement partition
setup, verity, factory reset, and switch_root in shell script and
risk regressions for mutable pmOS installs, an initramfs is built by
mkosi containing systemd. This lets the standard systemd initrd
machinery handle everything, with no modifications to the pmOS
initramfs required.
On Android devices, subpartition logic from the pmOS initramfs is
essentially copied into a new systemd unit that runs in the initramfs
and sets up subpartitions so that they are available to tooling that
runs later in the boot process. In the future, this functionality should
be moved upstream into systemd.
Boot flows:
"Normal boot": the verified /usr partition is mounted and the LUKS
root partition is unlocked (empty passphrase by default, with fallback
to a graphical unlock prompt for user-set passphrases). switch_root
hands off to the real rootfs.
"First boot": systemd-repart creates the root partition, always as a
LUKS volume with an empty passphrase. After switch_root, a first-boot
app runs before the display manager to collect a username and password,
create the user account, and optionally set a LUKS passphrase. The
passphrase can also be changed later via systemd-cryptenroll or
cryptsetup.
"Factory reset": detected in the initramfs by systemd, which uses
systemd-repart to wipe and recreate the root partition. Boot then
continues with the first boot flow above. Factory reset can be triggered
while booting in the rootfs by starting a systemd unit that configures
an EFI variable to signal to the initramfs on next boot.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7059>
abuild's default behaviour copies files from usr/lib/systemd into a the
$pkgname-split subpackage.
Several APKBUILD definitions do this manually, since they predate this
feature.
Remove the superfluous systemd() function in these cases.
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8023>
Back in the days, hexagonrpcd was not suitable for generic device
packages and we had to hack around it with this service / script. Now
that hexagonrpcd can guess the HexagonFS directory location at runtime,
we can and should get rid of this service to align with our (future)
firmware packaging guidelines.
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8163>
This changes the override to:
1) use /sys/kernel/config for the configfs location
2) depend on the sys-kernel-config.mount unit, which will automatically
mount configfs
3) depend on modprobing libcomposite
4) create the g1/configs/c.1 path automatically in case it's not created
yet
The configfs.ini file is also updated with the path
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8175>
This matches the path that systemd's sys-kernel-config.mount unit uses,
and imho it's a lot nicer to tuck the mount point under /sys/kernel
(like for debugfs) than to have it in /
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8175>
The version of OpenBSD's doas packaged by Alpine had its last commit
21-02-2022. This in itself is not bad, but the issue is that in that time,
there have been many MRs and issues filed to the repo that see no action.
One major MR, that being a hardening patch against rowhammer attacks,
has layed stale since 03-03-2024. After Natanael Copa asked if the repo
was still maintained, the response was that it is low-priority.
As such switching to sudo-rs, despite its larger size and attack surface, makes
sense due to more users and thus more eyes on it performing analysis and fixing
security issues quicker. OpenBSD doas does not have this itself, and a low-usage
fork of it definitely does not. While there are snazzier, more modern
alternatives like run0, capsudo, or s6-sudo, none of these are in a state where
they can fully replace all the features that sudo provides.
sudo-rs was chosen over the original sudo due to a few factors. The first is
memory safety, as Rust generally solves that issue in the codebase, so a whole
class of possible vulns are eliminated. Second is that sudo-rs is already in
use by larger distributions like Canonical's Ubuntu, meaning that the user base
is already quite large, leading to similar amounts of eyes on the source code.
Third, sudo-rs has had support from the original authors of sudo, allowing the
project to avoid the pitfalls of the legacy C codebase. Finally, sudo-rs has
already had two fairly recent independent security audits, meaning that their
security posture is diligent enough to be trusted.
See https://github.com/trifectatechfoundation/sudo-rs/tree/main/docs/audit
In the future, any further switch in the privilege-escalation tool should keep
the sudo command, be it through a symlink, shim, or a binary itself. This is
maintained currently due to having installed doas-sudo-shim by default, but
more care should be taken in the future to not break user workflows.
Partially reverts 0f327af853
See https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/4144
Signed-off-by: Aster Boese <asterboese@mailbox.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7967>
This is currently done in the initramfs itself, and there's no need to
leak that information, so follow-up commits will remove it from the
initramfs.
Signed-off-by: Pablo Correa Gómez <pabloyoyoista@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7881>
Taking the files from the bootrr package. This will allow us to move
the package to alpine in the future, also to, in follow-up commits,
make the use of the postmarketos-test package consistent.
Signed-off-by: Pablo Correa Gómez <pabloyoyoista@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7881>
Instead, use shell globbing to find the corresponding file. This
allows using the function for the -unl0kr subpackage, and improves the
consistency between the filenames
Signed-off-by: Pablo Correa Gómez <pabloyoyoista@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7881>
When we create rootfs tests, they will involve more complex scenarios
that might not be fit for this simple packaging and shell
scripts. Therefore, remove it to simplify developing initramfs tests
Signed-off-by: Pablo Correa Gómez <pabloyoyoista@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7881>
Without a sufficient vm.min_free_kbytes value, the kernel may not start
reclaiming memory early enough to make use of zram swap before the
kernel OOM killer fires. Set a minimum of 100000 KB on devices with >=
1GB of RAM where the kernel's calculated value is lower.
This ignores devices with <1GB of RAM, because I think with so little
RAM isn't unlikely to really matter and if we set this too high then we
risk insta-OOMs.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8157>
Put phosh-tour in pmb_recommends instead of having postmarketos-welcome
indirectly installed by default through
postmarketos-base-ui-gnome-mobile. In order to do that, move
postmarketos-welcome from the pmb_recommends of
postmarketos-base-ui-gnome-mobile to postmarketos-ui-gnome-mobile.
The reasons for that is that the postmarketos-welcome app by now has
in part incomplete and outdated explanations about how phosh shall be
used. For example, a common question that we don't answer but phosh-tour
does is how the keyboard can be launched from any app.
The postmarketos-welcome app warns more about that this is an
experimental system, but that is prominently displayed on our homepage
when trying to download images. Otherwise it also doesn't contain much
information that makes it worth keeping instead of phosh-tour.
Finally phosh upstrem has also said that they would be willing to have
distro-specific tour pages, so if we notice that something would be
really good to have there in the long run, we could look into getting it
in phosh-tour.
[ci:skip-vercheck]: changing pmb_recommends doesn't need rebuilds
Signed-off-by: Oliver Smith <ollieparanoid@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8145>
* Fix wrong path for lomiri-indicator-location, this has probably
changed upstream a while ago and was missed.
* Fix font rendering on some Adreno GPUs
* Clean up dependencies
* Don't force-depend on pipewire* and wireplumber.
* Remove font-droid-nonlatin since that's already in _pmb_recommends
of postmarketos-base-ui.
* Remove networkmanager since that's already a dependency of
postmarketos-base-ui-networkmanager.
* Add more Lomiri apps as recommended
* Set home button background color, otherwise the white logo is
invisible on a (default) white background.
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8076>
We pre-install Firefox but that isn't available anymore on x86 since
67ceb722092486a00de16b6ae72933e179f07fc9 in aports. Since
_pmb_recommends doesn't support things like 'case "$CARCH" in', there is
no way to conditonally disable Firefox on the architecture so we have to
disable the entire UI for it for now.
[ci:skip-vercheck]
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8080>