Commit Graph

1802 Commits

Author SHA1 Message Date
Luca Weiss 1fe65fe14e pmb.helpers.git.get_branches_official: accept Alpine stable branches
Currently when you run 'pmbootstrap aportgen --fork $package' on v20.05
branch, the Alpine 3.12-stable branch gets checked out. But running
'pmbootstrap pull' afterwards means that the branch doesn't get updated
because that branch isn't accepted by the pull code.
Add 3.12-stable and a couple of releases afterwards to the accepted
branches for aports_upstream.
2020-08-30 17:27:00 +02:00
Luca Weiss 86d61b8012
pmb.parse.bootimg: detect mediatek header (MR 1955)
Some Mediatek devices have a special 512-byte header around the zImage
which must be generated so the device boots.

Support for that exists for a while in postmarketOS but detection was
missing. Add that.
2020-08-21 18:33:30 +02:00
Oliver Smith 9718fd294a
pmb.install.setup_keymap: fix fail on X11 setup (MR 1968)
Do not fail in "pmbootstrap setup" if a keymap was selected, but no
/etc/X11/xorg.conf.d path exists in the rootfs chroot. The grep output
is not empty in that case (it would be empty if the directory exists and
there are no matches), so we need to add this extra check:

	(rootfs_nokia-n900) % grep -rl XkbLayout /etc/X11/xorg.conf.d/
	grep: /etc/X11/xorg.conf.d/: No such file or directory
2020-08-12 01:16:09 +02:00
Oliver Smith e233b73949
pmb.config.mirrors_postmarketos: update URL (MR 1967)
Official pmOS binary package mirror is now mirror.postmarketos.org. The
old URL will stay functional as redirect.
2020-08-08 21:16:39 +02:00
Oliver Smith a498c3afab
Prepare 1.22.2 release 2020-08-05 11:02:08 +02:00
Oliver Smith 7c26c1e9e5
test_crossdirect_rust: run on stable channel (MR 1966)
This test is failing with Alpine edge, because x86_64 has a different
rustc version than armv7:
	found crate `std` compiled by an incompatible version of rustc

Run the test with the latest Alpine stable version instead, where it is
more likely that rustc has the same version across all arches.
2020-08-05 10:38:23 +02:00
Oliver Smith 554dbd73ba
pmb.chroot.apk_static.download: fix mirrordir (MR 1966)
When selecting the stable channel in "pmbootstrap init", do not attempt
to download apk-tools-static from the "edge" mirrordir. This stopped
working, because the version in the APKINDEX of v3.12 is different than
the one in edge now.

Fixes:
	Download http://dl-2.alpinelinux.org/alpine/edge/main/x86_64/apk-tools-static-2.10.5-r1.apk
	ERROR: HTTP Error 404: Not Found

Related: https://builds.sr.ht/~postmarketos/job/272760#task-pmbootstrap_build-123
2020-08-05 10:04:48 +02:00
Oliver Smith 505425491f
Prepare 1.22.1 release 2020-08-03 11:37:08 +02:00
Oliver Smith 78f43d254e
pmb.config.mirror_alpine: don't use CDN
Replace dl-cdn mirror with dl-2 temporarily to avoid "BAD signature"
errors.

This is related to the rebuild of Alpine edge x86, armhf, armv7 packages
against musl-1.2, that is currently going on. The packages are rebuilt
without a version change and therefore have the same resulting file
name, but a different checksum. Due to caching of the CDN and due to the
same file name, users may get an old package from before the rebuild.
The APKINDEX has a checksum of the new package, and so the download will
fail with a "BAD signature" error.

Alpine developers clear the cache every now and then, but this issue
will happen over and over again, until all packages are rebuilt (some
packages are still not rebuilt and have been disabled).

Let's switch back in two months or so.
2020-08-03 11:23:04 +02:00
Alexey Min aa88721b75
pmb.helpers.cli: fix TAB-completion of items with '-' (MR 1960)
Before this fix tab completion of names with hyphens were not done:
try for example to complete UI package name in 'pmbootstrap init' with
hyphen, like "plasma-mobile" / "plasma-desktop". Now this is handled
correctly (hyphen is not considered as delimeter).
2020-07-20 16:47:33 +02:00
Oliver Smith 44e099acc7
Prepare 1.22.0 release 2020-07-20 14:44:00 +02:00
Oliver Smith d8615a9cae
pmbootstrap install: support _pmb_recommends (MR 1962)
Let UI meta-packages specify apps in "pmb_recommends" to be explicitly
installed by default, and not implicitly as dependency of the UI
meta-package ("depends"). Therefore make these apps uninstallable,
without removing the meta-package.

Add pmbootstrap install --no-recommends to disable this feature.
2020-07-20 14:29:06 +02:00
Oliver Smith c8d581e749
pmbootstrap install --no-local-pkgs: new option (MR 1951)
Don't install locally compiled packages and package signing keys. This
will be used for the official images generated with pmbootstrap.
2020-07-15 16:47:51 +03:00
Oliver Smith 05849a9f80
pmbootstrap install: make building pkgs optional (MR 1951)
Add a question at the end of "pmbootstrap init", to ask if the user
wants to build outdated packages during "pmbootstrap install". Store the
result in the new pmbootstrap.cfg key "build_pkgs_on_install". I've put it at
the end, because it is a rather complicated question compared to the rest.

