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>
Apparently plymouth's config parser can't handle in-line comments. This
also fixes an issue I just noticed where the scale wasn't being parsed
correctly either because 1.0 is not a uint.
../src/libply/ply-key-file.c:427:ply_key_file_get_ulong : group 'Daemon' key 'DeviceScale' val '1.0' is not a valid unsigned number
../src/libply/ply-key-file.c:427:ply_key_file_get_ulong : group 'Daemon' key 'XkbExtraEscButton' val '0x1008ff2a # Power button (XKB_KEY_XF86PowerOff)' is not a valid unsigned number
The additional xkb config is necessary for plymouth to detect the pwr
key press, or else it isn't initialized.
Fixes#4548
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8561>
Without this rule, fb0 doesn't get ID_PATH set in the udev database
and plymouth this to detect that fb0 is backed by a DRM device. This
fixes an issue where plymouth times out and treats fb0 as an independent
display, and creates a second framebuffer renderer, which caused it to
render the splash at the wrong resolution.
These lines were lifted from 71-seat.rules, which are packaged in
systemd-udevd and elogind. They're vendored here because we don't want
to depend on elogind just for a few udev rules. These rules should be
idempotent in the rootfs (setting ID_PATH is guarded by ID_PATH=="" and
IIUC setting an existing TAG is a noop in udev)
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8561>
This merges system extensions in the initramfs, right before
switch_root, so that the rootfs boot always has the full merged /usr
right from the start. It fixes ordering issues like binfmt starting
before /usr/lib/binfmt.d was merged, and ultimately not working as
expected.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8426>
This will allow folks to easily run mkosi, e.g. for building duranium
images. This makes duranium self-hosting.
There are several key changes in this patch:
- mkosi is added to the duranium developer tools sysext
- user qemu is added to the dev tools sysext (for binfmt+qemu)
- coreutils is added to the main pkg to work around a conflict that Alpine
has with mkosi (see: https://github.com/systemd/mkosi/pull/4283). The
issue is that the busybox symlinks installed in the base duranium image
are not replaced by mkosi when it generates a system extension even if
that sysext pulls in coreutils. coreutils isn't *that* big, so it makes
sense to just have these links correct in the base image.
- duranium dev. tools depends on apk-tools. Wait, what?! mkosi uses
apk to bootstrap a tools tree for building pmOS images. Since we don't
actually want apk to work when run against the duranium rootfs, this
also installs a wrapper that refuses to run apk if it detects that it's
being used "unsafely". To be clear, running apk on duranium's rootfs
won't change /usr or break duranium, but it will: 1) fail, 2) create
confusing state in /etc, /var.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8426>
It doesn't make sense to install apk by default in all flavors of pmOS,
like duranium. To avoid this, apk-tools is moved into a new -apk
subpackage that is pulled in implicitly via install_if. This has the
following benefits:
- postmarketos-duranium can "depend" on !postmarketos-base-apk to
exclude apk-tools
- apk-tools remains a dependency in existing mutable pmOS installs,
so it shouldn't be purged by this change 🤞
- we don't have to update hundreds of APKBUILDs in pmaports that
explicitly depend on `postmarketos-base` to now depend on some other
package that doesn't have apk-tools as an explicit dependency.
After this change, we'll be able to remove some janky cleanup code in
the duranium image build config for uninstalling apk-tools from the base
image, and it will allow us to *add* apk-tools in a system extension
later [1]
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
1. https://gitlab.postmarketos.org/postmarketOS/pmaports/-/work_items/4502
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8426>
In some cases when the disk is very large (e.g. 2TB) repart will add
extra space to the slot-A usr partition to make it larger. The slot-B
partitions are already pinned with a min/max size so they would stay
the correct size. This pins the slot-A usr partition so it's no longer
grown. This should have been done all along.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8419>
This uses a new naming convention for partitions. It fixes an issue
where some firmware (i.e. on the OnePlus 6 / 6T) will hang when starting
fastboot mode if it finds a (sub!)partition with a GPT partition label
that's "too long" (25char, in the case of enchilada, well under the 34
char limit in the GPT spec).
By keeping the old partition name match pattern, which *should* help
migrate existing installs after 2 updates (to capture partitions
associated with both "slots"). Given duranium's "wip" status, I don't
think it's strictly necessary to migrate existing installs, but I feel
like this is a good opportunity to see if it's possible to do so. It
might be handy to do in the future and working out how to do that now
seems useful.
This also drops the verity signature partition. According to the UAPI
Discov. Partition Spec (DPS) this partition is not really needed if the
verity hash for the usr partition is in the kernel cmdline and the UKI
is signed (not yet, but one day 🤞). There is one mode where having the
separate partition is useful: verified boot in containers, but this is
outside the scope of duranium.
This partition is tiny (16K) so the space saving is negligible... but
it would be nice to have one less partition to "manage". On existing
installs, this partition will become "foreign" to systemd repart, and
sysupdate will not touch it since it will no longer match any patterns.
fixes#4484
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8408>
The kernel cmdline option is to prevent gnome-initial-setup from
launching, because it doesn't work properly and conflicts with our first
boot setup. On phosh this is technically not necessary since g-i-s won't
try to start there, but adding this to the base gnome UI pkg means I
wouldn't have to add sep. subpackages to gnome and gnome-mobile UI pkgs.
The duranium subpkg also pulls in a plugin for gnome-software so that
g-s can provide a frontend for pulling duranium image updates via
sysupdate.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8411>
Turns out, a few useful things are gated by this flag that I want to use
in Duranium:
1) bootctl automatically configuring EFI boot entry variables
2) systemd-boot-update.service installation
Let's just re-enable this and strip out the sd-boot stuff already
packaged in Alpine aports, rather than continue to fight the build
system with more patches in pmaports.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8371>
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 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 also adds some helper functions to finding dlopened dependencies.
They're printed out during package(), and useful for figuring out which
packages to depend on when adding dependencies manually to the APKBUILD.
They're also quite gross (e.g. invoking apk) so it's commented out by
default.
Trigger change is because `reload-or-restart ---marked` is now
deprecated:
* --marked is deprecated. Please use 'systemctl enqueue-marked' instead.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8198>
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>
This sets the max disk space used by journald logs to 1GB (systemd
default is 4GB). This seems like a good trade-off between having access
to more older logs in case there are transient issues that need debug
or we need to understand system behavior long term, and not filling too much
space on devices with little storage.
If a device is really constrained for space, the device package
can ship an override file in journald.conf.d to lower this limit
even further. Users/system admins can also override this value in
/etc/systemd/journald.conf.d.
Fixes#4389
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8156>
This reworks the subpartition init to use loop devices instead of
kpartx/dm mappings. This allows us to use the same logic for resizing
as we do for other partitioning schemes (and refactors that code a bit).
This also helps duranium, because systemd tooling (repart, sysupdate,
gpt-auto-generator) can't properly handle GPT subpartitions exposed via
kpartx dm mappings, but works correctly with loop devices created with
partition scanning enabled.
After this change, subpartitions show up as loop devices, e.g.:
$ ls /dev/loop*
/dev/loop0p1
/dev/loop0p2
There *should* be no impact to existing installs.
This also drops the dependency on multipath-tools, which seems to have
been added years ago as a workaround for installing kpartx (like maybe
multipath-tools used to provide kpartx?), see 7573f5fce4. Anyways, we
don't use anything in this pkg in the initramfs AFAIK.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7932>
This allows booting pmOS from u-boot on existing and new installs.
Setting the boot partition to vfat isn't strictly necessary (ext2 seems
to work OK), but IIUC either FAT is in the EFI spec or it's what
everyone else uses. We made a similar patch to the OP6/OP6T previously.
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7961>
The hw CI isn't stable yet, if a platform is entirely offline (e.g.
because we only have 1 device in CI and it's down for maint.) then the
test job is "pending" for a verrrry long time (16hrs+). mrtest (for
example) is then unable to be used on the MR because the pipeline is
not "success."
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7943>
Unit files were added to the upstream aports pkg.
pw and pw-pulse are no longer socket activated with this change, because
that requires linking against libsystemd(which isn't enabled upstream),
but I think that's worth avoiding all of the packaging complexity of
having a pipewire pkg fork in pmaports.
Fixes#4279
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7894>