Commit Graph

1771 Commits

Author SHA1 Message Date
Oliver Smith abe54f8b76
pmb/aportgen/grub_efi.py: fix distfile collisions
Same fix as MR 1947, but for grub_efi.py instead of musl.py. While at
it, order the imports alphabetically.
2020-06-21 15:09:05 +02:00
Oliver Smith d230b396b3
pmb/aportgen/grub_efi.py: alpine mirrordir
On branch stable, we would use Alpine's mirrordir "v3.11" for example.
2020-06-21 15:09:05 +02:00
Oliver Smith 23d4bb7020
pmb/aportgen/grub_efi.py: pass apkbuild-lint 2020-06-21 15:09:05 +02:00
Oliver Smith f7a154b61b
pmb/aportgen/grub_efi.py: use f-string in APKBUILD 2020-06-21 15:09:05 +02:00
Oliver Smith 8b7c9fb46a
pmb/aportgen/busybox_static.py: fix distfile collisions
Same fix as MR 1947, but for busybox_static.py instead of musl.py. While
at it, order the imports alphabetically.
2020-06-21 15:09:05 +02:00
Oliver Smith 98b28c6d84
pmb/aportgen/busybox_static.py: alpine mirrordir
On branch stable, we would use Alpine's mirrordir "v3.11" for example.
2020-06-21 15:09:05 +02:00
Oliver Smith ae7b02c918
pmb/aportgen/busybox_static.py: pass lint 2020-06-21 15:09:05 +02:00
Oliver Smith 61cf186566
pmb/aportgen/busybox_static.py: use f-string 2020-06-21 15:09:05 +02:00
Oliver Smith 130de05881
aportgen get_upstream_aport: checkout branch
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-21 15:09:04 +02:00
Oliver Smith 54938032af
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-21 15:09:04 +02:00
Oliver Smith ccb5e323d7
pmb/aportgen/musl.py: fix distfile collisions
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-21 15:08:59 +02: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
Oliver Smith 8fb69f9c46
install_system_image: add sdcard argument (MR 1946)
The on-device installer will run install_system_image once with
sdcard=None and the second time with sdcard=args.sdcard.
2020-06-19 09:36:51 +02:00
Oliver Smith 718839364b
install_system_image: add split argument (MR 1946) 2020-06-19 09:36:51 +02:00
Oliver Smith 539108bbc4
install_system_image: add step, steps parameters (MR 1946) 2020-06-19 09:36:51 +02:00
Oliver Smith a56e4eae5a
install_system_image: add root_label parameter (MR 1946)
Prepare for on-device installer, so it can use something other than
"pmOS_root" as label.
2020-06-19 09:36:51 +02:00
Oliver Smith 7fb41641ea
install_system_image: add suffix argument (MR 1946)
Allow files to be copied from a different suffix than rootfs_$DEVICE.
The on-device installer will use this.
2020-06-19 09:36:51 +02:00
Oliver Smith 17e7edb254
Cosmetics: install_system_image(): remove FDE msg (MR 1946)
Full disk encryption (--fde) has not been the default for a long time,
so no need to warn the user about it.
2020-06-19 09:36:51 +02:00
Oliver Smith cd58efdbd7
pmb.install._install.print_flash_info: cosmetics (MR 1946)
Fix a typo and wrap lines at 80 characters (especially one extra long
line). Use f-strings in lines that were modified (as we're doing it
nowadays).
2020-06-19 09:36:51 +02:00
Oliver Smith a3fd169c76
pmb.install._install.print_flash_info: new func (MR 1946)
Move code that prints flashing information from install_system_image()
to its own function. For the on-device installer, we'll need to call
install_system_image() twice, without printing the flashing information
each time. While at it, add "step" and "steps" parameters.
2020-06-19 09:36:51 +02:00
Oliver Smith a97ec615ad
pmbootstrap install: support size_reserve (MR 1946)
Create an empty partition between boot and root. This will be used by
the on-device installer, as explained in detail here:
https://wiki.postmarketos.org/wiki/On-device_installer
2020-06-19 09:36:50 +02:00
Oliver Smith 5fbc95c3c2
Cosmetic: pmb.install.partition: fix comment (MR 1946) 2020-06-19 09:36:50 +02:00
Oliver Smith 2fc0794e30
pmb/install: have size_boot, size_root in MiB (MR 1946)
Prepare for a future patch, that adds reserved space in MiB, by changing
size_boot and size_root from bytes to MB everywhere. This is what we need
most of the time and allows to drop some /1024**2 statements.
2020-06-19 09:36:50 +02:00
Oliver Smith 63fc2b621a
pmbootstrap chroot --install-blockdev: new option (MR 1946)
Create /dev/install inside the chroot from a block device, just like
done during the installation. This is useful for testing the Calamares
installer.
2020-06-19 09:36:50 +02:00
Oliver Smith 00691a56ee
blockdevice.create_and_mount_image: add split arg (MR 1946)
Add a "split" argument to the function, instead of using "args.split"
directly. "args.split" is only defined when calling "pmbootstrap install",
but the next patch will add a code path that calls the function from
"pmbootstrap chroot".
2020-06-19 09:36:50 +02:00
Bhushan Shah 79409053ad ci: install pip as well 2020-06-17 13:34:59 +05:30
Minecrell 3ebb994206
pmb.parse: Respect provider_priority if multiple providers exist (MR 1945)
Alpine APKBUILDs have the concept of "provider priorities" that affect
the choice of the provider to install when multiple packages provide
a virtual package.