This is useful to speed up the installation for casual users who can now
avoid compiling packages. But also for the official images where we only
want to ship the official binary packages and not build anything
on-the-fly.
2020-07-15 16:47:43 +03:00
Mark Hargreaves 0aed64d661
pmb/helpers/frontend.py: fix pmbootstrap kconfig check --file (MR 1961) 2020-07-15 16:30:57 +03:00
Oliver Smith f9c74277ca
cpu_emulation_required: not for armv7 -> armhf (MR 1952)
Make it possible to build armhf packages on armv7 devices, e.g. to help
with stuck build-edge-armhf packages that won't build with qemu.
2020-07-14 22:42:55 +02:00
Pellegrino Prevete 95762a229a
pmb/config/__init__.py: add CONFIG_USER_NS (for bubblewrap/flatpak) (MR 1943)
Also fix tests
2020-07-14 23:19:50 +03:00
Oliver Smith ae21bc8615
Prepare 1.21.0 release 2020-07-11 16:24:15 +02:00
Oliver Smith 9bbe78328f
setup.py: change devel status: alpha -> stable
pmbootstrap is fairly stable now, time to let setup.py and pypi.org
reflect it.
2020-07-11 16:19:52 +02:00
Oliver Smith 1d6c382cf7
install --ondev: pass cipher to ondev-prepare (MR 1958)
Let postmarketos-ondev honor the cryptsetup cipher from pmbootstrap.
2020-07-11 13:25:15 +02:00
Oliver Smith 3b02d35f1d
install --fde --android-recovery-zip: show warning (MR 1958)
This is likely to fail with the new default cryptsetup cipher of
aes-xts-plain64, as many downstream kernels used in recovery OS (like
TWRP) do not have CRYPTO_XTS set.
2020-07-11 13:25:09 +02:00
Oliver Smith 05c013536d
pmb.config.cipher: set default to aes-xts-plain64 (MR 1958)
Replace aes-cbc-plain64 with the stronger cipher aes-xts-plain64.
CONFIG_CRYPTO_XTS is necessary for this, so require it in
"pmbootstrap kconfig check".

Related: https://gitlab.com/cryptsetup/cryptsetup/-/wikis/FrequentlyAskedQuestions#5-security-aspects
2020-07-11 13:24:21 +02:00
Oliver Smith ec71670f20
pmb.config.necessary_kconfig_options: sort keys (MR 1958)
Sort keys alphabetically.
2020-07-11 13:24:09 +02:00
Oliver Smith b366b5004f
CI: disable pmbootstrap-qemu-tests
The machine that was running them is currently broken.

Related: #1943
2020-07-11 00:08:57 +02:00
Mark Hargreaves 4312160c96
pmb/parse/bootimg.py: fix file names after mkbootimg-osm0sis update (MR 1959) 2020-07-10 22:53:00 +03:00
Oliver Smith 324ea788ba
install --ondev: don't ask for user password (MR 1954)
With postmarketos-ondev 0.2.0, the password is set in the on-device
installer.
2020-07-01 00:19:49 +02:00
Oliver Smith 90f57bbbcc
install --ondev: set username to "user" (MR 1953) 2020-06-30 21:50:49 +02:00
Oliver Smith ea60aaa08c
install --ondev: add ondev_min_version (MR 1953)
Put a minimum version check for postmarketos-ondev in the pmbootstrap
install code and verify it before starting the installation. This avoids
using incompatible versions, similar to the pmaports.cfg version check
we already have. Set the minimum required version to 0.2.0.
2020-06-30 21:50:43 +02:00
Oliver Smith e089d05a55
install --ondev: ondev-prepare: fix log msg (MR 1953) 2020-06-30 21:50:39 +02:00
Oliver Smith 6fb194795a
install --ondev: ondev-prepare: pass pmb ver, ui (MR 1953)
Pass the pmbootstrap version and user interface, so it can be checked /
displayed in postmarketos-ondev.
2020-06-30 21:50:35 +02:00
Oliver Smith f9f5640d82
install --ondev: ondev-prepare: use env vars (MR 1953)
Do not pass the arguments to ondev-prepare as command-line arguments in
a specific order, but instead as environment variables. New arguments
will be added in a follow-up patch.
2020-06-30 21:50:19 +02:00
Oliver Smith 8a02187a1a
pmb/aportgen/grub_efi.py: fix distfile collisions (MR 1950)
Same fix as MR 1947, but for grub_efi.py instead of musl.py. While at
it, order the imports alphabetically.
2020-06-24 21:08:44 +03:00
Oliver Smith 460d2c0eb4
pmb/aportgen/grub_efi.py: alpine mirrordir (MR 1950)
On branch stable, we would use Alpine's mirrordir "v3.11" for example.
2020-06-24 21:08:44 +03:00
Oliver Smith a74aafb978
pmb/aportgen/grub_efi.py: pass apkbuild-lint (MR 1950) 2020-06-24 21:08:44 +03:00
Oliver Smith 2bb96184d0
pmb/aportgen/grub_efi.py: use f-string in APKBUILD (MR 1950) 2020-06-24 21:08:44 +03:00
Oliver Smith b4a205d4db
pmb/aportgen/busybox_static.py: fix distfile collisions (MR 1949)
Same fix as MR 1947, but for busybox_static.py instead of musl.py. While
at it, order the imports alphabetically.
2020-06-24 20:40:45 +03:00
Oliver Smith 178931f992
pmb/aportgen/busybox_static.py: alpine mirrordir (MR 1949)
On branch stable, we would use Alpine's mirrordir "v3.11" for example.
2020-06-24 20:40:38 +03:00
Oliver Smith f9f9e19a4c
pmb/aportgen/busybox_static.py: pass lint (MR 1949) 2020-06-24 20:40:26 +03:00
Oliver Smith 9639da22c9
pmb/aportgen/busybox_static.py: use f-string (MR 1949) 2020-06-24 20:40:18 +03:00
Oliver Smith 143b35408e
aportgen get_upstream_aport: checkout branch (MR 1948)
Checkout the aports.git branch for the current channel (e.g.
3.12-stable), before trying to find the APKBUILD.

