Commit Graph

1680 Commits

Author SHA1 Message Date
Iskren Chernev 41a7089e21
envkernel.sh: various improvements (!1883)
* Change prompt
* Add deactivate
* Use /tmp/envkernel for run-scripts
2020-04-10 20:28:08 +02:00
Oliver Smith b18ec9a693
pmb.helpers.package.get: no crash if dep missing (!1909)
Fix the function, so it does not crash anymore when the
replace_subpkgnames argument is set and a dependency cannot be resolved.
Instead, print a useful warning that shows which pmaport caused the
error (that has always been a pain to figure out), and simply don't
replace the potential subpkgname with the real pkgname, just use the
dependency name as-is.

Resolve annoying crashes in bpo dependency resolving, like this one
(caused by a few linux-* pmaports for bad downstream kernels that depend
on python, not apparent at all from the message):

[09:08:15] Calculate packages that need to be built (all packages, aarch64)
[09:08:26] ERROR: Package 'python': Could not find aport, and could not find this package in any APKINDEX!

Related: https://builds.sr.ht/~postmarketos/job/184022
2020-04-10 19:34:09 +02:00
Niklas Cathor 29a3cb2b8c
pmb.helpers.frontend.config: add option to reset config to default (!1907) 2020-04-07 01:02:19 +03:00
Niklas Cathor 00a4eaf91d
pmb.helpers.frontend.config: add support for clearing a config value (!1907)
Previously these two commands would both print the current value:
  pmbootstrap config extra_packages
  pmbootstrap config extra_packages ''

With this change, the second command will instead set the given config
value to the empty string.
2020-04-07 01:02:12 +03:00
Oliver Smith 098eb4710e
Prepare 1.18.1 release 2020-04-06 16:49:45 +02:00
Oliver Smith 59272236ad
pmbootstrap pull: skip pmaports version check (!1908)
Prevent "pmbootstrap pull" from failing with:

NOTE: your pmaports folder has version 4, but version 6 is required.
ERROR: Run 'pmbootstrap pull' to update your pmaports.

Fixes: #1900
2020-04-06 16:34:22 +02:00
Luca Weiss 20e6dd0085 pmb.aportgen.linux: fix generated apkbuild 2020-04-06 10:39:45 +00:00
Oliver Smith 73ac84f605
Prepare 1.18.0 release 2020-04-05 13:47:31 +02:00
Antoine Fontaine 350d384492
pmb.install._install: check sdcard exist (extra sanity check) (!1894) 2020-04-05 13:33:51 +02:00
Antoine Fontaine 00dc54a6c7
pmb.install._install: correct capitalisation in an error message (!1894) 2020-04-05 13:33:46 +02:00
Oliver Smith 73401f8606
pmb.parse.arguments: fix pkgname autocompletion (!1905)
Use pmb.helpers.args.add_cache() with the args used during
autocompletion, so pmb.helpers.pmaports._find_apkbuilds() does not fail
when trying to access args.cache.
2020-04-05 13:04:53 +02:00
Dolphin von Chips 364fb333f6
pmb.aportgen.linux: use _outdir for supporting out-of-tree kernel builds (!1893)
Require new pmaports version, which has the related devicepkg-dev
changes.
2020-04-05 12:54:09 +02:00
Dolphin von Chips cb9a02b348
build.menuconfig: add support for out-of-tree builds using _outdir (!1893) 2020-04-05 12:51:24 +02:00
Dolphin von Chips ff61dfc077
pmb.parse._apkbuild: handle _outdir in downstream kernels (!1893) 2020-04-05 12:51:19 +02:00
Oliver Smith b4a05cbcfb
pmb.build.is_necessary: fix case with Alpine's pkg (!1904)
No build is necessary if pmaport can't be built for given arch.
pmbootstrap must use Alpine's binary package in that case, even if the
pmaport version is higher than Alpine's binary package version.

Fixes: #1897
2020-04-04 13:19:03 +02:00
Oliver Smith 44cb06d345
pmb build --no-depends: stop on outdated pkgs too (!1900)
The --no-depends option is supposed to stop pmbootstrap if it was
instructed to build a package, but a dependency must be built first. So
far, this only covers the case if there is no binary package for a dependency.
Make it stop if the binary package exists, but is outdated, too.

Fixes: #1895
2020-04-01 09:22:35 +02:00
Minecrell 4e31ddcdd8
helpers/envkernel.sh: expand a glob to get path to deviceinfo (!1899)
The device might not be in testing, but in main or community,
so let's stop hardcoding testing here.
2020-04-01 02:50:13 +03:00
Minecrell b4c54636b3
test/testcases_fast.sh: stop hardcoding testing/ directory (!1899)
Take the change from pmaports that expands a glob for more flexibility.
2020-04-01 02:50:09 +03:00
Minecrell 37cc4454a4
pmb.config: make qemu-amd64 the default device (!1899)
At the moment we set samsung-i9100 as default device.
This is probably only for historical reasons.

