Commit Graph

1449 Commits

Author SHA1 Message Date
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
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
Oliver Smith a3b826b090
CONTRIBUTING.md: we don't always squash anymore (!1746) 2019-02-03 02:16:05 +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
Grant Miller 28be44e657 package_completer: Filter by prefix (!1745) 2019-01-23 00:10:09 -06:00
Grant Miller 72f93f5dfc cosmetic: Change "packagecompleter" to "package_completer" (!1745) 2019-01-23 00:06:27 -06:00
Oliver Smith 1161594e66
Prepare 1.3.0 release
Increase pakage version and minimum required apk version. The latter
should be done with every new release from now on, so we always have a
recent version there. I've updated the pmbootstrep release checklist
accordingly: https://wiki.postmarketos.org/wiki/Pmbootstrap_release
2019-01-22 08:52:40 +01:00
Konrad Dybcio cf2e28d3c2 Switch helpers/envkernel.sh to openssl (!1742) 2019-01-22 08:03:06 +01:00
Clayton Craft 24a565a59b
pmb: increase inode count for rootfs and use a more accurate size (!1743)
This drops the --apparent-size parameter when calculating the size
required for rootfs, which seemed to return a size that was too small
for some devices. This also includes specifying the number of inodes to
support when formatting rootfs.

Fixes #1717
2019-01-21 08:42:22 +01:00
Grant Miller 200cc80a9d aportgen: Add gnu89 patch to all new kernel packages (!1744) 2019-01-20 22:34:09 -06:00
Grant Miller 98b02cb95a Bump minimum pmaports version (!1744) 2019-01-20 22:32:24 -06:00
Ion Agorria 39b3a489ef
pmbootstrap flasher flash_kernel --partition (!1741)
Allow changing the kernel partition for fastboot and heimdall in
deviceinfo and on the fly while doing "pmbootstrap flasher
flash_kernel". Also allow changing the partition for
"... flash_rootfs" with fastboot (this was only possible with
heimdall so far).

Introduce two new deviceinfo variables:
* flash_fastboot_partition_kernel
* flash_fastboot_partition_system

This is useful for devices with dual partitioning that have boot_a
and boot_b.
2019-01-20 01:14:30 +01:00
Oliver Smith 712dd4e20e
bump version to 1.2.0 2019-01-10 22:03:18 +01:00
Clayton Craft 644083c0f7
Allow embedding multiple firmware binaries into SD images (!1739)
This allows embedding multiple firmware binaries into SD images.
Firmware images for most devices that require this functionality consist
mainly of u-boot, but some devices (e.g. librem5) have multiple firmware
images that need to be embedded in the SD image created by pmbootstrap.

This functionality uses two new deviceinfo parameters:
    - deviceinfo_sd_embed_firmware: a comma-separated list of
      binary:offset (where binary is under /usr/share/firmware)
    - deviceinfo_sd_embed_firmware_step_size: The number of bytes for
      each increment of the offset specified in the
      deviceinfo_sd_embed_firmware (typically 1024 or 2048)

deviceinfo_write_uboot_spl has been obsoleted by these new parameters.
2019-01-10 21:41:49 +01:00
Oliver Smith accff27dc3
Cosmetic: pmb.helpers.devices.list -> .list_codenames (!1740)
Rename pmb.helpers.devices.list() to
pmb.helpers.devices.list_codenames(). Python already has a list()
function, so we name our function to make the calls to the codenames
listing function inside pmb/helpers/devices.py less confusing.
2019-01-09 08:11:33 +01:00
Martijn Braam e468d51dae
Fix/add helpers.devices.list_{apkbuilds,deviceinfos}() (!1737)
This fixes list_apkbuilds which is dead code currently but is useful
for external software using pmbootstrap. It also adds list_deviceinfos
which does the same thing but for the deviceinfo data.

The plan is to add an API later, where both functions can be used.
2019-01-09 07:59:45 +01:00
Oliver Smith 50a26dcca4
bump version to 1.1.1
Let's get these bug fixes into the next release.
2019-01-03 08:41:53 +01:00
Robert Yang bd7ea8330e qemu: Use QEMU_MODULE_DIR env variable (!1736)
The upstream patch uses this environment variable. With pmaports temp/qemu
removed, qemu should be run with the env var used in upstream.
2019-01-02 16:48:15 -05:00
Oliver Smith f16bdaf0ca
Update copyright to 2019
Happy new year \o/
2019-01-02 09:31:20 +01:00