I had tried to auto-unshallow the git repository earlier, but then the
tags were missing. I decided that it's not worth to provide a migration
path: "pmbootstrap aportgen" is only used by few advanced users (to
maintain the pmaports repo).
2020-06-24 20:16:55 +03:00
Oliver Smith a86669d521
pmb.helpers.git.clone: remove shallow option
This made sense for Alpine's aports.git repository as we were only using
the master branch. But now that we are using more branches, we need the
entire git repository with all its branches cloned.
2020-06-24 19:29:21 +03:00
Oliver Smith bfbb095895
pmb/aportgen/musl.py: fix distfile collisions (MR 1947)
Add the Alpine mirrordir (e.g. "edge", "v3.12") to the distfile, so
musl-*.apk files of the same version and arch but from different
mirrordirs do not collide.

Let "abuild checksum" download these apks and generate the checksums,
instead of letting apk download them as side-effect of initializing
foreign arch chroots. The latter did not work anymore, because we would
copy the apk file with a glob that may matches the hash of either mirrordir.
Essentially:
    glob.glob(f"{args.work}/cache_apk_{arch}/{subpkgname}-{version}.*.apk")[0]

In the context of the on-device installer, I found that calculating this
hash is not trivial, so let's just avoid it here as well.

While at it, order the imports of musl.py alphabetically.
2020-06-24 04:41:54 +03:00
Oliver Smith 4f7a13084f
pmb/aportgen/musl.py: use channel alpine mirrordir (MR 1939)
On branch stable, we would use Alpine's mirrordir "v3.12" for example.
2020-06-21 12:07:29 +02:00
Oliver Smith ac90787e76
pmb/aportgen/musl.py: pass 'pmbootstrap lint' (MR 1939)
Remove quotes around pkgname and pkgver, indent with tabs and provide
a stub for arch_to_hostspec.
2020-06-21 12:07:09 +02:00
Oliver Smith 37ee340166
pmb/aportgen/musl.py: use f-string in APKBUILD (MR 1939) 2020-06-21 12:07:05 +02:00
Oliver Smith 357c1acc82
test/test_aportgen.py::test_aportgen: armhf->armv7 (MR 1942)
Alpine's armhf edge build bot is stuck, so musl-1.1.24-r9.*.apk is
missing and the test fails. armhf is on it's way out, so replace it with
armv7.
2020-06-21 11:50:57 +02:00
Oliver Smith ea710caafe
pmb/aportgen/binutils.py: pass apkbuild-lint (MR 1942) 2020-06-21 11:50:57 +02:00
Oliver Smith 654cc56062
pmb/aportgen/core.py: no quotes around some keys (MR 1942)
Don't print quotes for pkgname, pkgver, pkgrel. This is required to pass
apkbuild-lint.
2020-06-21 11:50:57 +02:00
Oliver Smith c0b80b26b5
pmb.aportgen.core.rewrite: no lines with empty val (MR 1942)
Avoid apkbuild-lint errors like:
	[AL5]:APKBUILD:15:variable set to empty string
2020-06-21 11:50:52 +02:00
Oliver Smith ddb5d9ae2c
pmbootstrap install --ondev: new option (MR 1946)
Add initial support for the on-device installer in pmbootstrap. Let
pmbootstrap create a regular split image, then prepare a new installer
rootfs and copy the previously generated rootfs image into the installer
rootfs. Put the installer rootfs into a new image, with reserved space.

There is more to do from here, such as disabling the generation of the
user account when using --ondev. But this requires support in
postmarketos-ondev first, so let's build that iteratively.

Related: https://wiki.postmarketos.org/wiki/On-device_installer
Related: https://gitlab.com/postmarketOS/postmarketos-ondev/-/issues
2020-06-19 09:36:51 +02:00