For someone/something using pmbootstrap without a specific device in mind
(e.g. CI) it's really better to use a generic device. QEMU runs natively
in a virtual machine so everyone can use it for testing.
2020-04-01 02:50:04 +03:00
Minecrell 9249f36f16
pmb.helpers.pmaports: change some frequent messages to .verbose() (!1898) 2020-03-31 23:58:44 +02:00
Minecrell cd630edf25
pmb.helpers.pmaports: glob just once (!1898) 2020-03-31 23:58:38 +02:00
Oliver Smith 9d17ed29e3
pmb aportgen binutils: add texinfo to makedepends (!1901)
The current version of binutils does not build anymore without texinfo.

Related: #1894
Related: pmaports!1114
2020-03-31 23:33:41 +02:00
Daniele Debernardi 11c36fcf65
pmb.helpers.pmaports: cache get_list results (!1896) 2020-03-29 20:19:58 +02:00
Daniele Debernardi 20de238ff6
pmb.helpers.pmaports: search apkbuild path only if package exists (!1896) 2020-03-29 20:19:58 +02:00
Daniele Debernardi 0c179a5cf9
pmb.helpers.pmaports: cache _glob_apkbuilds results (!1896) 2020-03-29 20:19:48 +02:00
Luca Weiss f598a7fd41
pmb.parse._apkbuild: decrease log verbosity (!1897)
Closes #1886
2020-03-29 15:15:55 +02:00
Alexey Min 93514ae149
Fix "local variable '_partition_vbmeta' referenced before assignment" (!1895)
For safety, we should define variable in all code paths.

Fixes #1893
2020-03-23 04:37:13 +03:00
Alexey Min e5e48537b1
pmb.install: offer to flash vbmeta if device declares support for it (!1885) 2020-03-21 20:58:08 +01:00
Alexey Min e6da56d9b0
add "flasher flash_vbmeta" command (!1885)
Flashes device vbmeta partition (can be overriden with
"flash_fastboot_partition_vbmeta" setting in deviceinfo)
with custom vbmeta.img which has verity flag disabled,
so device can boot postmarketOS with no problems.
2020-03-21 20:58:08 +01:00
Daniele Debernardi 45f5ace1c2
pmb.helpers.frontend: fix wrong package name in kconfig check (!1891)
The kconfig check searches the aport with the "linux-" prefix to the
package name passed as argument. This is not working with the full
package name like linux-device-name because it searches a
linux-linux-device-name and fails.
2020-03-21 19:41:08 +01:00
Oliver Smith 2933b57f5d
README.md: mention "pmbootstrap status" (!1882) 2020-03-14 19:15:32 +03:00
Oliver Smith cfd93bc6ea
pmbootstrap status: check if git repo is outdated (!1882)
Use the timestamp of .git/FETCH_HEAD in each git repository, to
determine if too much time has passed since the last fetch/pull.
Modify pmb.helpers.git.clone, so FETCH_HEAD is always created if it does
not exist (because "git clone" would not create it).

Related: #1829
2020-03-14 19:15:32 +03:00
Oliver Smith c8526f2fcb
pmbootstrap status: basic checks for git repos (!1882)
Extend "pmbootstrap status" with checks for all git repositories,
derived from relevant checks in pmb.helpers.git.pull (using shared
code):
* on official branch
* workdir is clean
* tracking proper remote
* up to date

Related: #1829
2020-03-14 19:15:32 +03:00
Oliver Smith 6977f5f3e5
test.test_helpers_git.test_pull: move prep code (!1882)
Create pmb_test.git.prepare_tmpdir() with preparation code, so we can
use it in a "pmbootstrap status" related test without duplication.
2020-03-14 19:15:32 +03:00
Oliver Smith 5ae6f86a1f
pmb.helpers.git.get_branches_official(): new func (!1882)
Add dummy function that only returns ["master"] for now, so we can use it
in the upcoming git checks for "pmbootstrap status". More sophisticated
logic to figure out the branches will be added soon, see project
direction 2020 issue.

Related: #1829
2020-03-14 19:15:32 +03:00
Oliver Smith 1358424703
pmbootstrap status: print checked out git repos (!1882)
Related: #1829
2020-03-14 19:15:31 +03:00
Jami Kettunen 6877532f5d
envkernel.sh: fix sourcing since pma!1063 merge (!1892)
Change pmaports path `aports/device/device-*` to `aports/device/testing/device-*`
to match the directory structure changes after pmaports!1063 got merged.

Without this change sourcing `envkernel.sh` with up-to-date `pmbootstrap` & `aports` would fail with:

  ERROR: Please select a valid device in 'pmbootstrap init'
  See also: <https://postmarketos.org/troubleshooting>
