Commit Graph

1473 Commits

Author SHA1 Message Date
Luca Weiss 650ed4925e
Fix spelling mistakes (!1794)
codespell --skip="./.git,./aports*"
2019-06-25 09:20:05 +02:00
Alexey Min c0a8675079
build/menuconfig: fix kconfig_edit (!1791)
This fixes regression from commits 0431a519 and 4daf9916.

pmbootstrap kconfig_edit raised an error while trying to checksum a package.

Error was:
(028793) [16:13:22] ERROR: 'module' object is not callable
(028793) [16:13:22] See also: <https://postmarketos.org/troubleshooting>
(028793) [16:13:22] Traceback (most recent call last):
  File "/home/lexx/dev/pmos/pmbootstrap/pmb/__init__.py", line 63, in main
    getattr(frontend, args.action)(args)
  File "/home/lexx/dev/pmos/pmbootstrap/pmb/helpers/frontend.py", line 279, in kconfig
    pmb.build.menuconfig(args, args.package)
  File "/home/lexx/dev/pmos/pmbootstrap/pmb/build/menuconfig.py", line 158, in menuconfig
    pmb.build.checksum(args, pkgname)
TypeError: 'module' object is not callable

The function was renamed, call new function.
2019-06-11 21:59:30 +02:00
Luca Weiss fef10fd5ed
menuconfig: support mtk kernel directory style (!1790)
(Some?) Mediatek kernels don't have the kernel in the top-level
directory but in a subdirectory called 'kernel' next to a folder
'mediatek' containing most device-specific code.

Adjust the menuconfig code to be able to work with that.
2019-05-26 18:18:07 +02:00
Oliver Smith 4daf991640 Remove tests that were moved to pmaports.git (!1787)
Clean up some leftovers from the pmaports.git move.
2019-05-24 21:08:26 +00:00
Oliver Smith 0431a51932
pmb.build.checksum: rename .check() to .update()
Rename the function to .update(), so it is clear what it does, and it is
clear what the difference to .verify() in the same file is.
2019-05-24 22:41:31 +02:00
Oliver Smith b4c301974e
Add pmbootstrap checksum --verify (!1788)
Download all sources and verify their checksums.

This will be used in pmaports.git CI, if ci:skip-build is set in the
commit message (currently it just skips the build, and we don't test if
the source checksums are valid or not).
2019-05-19 22:07:20 +02:00
Oliver Smith 110b5821ac
Prepare 1.6.1 release 2019-05-19 19:46:43 +02:00
Oliver Smith 9cf3e741a1
envkernel.sh: fallback to old armhf hostspec (!1786)
The armhf hostspec triplet has changed during the Alpine 3.6 release
cylcle. It was recently adjusted in abuild's arch_to_hostspec()
function [1]. Cross compilers in postmarketOS that were built with a
previous version of abuild still have the old hostspec in the name.
Since we use the same function in envkernel.sh to get the cross compiler
name, it is currently failing here for armhf.

We can't simply bump the pkgrel to force a rebuild, because that would
make them go out of sync with the upstrem (non-cross) compiler packages.
That would break the workflow for fixing incompatibilities with Alpine
(see [2]).

Add a workaround to envkernel.sh, to detect if the installed armhf cross
compiler binaries still have the old name.

[1] https://github.com/alpinelinux/abuild/pull/56
[2] https://wiki.postmarketos.org/wiki/Repository_maintenance
2019-05-19 19:09:56 +02:00
Oliver Smith f26eb0d9b8
Qemu test: use pmbootstrap --details-to-stdout (!1785)
The qemu test executes a pmbootstrap instance with
pmb.helpers.run.user(). Use the --details-to-stdout flag from now on for
the started pmbootstrap process, so it is not silent when downloading
packages with apk, and will therefore not run into the timeout of the
parent process (which kills processes that are silent for more than five
minutes by default).

