For UI packages that have pmb:systemd-never set:
* do not ask in "pmbootstrap init" whether to use systemd or not
* do not install systemd, even if the systemd option is set to "always"
The point of this is to not add maintenance burden to Sxmo (and possibly
other UIs who not wish to support systemd with postmarketOS), so users
don't install with this unsupported use case and report issues with it.
Upgrade packages in the chroot, in case alpine-base, apk etc. have been
built from source with pmbootstrap. We build it from source for systemd
currently, and sometimes it is useful to do that to debug apk.
Add this argument, so we can disable the pmOS repository during
"pmbootstrap repo_bootstrap" for the chroot we build in.
If building natively, it will be disabled in the "native" chroot.
If building for a foreign arch, it will be disabled in the
"buildroot_$arch" chroot, but still be enabled in the native chroot so
we have the cross compilers available.
The name of the argument is a bit long, but it is consistent with the
argument of the same name in pmb.helpers.repo.urls() (to which it gets
passed).
Add the following question to "pmbootstrap init":
[22:12:57] Based on your UI selection, 'default' will result in installing systemd.
[22:12:57] Install systemd? (default/always/never) [default]:
Determine whether the UI prefers to have systemd or not, based on
"pmb:systemd" in the UI package's APKBUILD.
Determine whether the currently selected branch supports systemd, by
checking for a "[repo:systemd]" section in pmaports.cfg. This section
will also contain bootstrap information, to be used in future patches.
We have been discussing making device package versioning more
consistent and ended up settling on using integer versioning for device
packages[1]. As such, let's start by tackling this at the source and
start generating new device packages with 1 as the starting pkgver
instead of 0.1.
[1]: https://gitlab.com/postmarketOS/pmaports/-/issues/2610#note_1796178414
Fixes this warning:
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
- 'ignore' -> 'lint.ignore'
In the process, drop the list of required python packages. This is
only needed for pip, as pmbootstrap checks by itself. This way we
avoid duplicating the minimum required version.
We also don't install the helpers anymore, as modern tooling does not
support installing things outside the python package dir
If there are multiple sections to a subpackage declaration, the middle one
(item 1 in the sequence in this case) is the custom function name which we
should use instead of the deduced one.
For example:
$pkgname-something-separate:something_separate:noarch
Here, the subpackage is called $pkgname-something-separate, but function names
cannot contain hyphens, so it's instead given the custom name
something_separate where the hyphen is replaced by an underscore. At the end,
the architecture of the subpackage is also overriden as noarch instead of
whatever architecture the main package has.
However, it is also possible to only override architecture of a subpackage and
not the function name.
In such cases, we get this:
$pkgname-something::noarch
We still have a "middle section" (item 1 in the sequence), but it will be
empty. As such, we not only need to check whether there are more than 1
subpackage part, but also whether that extra subpackage part is an empty string
or not.
This fixes an issue where pmbootstrap would not end up just setting the
properties of subpackages with a set arch but no custom function as
None instead of giving them proper depends, install, pkgdesc, et cetera
properties.
Highlight messages like the following from pmbootstrap install:
[19:45:59] *** (1/4) PREPARE NATIVE CHROOT ***
[ci:skip-build]: already built successfully in CI
Many have been unable to use pmbootstrap install on kernel versions
between 5.8 and 6.0 as parted was giving the following error:
Error: Partition(s) 1, <...>, 64 on /dev/install have been
written, but we have been unable to inform the kernel
of the change, probably because it/they are in use.
As a result, the old partition(s) will remain in use.
You should reboot now before making further changes.
And pmb couldn't find /dev/loop0p1:
ERROR: Unable to find the first partition of /dev/loop0,
expected it to be at /dev/loop0p1!
Related: pmbootstrap#2309
[ci:skip-build]: no code changes
Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
If the device name does not make a valid hostname, fall back to some
simple valid hostname. Some device names (e.g. 'generic-x86_64') are
valid names for apk packages and such, but are not valid host names. It
assumes that the user (real, or CI) doesn't care if it's unset and just
expects pmb to work and not conditionally crash based on the device they
selected.
Situations where the user sets an invalid hostname are still validated
separately and cause an exception so that they know their config was
wrong and to fit it.
This fixes an issue that came up in CI when doing `pmb config device
generic-x86_64` followed by `pmb install`.
I considered trying to convert invalid host names into valid ones, but I
didn't feel like it was worth the trouble of adding stuff to convert and
re-validate when we can just set a static, boring, but definitely valid
default if the device name is not valid.
Due to that logging.verbose is "monkeypatched" into logging and not
present by default in the module, Mypy isn't able to pick up that it
exists. As such, just disable the check altogether in this file for
now.
The return value of this function is never used. Additionally, the type
hint for it was incorrect as it may return None. As such, don't bother
returning anything both to appease Mypy and also to remove unused
and consequently presumably untested functionality.
Repurposing argcomplete as a boolean telling whether the module
argcomplete was found results in a variable with two distinct purposes
and types, which is bad practice and confuses Mypy. As such, don't
assign False to argcomplete if the module is not found and instead just
check for whether it exists in sys.modules to determine whether it was
imported successfully.
This drops the prompt for using non-free firmware in images. The logic
for searching/installing non-free fw subpackages for devices is kept,
and will always be installed. This is to support the many device
packages in pmaports that still have nonfree-firmware subpackages. Going
forward, device packages can list firmware in `depends=` (for required
fw) or `pmb_recommends` (for optional fw).
nonfree-userland wasn't used in pmaports as far as I could find.
Sometimes dependencies of packages we are explicitly adding to world
define selected providers that we should account for. This improves
get_selected_providers to discover/add these selected providers in
dependencies too, recursively.
Fixes#2306
Only install the abuild-apk wrapper if cpu emulation is required. This
fixes building for x86 on x86_64.
Fix for:
>>> postmarketos-base-ui-gnome: Analyzing dependencies...
/usr/local/bin/abuild-apk: line 11: /native/usr/bin/abuild-apk: not found
Fixes: c5ca06d5 ("pmb: only enable abuild-apk wrapper for buildroot (MR 2246)")