Commit Graph

517 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 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
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
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 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
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 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 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
Robert Yang cd7d6a2431 parser: Common function to read the contents of an APKBUILD file (!1747) 2019-02-15 16:21:47 +01:00
Oliver Smith 69e2e22f58 init: fix missing errors if logs didn't initialize (!1755)
Set the log level to DEBUG if args (and therefore logging) failed to
initialize. This causes the default logging handler to be used, and
everything that gets written to the log (error message and trace!) will
get printed to stdout instead of not being printed anywhere at all.

This can be tested by removing x86_64 from the mapping in
pmb.parse.arch.alpine_native() (assuming the host is x86_64). Without
this patch, no meaningful error appears. With the patch, the real error
message, and a stack trace gets printed.
2019-02-15 16:01:11 +01:00
Oliver Smith bda78e42ee
pmb/parse/arch.py: add armv6l -> armhf to mapping (!1756)
Makes it possible to run pmbootstrap on the Raspberry Pi Zero W for
example.
2019-02-13 10:06:47 +01:00
Daniele Debernardi b015b288b8 Add gcc4 cross-compiler support (!1754)
[skip ci]: CI already went through successfully, just rebasing.
2019-02-12 20:57:05 +00:00
Robert Yang 8896209afc
qemu: enable keyboard and mouse for aarch64 (!1750)
Tested keyboard and mouse with weston and mate interface. MATE suffers
from the invisible cursor bug though.
2019-02-11 21:15:02 +01:00
Robert Yang ff4c35a025
qemu: set smp flag to CPU core count (!1751)
The default is single core. Modern PCs have many cores so use them.
2019-02-11 21:03:13 +01:00
Robert Yang 67254b62c4 static code analysis: make it pass flake8 3.7.4 (!1748)
Test with flake8: *.py
./test/check_checksums.py:13:13: E117 over-indented
./pmb/config/init.py:97:8: F632 use ==/!= to compare str, bytes, and int literals
./pmb/parse/arguments.py:229:13: E117 over-indented
2019-02-02 17:36:19 -05:00
Grant Miller 6b4fd9b911 Add completion for `pmbootstrap kconfig` (!1745) 2019-01-23 00:26:45 -06:00