2020-03-14 16:56:27 +01:00
Oliver Smith a659ba5695
Prepare 1.17.0 release 2020-03-14 08:56:50 +01:00
Minecrell 72fdfeb107
pmb: Fail on device ports directly in device/* (!1879)
Device ports should be under the device/testing/* directory for now.
In the future, devices may be moved to device/{main,community} after
certain preconditions are met.
2020-03-14 08:44:53 +01:00
Minecrell fb8de5a553
pmb: Look for device/* files in device/*/... instead (!1879)
In the future, device ports will be located in a subdirectory
below device/... (e.g. device/testing/device-...).
Replace all occurrences of device/* with a glob that checks the
subdirectories instead.

Note: To ensure that this always works properly we should also add some
checks that all devices are indeed located under one of the supported
subdirectories (i.e. testing/community/main).

Change the glob for pmaports to <aports>/**/APKBUILD.
This allows using subdirectories for organization outside of device/
as well.
2020-03-14 08:44:16 +01:00
Minecrell c399ff81a1
test/test_helpers_pmaports: create empty APKBUILDs for fake packages (!1879)
In general, we should not assume that pmbootstrap considers empty
package directories (without APKBUILD in them). With upcoming changes
this is no longer the case, so lets create an empty file for them.
2020-03-14 08:39:13 +01:00
Minecrell 527f5a9512
Update required Python version to 3.6+ (!1879)
We need Python 3.5+ for recursive (**) globs.
While we are at it, we might as well require Python 3.6
so we can use f-strings in the future.
2020-03-14 08:39:13 +01:00
Daniele Debernardi 5f6b8eaf0e
pmb.qemu: set output="tui" to avoid logging the stdout (!1886) 2020-03-14 08:05:57 +01:00
Daniele Debernardi 9718320829
pmb.qemu: drop --flavor option (!1886)
Since we ask for the kernel flavor during init, only the chosen kernel is
installed, hence there's no need to specify a different one.
2020-03-14 08:05:57 +01:00
Daniele Debernardi a76897b4a1
pmb.qemu: set default image size of 4G (!1886) 2020-03-14 08:05:32 +01:00
Minecrell 7bbc507416
pmb.qemu: use -cpu host for KVM, make configurable with --cpu (!1886)
For KVM the code is run pretty much natively on the host CPU, so all
CPU extensions available on the host CPU can be also used inside the VM.
To expose that information to the VM we should pass "-cpu host", so the
VM is aware of which CPU is in use.

For CPU emulation, QEMU uses a rather minimal CPU on x86_64 by default.
It does not have support for SSE3/4 etc, which may be required for some
applications to work properly (e.g. Android in Anbox). Add a --cpu flag
to make the emulated CPU configurable. Useful values are for example
--cpu max to emulate all implemented CPU features.
2020-03-14 08:05:32 +01:00
Minecrell 76dcf8aa0b
pmb.qemu: add --no-kvm to disable KVM even when available (!1886)
To test QEMU's CPU emulation it is useful to have a switch to disable
KVM, even when it is available (and potentially working fine).

Add --no-kvm for that purpose.
2020-03-14 08:05:32 +01:00
Minecrell 903491f518
test/test_qemu_running_processes: use Alpine virt kernel (!1886)
The QEMU device ports no longer make use of the linux-postmarketos-
stable/mainline kernels, causing the test to fail with

  RuntimeError: Selected kernel (stable) is not configured for device qemu-amd64.
  Please run 'pmbootstrap init' to select a valid kernel.

Let's configure the test to use the "virt" kernel.
2020-03-14 08:05:32 +01:00
Minecrell 345425ef48
test/test_qemu_running_processes: make timeout actually work (!1886)
Just counting the number of tries does not prevent the QEMU tests
from running long periods of time. In some situations, the ssh command
will keep trying to reach the destination almost indefinitely.

To make the 5 minutes timeout work correctly we need to:
  - Add an appropriate ConnectTimeout to the ssh command
  - Don't sleep for another second if ssh already took several seconds
  - Check the elapsed time instead of setting a fixed amount of tries
2020-03-14 08:05:32 +01:00
Minecrell b4678f0882
pmb.qemu: make video resolution configurable + consistent (!1886)
For some reason, the SDL display backend changes the video resolution
to 1024x768, while the GTK display keeps it at 640x480.
This is annoying, because at the moment we can only set one display
resolution for a device in postmarketOS (e.g. for the splash screen).

At the moment, the resolution for the splash screen is set to 640x480,
which therefore shows up too small with the default SDL display.

It seems like the display resolution can be only changed in the guest
directly. Linux has a video= kernel parameter that can be used to
implement this. (See: https://www.kernel.org/doc/html/latest/fb/modedb.html)

Let's set 1024x768 by default, but make it configurable through --video.
2020-03-14 08:05:32 +01:00