One use case for this is to allow installation of different firmware
versions. bq-paella can run unsigned firmware, therefore you have the
choice between using the original firmware from the manufacturer, or
a slightly newer version from Qualcomm for the Dragonboard 410c.

We add provides="firmware-qcom-msm8916-wcnss" (the "virtual package")
to both firmware-qcom-db410c-wcnss and firmware-bq-picmt-wcnss.
At this point, attempting to install "firmware-qcom-msm8916-wcnss"
would still fail with apk. (Because it does not know which provider
to install.)

To pick a default we can set e.g. provider_priority=100 for
firmware-qcom-db410c-wcnss (the slightly newer version).
In that case, firmware-qcom-db410c-wcnss should be installed by default.

However, the user can choose to do "apk add firmware-bq-picmt-wcnss"
to override the default choice in case of problems. In that case,
the conflicting firmware-qcom-db410c-wcnss will be automatically removed.

At the moment, pmbootstrap does not respect the "provider_priority" at all.
In the above case, it would always install "firmware-bq-picmt-wcnss"
during "pmbootstrap install" since that has the shortest name.

Extend the pmbootstrap code to pick a provider with the highest priority
(if any of the providers has a priority set).
2020-06-16 01:31:28 +03:00
Oliver Smith 6d013b4472
pmbootstrap chroot --xauth: new option (MR 1944)
Make it easy to start any X11 application from the native chroot.
2020-06-09 04:10:51 +02:00
Iskren Chernev 2dd707a7ea
envkernel.sh: Add reactivate, deactivate on re-source (MR 1918)
Some users prefer to re-source the script from time to time. Detect that
and deactivate first.
2020-06-02 11:34:46 +02:00
HenriDellal 4e3a2d6923
Add "flasher flash_vbmeta" support for heimdall devices (MR 1936) 2020-06-02 11:14:59 +02:00
Oliver Smith 40a328388d
pmb.install: simplify root size estimation (MR 1931)
Do not substract the estimated size of the home and boot directories
from the root directory size. While that would be the correct way if we
were able to get exact sizes, it isn't helpful with the very rough
estimates we are getting from pmb.helpers.other.folder_size. Replace
"calculate" wording with "estimate".
2020-06-02 10:48:03 +02:00
Anjandev Momi 37b4af19fc
make boot partition size user-overridable (MR 1931)
Ask for the boot partition size during "pmbootstrap init" in the
additional options with a default of 128 MB, and allow to override it
with -B.
2020-06-02 10:48:03 +02:00
Oliver Smith d623913491
pmbootstrap init: (build => additional) options (MR 1931)
Rename "build options" to "additional options", so we can put non-build
related options there too.
2020-06-02 10:47:58 +02:00
Anjandev Momi 0ff9c5d471
pmbootstrap init: only display UIs for device arch (MR 1937)
Hide user interfaces that are not available for the selected device's
architecture.

Closes #1790
2020-06-02 09:18:39 +02:00
Oliver Smith 2d2ab1df56
testdata: update lg-mako deviceinfo (MR 1937)
Copy from current pmaports master, so pmbootstrap doesn't complain about
missing deviceinfo_codename when parsing it. Right now pmbootstrap
doesn't complain about this, but with the next patch it will attempt to
parse the file.

This replaces the year from 1337 to 2012 too, but let's rather have it
slightly more maintainable than introducing a diff for a funny reference.
2020-06-02 09:18:34 +02:00
Oliver Smith 445410d08c
Prepare 1.20.0 release 2020-05-24 08:51:01 +02:00
Oliver Smith 0aa1dd7145
pmb.parse.deviceinfo.sanity_check: verify chassis (MR 1933) 2020-05-24 08:38:43 +02:00
Luca Weiss 1356707e9a
pmb.install._install: update comments (MR 1933) 2020-05-24 08:38:15 +02:00
Luca Weiss 6bb7f022b1
pmb: introduce deviceinfo_chassis (MR 1933)
"Chassis" defines the what kind of device a device is. Currently the
following standardized types exist:

  "desktop", "laptop", "convertible", "server", "tablet", "handset",
  "watch", "embedded", "vm", "container"

This property is exposed by org.freedesktop.hostname1 (e.g.
openrc-settingsd) and can be used by applications for example to display
appropriate strings instead of "About this phone" for non-phone devices.
2020-05-24 08:38:10 +02:00
Antoine Fontaine c5d0f76005
pmb.parse.kconfig: add tests (MR 1916) 2020-05-24 04:42:13 +02:00
Antoine Fontaine 28da033267
pmb.parse.kconfig: implement anbox kconfig check (MR 1916)
fixes https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1891.
2020-05-24 04:42:01 +02:00
Antoine Fontaine e36e160167
pmb.parse.kconfig: check for end of line in "CONFIG_…=y" (MR 1916)
it's a nitpick, but now `is_set` won't return true
for (e.g.) CONFIG_XYZ=marmelade.
2020-05-22 23:05:28 +02:00
Antoine Fontaine 075706b26e
pmb/build: remove implicit native cross-compilation (MR 1941)
If a package want native cross compilation, it should explicit that
with "pmb:cross-native" in `options=`.
See https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1910.
2020-05-21 08:03:50 +03:00