This fixes the test in our CI infrastructure.
2019-05-16 23:39:03 +02:00
Robert Yang 0c001567b6
Optionally store git hash in /etc/os-release (!1784)
When git isn't installed then the version is not appended with the git
hash of the pmaports repository.
2019-05-10 16:56:26 -04:00
Daniele Debernardi e8cba8b20a envkernel.sh: Add xz to the list of packages to install (!1783)
This is required when the kernel is configured to be compressed with
something different than gzip.
2019-05-09 22:14:15 +00:00
Oliver Smith de51912ae4
kconfig check: require BLK_DEV_INITRD (!1780)
Always needed for the initramfs, so let's enforce it.
2019-05-09 23:42:23 +02:00
Oliver Smith 8187c66825
Mount /dev/shm in chroots
Fix configure crash when building mozjs60 by mounting tmpfs as /dev/shm
in chroots. This is an important fix, because of this dependency chain,
that is currently broken in armhf and armv7 (see pmaports#244):

postmarketos-base -> networkmanager -> polkit -> mozjs60
2019-05-05 17:47:25 +02:00
Oliver Smith 9bc7236857
test_newapkbuild: disable half test, upstream bug
Half of this test is failing, because of a regression in newapkbuild.

This patch will fix it:
https://github.com/alpinelinux/abuild/pull/75

Until then, let's disable this test, so our testsuite runs through
again. If somebody is curious on how I've developed and tested this
patch with pmbootstrap, I've added a guide to the wiki:
https://wiki.postmarketos.org/wiki/Hacking_on_abuild
2019-05-02 22:37:05 +02:00
Oliver Smith a4733e94e1
pmbootstrap aportgen gcc{,4,6}*: fix depends (!1778)
Explicitly depend on mpc1. Our generated gcc aports use the !tracedeps
option, so we need to explicitly set the libraries it depends on.

This has mostly not been an issue, as we are installing our gcc
packages together with Alpine's gcc package, which causes the libraries
to get installed anyway.

Related: pmaports#236
2019-04-26 22:32:35 +02:00
Robert Yang 82fdf63711
build/envkernel: Fix packaging kernels that don't define a kbuild directory (!1779)
When a kernel APKBUILD doesn't define a kbuild directory then run_abuild
is passed an empty string and not a None value.
2019-04-24 21:07:31 -04:00
Robert Yang 14b68bd260
build/envkernel: Set CBUILD env variable for abuild rootpkg (!1779)
abuild depends on the gcc binary in order to define a default CBUILD value.
When using an alternative gcc version (e.g. envkernel.sh with gcc6), the
gcc binary is not installed by the envkernel.sh script.

This change sets the CBUILD env variable so that abuild doesn't need to
depend on the gcc package.
2019-04-24 21:07:31 -04:00
Oliver Smith 4ae3c4526a
Prepare 1.6.0 release 2019-04-24 15:56:02 +02:00
Luca Weiss c847dfde7c
Improve algorithm to pick package provider (!1775)
Pick the provider with the shortest name instead of always the first one
2019-04-22 20:33:03 +02:00
Oliver Smith 8b8a73e8dd
Fix crash from mixing 'sudo' with 'du' output (!1777)
Do not crash during "pmbootstrap zap" and other actions when the user
needs to type in the sudo password before running "du" to calculate the
work folder size. We're trying to parse the "du" output as integer, but
of course the 'Sorry, try again' message from sudo is not a valid
integer.

$ pmbootstrap --details-to-stdout zap
(008707) [14:00:57] Shutdown complete
(008707) [14:00:57] Calculate work folder size
(008707) [14:00:57] % sudo du --summarize --block-size=1 /home/luca/.local/var/pmbootstrap
[sudo] password for luca:
[sudo] password for luca: Sorry, try again.

12966293504     /home/luca/.local/var/pmbootstrap
(008707) [14:01:03] ERROR: invalid literal for int() with base 10: 'Sorry, try again.\n12966293504'

It would be a good idea to separate the sudo output from the process
output in general, see #1677 for a related proposal.
2019-04-22 00:00:58 +02:00
Oliver Smith fe731d7f5c
fixup! pmb.helpers.package.get: prefer right arch binary (!1776)
Check if ret_repo is None before trying to access it.
2019-04-21 23:22:49 +02:00
Oliver Smith 45c9eaa3ea
pmb.helpers.package.get: prefer right arch binary (!1776)
When the pmaport arch does not match, but there's a matching binary
package, return the binary package instead of the pmaport.

This is needed to fix "pmbootstrap repo_missing" for x86_64
networkmanager-qt, which indirectly depends on mesa (and mesa needs to
be taken from the binary packages for x86_64, not from the pmaports,
see #1741).
2019-04-20 01:58:31 +02:00
Oliver Smith 99e7ae3019
pmb.helpers.package.check_arch(): split (!1776)
Split the part that actually checks the arch against the arches list
into pmb.helpers.pmaports.check_arches(arches, arch), and call it
from pmb.helpers.package.check_arch(args, pkgname, arch, binary).

This will be used in a follow up commit, where we have already resolved
the package data and only need to check the architecture.
2019-04-20 01:58:20 +02:00
Oliver Smith 9241dbb35b
pmb.helpers.package.check_arch_recurse(): fix msg (!1776)
Fix the 'a: (indirectly) depends on b' message, a and b were swapped.
2019-04-20 01:18:58 +02:00
Oliver Smith f82e4fd66b
envkernel: support spaces in path (!1770)
Fixes the following error, when running envkernel.sh from a pmbootstrap
path with spaces:

bash: /home/lofenyy/Root/Cabinet/Projects/Phone: No such file or directory
See also: <https://postmarketos.org/troubleshooting>
2019-04-06 01:20:20 +02:00
Nick Reitemeyer 2df16c5999
Make strict mode available to packages (!1771)
Packages can add pmb:strict to their options to enable the --strict
mode. This can be used if packages need to get build in a clean chroot
or their make dependencies need to get removed.
2019-04-04 19:43:11 +02:00
Nick Reitemeyer b846ccebae
aportgen: add grub_efi generator (!1771)
This repackages Alpine's grub-efi x86 package for all other
architectures. This is required by grub-x86.
2019-04-04 19:40:45 +02:00
Oliver Smith 794e0856be
crossdirect: use native ccache, fix armhf error (!1773)
Depend on new pmaports version, where crossdirect uses the native ccache
binary instead of going through the foreign arch ccache first and then
going through crossdirect.

Old:
ccache (foreign) -> crossdirect (native) -> gcc (native)

New:
crossdirect (native) -> ccache (native) -> gcc (native)

Set the PATH to the crossdirect binaries, and don't set CCACHE_PATH or
CCACHE_COMPILERCHECK from pmbootstrap anymore. crossdirect sets the
CCACHE_PATH to /native/usr/bin now, along with all other required
environment variables. CCACHE_COMPILERCHECK isn't necessary anymore,
because ccache will call gcc directly and therefore be able to use the
file's timestamp and size directly. Also passing that would not work
with the current crossdirect package.
2019-04-03 21:31:02 +02:00
Martijn Braam cea6e70209
Check if the SD card is writable before starting the install (!1772) 2019-03-30 15:12:42 +01:00
Zhuowei Zhang 1fffe83df3
Add "crossdirect": faster cross compiling (!1758)
Launch native cross compilers inside foreign chroot. Enable by default,
but allow disabling with --no-crossdirect for now. This option and the
distcc-sshd related code will be removed in the future.
2019-03-23 01:13:36 +01:00
Oliver Smith 7f9bfee722 Add "pmbootstrap build --no-depends" (!1769)
Aborts the build if any dependencies would have to be build first. This
is useful for build.postmarketos.org, because we want to build exactly
one package in one build job. If dependencies would need to be built, we
made a mistake earlier, and not aborting the build makes it harder to
find that orginal mistake.
2019-03-15 09:58:31 +01:00
Oliver Smith f23afed228 Cosmetic: remove confusing init_buildenv comments (!1769)
Build dependencies don't necessarily get installed for the host arch,
that depends on the build method ("native" or not).
2019-03-15 09:51:41 +01:00
Oliver Smith a798539959
Prepare 1.5.1 release 2019-03-10 02:41:37 +01:00
Oliver Smith d106063fbb Allow installing Alpine's mesa for x86* arches (!1768)
When a pmaport can not be built for the desired architecture, fall back
to the binary package (from postmarketOS or Alpine) if it exists. This
allows us to provide an updated version of mesa for arm arches, but
using Alpine's mesa package on x86* arches.
2019-03-10 02:25:57 +01:00
Oliver Smith c90521a888
aportgen musl-*: use 'busybox tar' in package() too
Follow up to last commit, turns out we need to use it in both functions
or otherwise at least gitlab-ci can fail, as seen in this MR:
https://gitlab.com/postmarketOS/pmaports/merge_requests/270

After using 'busybox tar' instead of 'tar' in both places in the
APKBUILDs, it went through.
2019-03-10 01:59:21 +01:00
Oliver Smith d52fcb9876
aportgen musl-*: use 'busybox tar' in package_dev (!1763)
Use 'busybox tar' to avoid 'tar: Child returned status 141' on some
machines (builds.sr.ht, gitlab-ci).

See pmaports#26.

[skip ci]: already ran through successfully
2019-03-10 01:42:00 +01:00
Oliver Smith c3d0f421e1
Prepare 1.5.0 release 2019-03-03 10:40:03 +01:00
Clayton Craft 27e0a0d33e Add uuu flasher support (!1760)
This adds flasher support for uuu, a utility used by NXP devices for
flashing images.

The flasher expects a uuu command list script to be installed in the
device rootfs at /usr/share/uuu/flash_script.lst.
2019-03-03 10:29:16 +01:00
Bhushan Shah d7d7ccb672
pmb: add u-boot to native_cross_compile list (!1761)
This allows building u-boot much faster, previously it used to build
whole u-boot with distcc+qemu cross-compile, now it builds u-boot on
native chroot using cross-compilers.
2019-03-03 10:03:33 +01:00
Oliver Smith d7ec81a00e repo.py: fix downloading too many APKINDEX files (!1764)
In pmb.helpers.repo.alpine_apkindex_path(), default to
arch = args.arch_native *before* calling pmb.helpers.repo.update().
Because otherwise update() defaults to all arches instead of
args.arch_native.

This caused the APKINDEX files for all arches to get downloaded, as
pmb.chroot.apk_static.init() calls alpine_apkindex_path() without
setting arch = args.arch_native explicitly.
2019-03-02 16:28:39 +01:00
Oliver Smith 008b1761a7 kconfig check: disable CONFIG_KINETO_GAN (!1762)
Related to a proprietary "T-Mobile's WiFi-Calling" feature. It should
not affect normal calls, so it should be safe to disable it. Having it
enabled causes sudo, ip and other commands to hang.
2019-03-02 00:30:08 +01:00
Robert Yang fa40873de2 flasher: Partition blacklisting (!1759)
It is dangerous to flash the boot partition on the Ouya. Doing so can
result in a bricked device. Allow deviceinfo to blacklist partitions from
ever being flashed.
2019-02-28 14:23:34 +01:00
Oliver Smith 2634bbea95
kconfig check: allow skip with !pmb:kconfigcheck (!1753)
Ignore APKBUILDs that have "!pmb:kconfigcheck" in their options by
default in "pmbootstrap kconfig check", but print a note that they have
been skipped. Check all kernels with "pmbootstrap kconfig check -f".

This is necessary, because the Librem 5 devboard kernel's config does
not have CONFIG_DM_CRYPT enabled in their config, and we check for
that. As the device is still under heavy development, we will make our
lives easier by just using the upstream kernel config without any
changes and ignoring it in our check by default.
2019-02-21 19:39:25 +01:00
Oliver Smith 0dc2709768
tests/test_helpers_repo_missing.py: fix test
Adjust the stub function in test_generate_output_format() to accept the
replace_subpkgnames argument, which was introduced in the previous
commit ("repo_missing: return pkgnames, not subpkgnames").

For some reason, this CI test only ran after the MR was merged to master
and not when it ran in the MR's branch. I'm investigating this.
2019-02-19 09:00:29 +01:00
Oliver Smith f3ba0de360
repo_missing: return pkgnames, not subpkgnames (!1757)
"breeze-icons" depends on "qt5-qtbase-dev", but
"pmbootstrap repo_missing" should return "qt5-qtbase" instead.

This patch fixes it, as one can see with:
$ pmbootstrap repo_missing --built breeze-icons --overview
2019-02-16 22:24:32 +01:00
Oliver Smith 5dd53a3e0a
Prepare 1.4.0 release 2019-02-15 16:48:14 +01:00
Robert Yang ab4f3f4004 qemu: Load GTK modules/resources from chroot (!1749)
We are running qemu that is installed in the chroot. The GTK framework
needs to be configured to load resources from the chroot as well.

https://developer.gnome.org/gtk3/stable/gtk-running.html
2019-02-15 16:39:07 +01:00
Robert Yang 43326b551a
envkernel: Add run-script alias to run local scripts within the chroot (!1747)
Example usage:
For kernels that need to run dtbTool after make.
Create a script named post-make.sh in the kernel source directory:

  #!/bin/sh
  dtbTool -s 2048 -p "${srcdir}/scripts/dtc/" -o \
    "${builddir}/arch/arm/boot/dt.img" \
    "${builddir}/arch/arm/boot"

To run this script inside the chroot:
$ source ~/pmbootstrap/helpers/envkernel.sh
$ make lineageos_bacon_defconfig
$ make
$ run-script post-make.sh
2019-02-15 16:24:19 +01:00
Robert Yang a6db644f00
envkernel: Add build command to create an apk package from envkernel (!1747)
Provides a quick way to incrementally compile a kernel and push it to
device.

Example usage.

Compile the kernel:
$ cd /src/linux/
$ source /src/pmbootstrap/helpers/envkernel.sh
$ make tegra_postmarketos_defconfig
$ make -jX

Package kernel and flash to device:
$ pmbootstrap build --envkernel linux-samsung-p4wifi
$ pmbootstrap flasher flash_kernel

Modify kernel source then incremental compile, package, and flash:
$ make -jX
$ pmbootstrap build --envkernel linux-samsung-p4wifi
$ pmbootstrap flasher flash_kernel
2019-02-15 16:24:07 +01:00
Robert Yang 7d7a29d032 parser: Add function to read a function from an APKBUILD (!1747) 2019-02-15 16:21:47 +01:00