Rename internals for Almo
Remove postmarketOS trust
Move pmb to amb
pmb.flasher: remove outdated comment

After refactoring the patch, it now directly installs the lk2nd package.

Fixes: 68231d93 ("pmb.flasher: Improve flash_lk2nd action")
pmb.flasher: Improve flash_lk2nd action

* Check that we're not already running lk2nd as flashing boot partition
  inside lk2nd is different to flashing boot partition outside. We could
  improve this in the future to use "flash lk2nd lk2nd.img" as
  documented in the file.
* Grab the lk2nd package from the device package and install that. The
  device package is expected to have a dependency on the correct lk2nd
* Remove some log message in unusual styles for pmbootstrap.
* Group flash_lk2nd action together with the other flash actions and use
  string comparison.

See also: https://gitlab.com/postmarketOS/pmaports/-/issues/2074

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230605104026.744005-1-luca@z3ntu.xyz%3E
pmb.qemu.run: replace removed -soundhw option

In the QEMU 7.1 release the deprecated -soundhw option was removed.
Replace it with -audio so we can have audio working again in QEMU.

See also https://www.qemu.org/docs/master/about/removed-features.html

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230605102320.739043-1-luca@z3ntu.xyz%3E
pmb.helpers.run: fix sudo timer

The recent changes to the sudo code forgot this usage here which broke
with the sudo timer config option enabled.

Fixes: d31313f7 ("Don't use 'sudo' when running as root")
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230605092217.725218-1-luca@z3ntu.xyz%3E
c6a8a261 — Newbyte 5 months ago
pmb.config.sudo: Use type union compatible with Python 3.7

The Type | OtherType syntax for writing unions was introduced in Python
3.10. We want to support Python 3.7, so use an Optional type hint
instead which declares the same thing and is supported by 3.7.

Fixes: d31313f7 ("Don't use 'sudo' when running as root")
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230605063142.6843-1-newbyte@postmarketos.org%3E
09870a46 — Newbyte 6 months ago
pmb.helpers.frontend: Also clear testsuite log when running log -c

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230603102910.164433-1-newbyte@postmarketos.org%3E
Don't use 'sudo' when running as root

This cancels the need to install and configure `sudo` or `doas` on
single-user installations (e.g.: a VM dedicated to running pmbootstrap).

Fixes: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2224
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230529203922.22161-1-hugo@whynothugo.nl%3E
Use ruff for linting

Use ruff instead of flake8. Aside from being substantially faster, ruff
includes a lot of flake's plug-ins built-in, some of which may be useful
to enable as a follow-up.

Also move the relevant configuration out of the script in .ci/ and into
the project-wide settings. A side effect of this is that IDEs should
detect these settings, and ignore the same rules as CI, avoiding false
positives while developing locally.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230529203448.18656-1-hugo@whynothugo.nl%3E
ecb7660f — Pablo Correa Gómez 6 months ago
config: use en_US as default locale

In theory, the en_US locale is supposed to be aimed at people, while the
C locale is aimed as computers. In theory, one of the remarkable
differences is in sorting:

$ printf '%s\n' \| a \0 \^ \& B c C | LC_COLLATE=C.UTF-8 sort

The non-sense there is obvious, with "^" sorting in between the letters,
"|" afterwards and sorting of capitals and non-capitals split. The reason
is the ordering is based on the ascii table. In theory, an en_US locale
should be able to provide a sensitive ordering, but what takes care of it
is the libc, and musl does not have it properly implemented. So LC_COLLATE=en_US
will still give the same results. However, that's hopefully going to change
at some point, and there's no harm in setting a sensible locale by default.

Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
aportgen/binutils: set pmOS bugurl

Alpine recently set the bugurl to the Alpine Linux issue tracker. When
rewriting the APKBUILD for cross compiling in postmarketOS, change it
to https://postmarketos.org/issues.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/commit/fe73f3a28c101cfbe0a41e55c8497520a6cfbdca
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230522065220.2841-4-ollieparanoid@postmarketos.org%3E
aportgen/binutils: add more makedepends_host

Adjust to Alpine's APKBUILD where jansson-dev and zstd-dev are only set
if $BOOTSTRAP is empty. The APKBUILD parser in pmbootstrap doesn't
recognize this, and therefore doesn't install the depends unless we
replace makedepends_host= outside of the condition.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/commit/fe73f3a28c101cfbe0a41e55c8497520a6cfbdca
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230522065220.2841-3-ollieparanoid@postmarketos.org%3E
40fc6f4f — Newbyte 6 months ago
pmb: Remind users to ensure pmbootstrap is updated before reporting errors

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Co-developed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230521070148.8311-1-newbyte@postmarketos.org%3E
pmb.flasher.frontend: Use elif instead of repeated if

Only one action can be provided through the args, so there's no point in
checking subsequent actions if a previous one has matched.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230513120625.1259793-2-luca@z3ntu.xyz%3E
Prepare 1.53.0 release
acb94bea — Pablo Correa Gómez 6 months ago
install: write new file instead of modifying locale.sh from alpine-baselayout

First of all, modifying in-place the file owned by alpine-baselayout has the
consequence of that file never being updated by APK. This is an issue changes
happen upstream. And I just fixed[1] an issue upstream that had to be with
that exact file, so make sure that from now on, we're writing to another file
that sorts before the one from alpine-baselayout. Additionally, equivalently
to the fix in [1] for bug [2], don't set the variable unconditionally, but
instead use its current value if it's already set.

[1] https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/46718
[2] https://gitlab.alpinelinux.org/alpine/aports/-/issues/14862

Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Tested-by: Oliver Smith <ollieparanoid@postmarketos.org>
Co-developed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3CDB9P192MB12912380DD72F8A840694B44C7759@DB9P192MB1291.EURP192.PROD.OUTLOOK.COM%3E
kconfig check: Add USB gadget check to community

Make sure that we disable legacy gadgets like USB_ETH. Our initramfs
uses configfs gadgets instead, currently RNDIS for USB networking.

In the future this can be expanded to more options like mass storage,
MIDI or whatever we're going to integrate into the OS that can be
configured by the user.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230423163438.746054-1-luca@z3ntu.xyz%3E