Compare commits

..
Author SHA1 Message Date
Oliver Smith 54d94a28ad pmaports.cfg: stable -> v20.05
Related: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2015
2021-06-06 16:07:58 +02:00
Alexey Minnekhanov 2f58606447 cross/busybox-static-*: upgrade to 1.31.1-r20 2021-04-03 02:29:24 +03:00
Bart Ribbers 93ad6d91d6 main/postmarketos-ui-phosh: depend on postmarketos-upgrade-gtk3 (MR 2080) 2021-03-31 16:50:02 +02:00
Bart Ribbers a6491c6261 main/postmarketos-upgrade-gtk3: new aport (MR 2080) 2021-03-31 16:42:03 +02:00
Martijn Braam 083d9dd5bf temp/megapixels: upgrade to 0.15.0 (MR 1979)
This fixes the imagemagick issue on stable by no longer depending on
imagemagick
2021-02-23 23:33:52 -08:00
Oliver Smith 2e302b27ce temp/modemmanager: set arch=all (MR 1886)
In v20.05, the modemmanager version from pmaports is further away from
the one in Alpine, therefore use the pmaports version for all arches.
[ci:skip-vercheck]: use same versions as edge
2021-01-24 17:37:01 +01:00
Dylan Van Assche a8daefb6f7 temp/modemmanager: Fix missing text messages in deep sleep and reduce probing time (MR 1886)
(cherry picked from commit 42e857ab79)
2021-01-24 17:37:01 +01:00
Dylan Van Assche 227e75a584 temp/modemmanager: Upgrade to 1.14.8 (MR 1886)
(cherry picked from commit a7b8e0289b)
2021-01-24 17:37:01 +01:00
Maarten van Gompel d1bb34d5ea temp/modemmanager: Fix sending SMS with UTF-16 characters (MR 1714) (MR 1886)
Upstream: no

Patch recommended by Aleksander Morgado in upstream issue, until a proper
fix is developed:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/274#note_671679

(cherry picked from commit 68ef03efbc)
2021-01-24 17:37:01 +01:00
Minecrell 4091828042 temp/modemmanager: build with a single thread only (MR 1607) (MR 1886)
For some reason, the ModemManager build tends to freeze when built
with QEMU user emulation for arm*. Changing the build to use a single
thread only (-j1) avoids that, although the build is slower of course.

Also limit building to "armhf armv7 aarch64" since the forks are not
needed on any other architectures, to reduce build times a bit. The
other architectures can just use the upstream packages from Alpine.

(cherry picked from commit fca4ec8c01)
2021-01-24 17:37:01 +01:00
Minecrell f2a7a469f0 temp/modemmanager: fork from Alpine (MR 1607) (MR 1886)
Most older Qualcomm SoCs (e.g. MSM8916, MSM8974, ...) communicate
with the modem through shared memory. On mainline kernels these
shared memory channels are exposed through the RPMSG subsystem.

This is different from communication through USB or serial interfaces
that are currently supported by ModemManager.

This commit forks the "modemmanager" package from Alpine and adds
a patch that allows ModemManager to talk to modems through the RPMSG
subsystem.

Working functionality: Calls, SMS, Mobile Data

The same patch has also been submitted upstream:
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/363

(cherry picked from commit 0062418e39)
2021-01-24 17:37:01 +01:00
Oliver Smith 18a927063d temp/libqmi: fork from alpine edge (MR 1886) 2021-01-24 17:36:57 +01:00
Oliver Smith 94c26cc1da temp/libmbim: fork from alpine edge (MR 1886)
Add current version from Alpine edge (1.24.4), as the newer modemmanager
version we are about to package refuses to build with < 1.24.0.
2021-01-24 17:36:11 +01:00
Martijn Braam 2a168992db postmarketos-base: bump release to v20.05.1 (MR 1813)
[ci:ignore-count]
[ci:skip-vercheck]
2021-01-16 14:09:52 +01:00
Clayton Craft 500c2c2a3f device-pine64-pinephone: enable eg25-manager in post-upgrade (MR 1867) (MR 1813)
On existing installs of pmOS, the service should also be enabled...
2021-01-16 14:09:51 +01:00
Martijn Braam b1c9480b5d temp/eg25-manager: fork from Alpine (MR 1813) 2021-01-16 14:09:50 +01:00
clayton craft 77142727d5 device-pine64-pinephone: do not rely on modem-power from kernel (MR 1815) (MR 1813)
This adds eg25-manager for managing modem power in userspace instead of
relying on the modem-power stuff in the kernel. The userspace
eg25-manager has proven to be more reliable than using modem-power.

An older setup-modem script is installed for ofono, since eg25-manager
cannot interface with ofono (yet).

The eg25 init script was removed since it only dealt with configuring
the modem-power driver in the kernel

[ci:skip-build]: already built successfully in CI
2021-01-16 14:09:49 +01:00
clayton craft cb095c1009 linux-postmarketos-allwinner: disable modem-power driver (MR 1815) (MR 1813)
Disabling in favor of controlling modem in userspace (e.g., eg25-manager)

[ci:skip-build]: already built successfully in CI
2021-01-16 14:09:49 +01:00
Martijn Braam af927b2bd5 main/linux-postmarketos-allwinner: Fix mmc numbering for the PineTab (MR 1856) (MR 1813)
[ci:skip-build] already built on CI twice and locally
2021-01-16 14:09:48 +01:00
clayton craft 92edc1bcce postmarketos-mkinitfs: fallback to directfb if osk-sdl fails w/ mesa (1625) (MR 1625) (MR 1813)
[ci:ignore-count]
[ci:skip-vercheck]
2021-01-16 14:09:47 +01:00
clayton craft bc0c95b0ba main/postmarketos-mkinitfs: set no_supertile for osk with mesa (MR 1625) (MR 1813)
This is needed by the librem 5, else the graphics are
distorted/unusable.
2021-01-16 14:09:46 +01:00
Luca Weiss c292d7e023 main/postmarketos-mkinitfs: use kmsdrm sdl backend for osk-sdl (MR 1625) (MR 1813) 2021-01-16 14:09:46 +01:00
clayton craft ba39be1cbb main/osk-sdl: upgrade to 0.60 (MR 1781) (MR 1813) 2021-01-16 14:09:45 +01:00
Martijn Braam 6c49176686 temp/sdl2: backport from alpine (MR 1813)
Backport needed for udev support to fix the touchscreen in osk-sdl
2021-01-16 14:09:44 +01:00
Martijn Braam 5c5735a0e8 temp/{phosh,phoc,libhandy1}: backport from edge (MR 1813)
This new release of phosh with it dependencies brings the swipe to
close feature
2021-01-16 14:09:43 +01:00
Timothee LF 2031f7056a temp/gnome-software: backport Appstream from Alpine and add our own (MR 1688) (MR 1813) 2021-01-16 14:09:39 +01:00
Dylan Van Assche 0c7501844f temp/gnome-control-center: upgrade to 9999_git20201203 (MR 1777) (MR 1813)
[ci:skip-build]: already built successfully in CI
2021-01-08 16:10:33 +01:00
Martijn Braam b25d9ec485 temp/chatty: upgrade to 0.2.0 (MR 1813)
Upgrade to match the latest version from Alpine edge

[ci:ignore-count]
2021-01-08 16:10:33 +01:00
Martijn Braam cd6a3bb2e1 temp/geary: backport to stable (MR 1813)
Taken from 7b8b0ede43
2021-01-08 16:10:32 +01:00
Martijn Braam cd5239778b temp/megapixels: upgrade to 0.13.1 (MR 1813)
Sync with Alpine edge
2021-01-08 16:10:31 +01:00
Bart Ribbers 63fd2bb579 pine64-pinephone: clean setup-modem.sh script (MR 1701) (MR 1813)
Since we now use the in-kernel modem driver of Megi's 5.9 kernel, the
majority of the setup script has become unnecessary. Remove all the now
unnecessary commands and keep it just for enabling VoLTE auto profile
selecting

https://megous.com/git/linux/tree/drivers/misc/modem-power.c?h=orange-pi-5.10#n531
https://megous.com/git/linux/tree/drivers/misc/modem-power.c?h=orange-pi-5.10#n580
https://megous.com/git/linux/tree/drivers/misc/modem-power.c?h=orange-pi-5.10#n610
2021-01-08 16:10:30 +01:00
Luca Weiss 65e01ae411 pine64-pinephone: set deviceinfo_mesa_driver to get fast osk-sdl (MR 1625) (MR 1813) 2021-01-08 16:10:24 +01:00
Martijn Braam d4b6e60e0c device-pine64-pinephone: add autofocus firmware (MR 1656) (MR 1813)
[ci:skip-build]: already built successfully in CI
2021-01-08 14:37:40 +01:00
Martijn Braam db4b216343 main/linux-postmarketos-allwinner: upgrade to 5.10.4_git20210102 (megi's tree) (MR 1813)
Upgrade to the newest 5.10 kernel from megi.

Major changes:
* The RTL8723CS staging wifi driver is switched out to a new one which
  supports monitor mode and more power management features.
* The ANX7688 type-c driver for the PinePhone now communicates with the
  PMIC to actually apply the usb current limit that has been negotiated
  for usb-pd
* The PinePhone panel now runs at 60Hz instead of the ~38Hz it ran at
  before
* The PinePhone modem powermanagement driver has been updated.

Changelog: https://megous.com/git/linux/tag/?h=orange-pi-5.10-20210102-0145
2021-01-08 14:37:39 +01:00
Oliver Smith 93c8f4129b pmaports.cfg: require pmbootstrap 1.28.0 (MR 1522) (MR 1521)
This version doesn't write /etc/os-release anymore in 'pmbootstrap
install'.

(cherry picked from commit 0a9ac24560)
2021-01-07 23:47:37 +01:00
Martijn Braam 46a8a23b9e main/postmarketos-base: ship os-release (MR 1521)
Ship the /etc/os-release file from the postmarketos-base package instead
of having it generated by pmbootstrap.
2021-01-07 23:46:43 +01:00
Bart Ribbers f4b9ea4cde kde/plasma-dialer: add missing oxygen dep for ringtones 2021-01-07 20:15:43 +01:00
Alexey Min 9ccfcbcfd9 cross/musl-*: upgrade to 1.1.24-r10
Upstream commit https://gitlab.alpinelinux.org/alpine/aports/-/commit/908046ad5f96c4c1df5541ff4b0251767e110c85
2020-11-20 12:26:57 +03:00
Dylan Van Assche 7842b44979 Set voice call playback rate to 8000 Hz, closes #864 (MR 1711) (MR 1718)
(cherry picked from commit 9d0c1b48d8)
2020-11-16 17:16:21 +01:00
Pedro Moreno 7c1771b29a Pinephone: Fix excessive mic noise on call (MR 1652) (MR 1706)
Fix ucm2 settings to lower mic boost and increase mic volume.

Fixes: #720
(cherry picked from commit e4366d5f8a)
2020-11-12 07:48:48 +01:00
Oliver Smith f0cca1b32e temp/phosh: upgrade to 0.5.0 (MR 1656)
Co-Authored-By: Martijn Braam <martijn@brixit.nl>
(cherry picked from commit 4247902156)
2020-11-04 22:59:06 +01:00
clayton craft 800d4ca064 temp/phoc: upgrade to 0.4.4 (MR 1681) 2020-11-04 22:58:53 +01:00
clayton craft 8352814a05 temp/wlroots: add head state change patch (MR 1681) 2020-11-04 22:58:34 +01:00
clayton craft bc275e47b1 device-pine64-pinephone: fix suspend with elogind (MR 1636) (MR 1647)
- re-enable console suspend, which seems to be broken with elogind when
  suspending (kernel gets hung up indefinitely in vt_waitactive)

Based on my testing, this option seems to prevent suspending via
elogind (using `loginctl suspend`). When console suspend is disabled,
the kernel gets hung up in the call to vt_waitactive, and elogind times
out trying to suspend.

(cherry picked from commit f7d743a213)
Cherry pick note: the original patch added
elogind-system-sleep_musb-hdrc-quirk.hook, but this isn't needed
anymore, since we have a better fix in the kernel.
[ci:skip-build]: ollieparanoid made sure it builds, and also verified
that it works on the pinephone.
2020-11-02 10:20:58 +01:00
Bhushan Shah fb3ab8e7cb main/linux-postmarketos-allwinner: add patch for suspend hang (MR 1651) (MR 1647)
See thread at: https://lore.kernel.org/linux-usb/20201027045519.GA947883@aquila.localdomain/

Fixes: #839
(cherry picked from commit fe766c43d7)
2020-11-02 10:17:36 +01:00
Oliver Smith a41c671b4b main/postmarketos-welcome-gtk3: upgrade to 0.2.1 (MR 1564)
(cherry picked from commit d9157e1adb)
2020-10-26 09:12:09 +01:00
Oliver Smith c60e00f1f0 main/postmarketos-ui-phosh: add megapixels to _pmb_recommends (MR 1610) (MR 1641)
[ci:skip-vercheck]: doesn't need a rebuild

(cherry picked from commit 757edbd304)
2020-10-25 18:32:17 +01:00
Oliver Smith 98d485f738 temp/megapixels: upgrade to 0.11.1 (MR 1641)
Sync with Alpine edge
2020-10-25 18:32:07 +01:00
Oliver Smith d7e5388396 temp/upower: fork from alpine to apply torch patch (MR 1623) (MR 1641)
Required to make the torch button work in Phosh.

[ci:skip-build]: already built successfully in CI

(cherry picked from commit 80fec94eb8)
2020-10-25 18:31:58 +01:00
Luca Weiss bfd5e53eba temp/phosh: upgrade to 0.4.5 (MR 1623) (MR 1641)
re-fork from Alpine to get upstream packaging changes as well

(cherry picked from commit 65983235e7)
2020-10-25 18:31:40 +01:00
Oliver Smith 45be343e07 temp/libhandy1: new aport (MR 1641)
Fork from Alpine edge, phosh needs this now.
2020-10-25 18:31:32 +01:00
Oliver Smith 70caeac647 temp/phoc: upgrade to 0.4.3 (MR 1641)
Sync with Alpine edge
2020-10-25 18:31:25 +01:00
Oliver Smith 4c3e2d264c temp/wlroots: fork from Alpine edge (MR 1641)
Before upgrading phoc, we need the latest wlroots. Otherwise, the build
fails:

../src/text_input.c:104:11: error: 'struct wlr_text_input_v3' has no member named 'active_features'
  104 |  if (input->active_features & WLR_TEXT_INPUT_V3_FEATURE_SURROUNDING_TEXT) {
2020-10-25 18:31:15 +01:00
Oliver Smith e2d345b624 pine64-pinephone: update devicepkg for 5.9 kernel (MR 1614) (MR 1642)
* update modem init for modem_power
* adjust alsa configs
* remove obsolete megapixels config file

Related: https://xnux.eu/log/#020
Co-Authored-By: Martijn Braam <martijn@brixit.nl>
(cherry picked from commit 517f905b84)
[ci:skip-build]: already built successfully in CI
2020-10-23 18:15:12 +02:00
Oliver Smith c9349f0605 main/linux-postmarketos-allwinner: upgrade to 5.9.1_git20201019 (megi's tree) (MR 1614) (MR 1642)
Switch from the 5.8.x kernel with allwinner specific patches to megi's
5.9 based tree. He drives the PinePhone related kernel development
forward like no other, his tree and changes are well documented on
xnux.eu, and he frequently publishes tested "build this one" commits with
the latest improvements. It makes a faster and less time consuming
workflow to simply package these versions (after a smoke test) into
postmarketOS edge, and after some time to catch possible regressions
ship the same version in postmarketOS stable.

This kernel should make HDMI work for most people, and improve call
quality (thanks to smaeul's patches, which are integrated into megi's
tree).

Kernel config changes:
* Enable MODEM_POWER in the kernel config, among other improvements this
  allows us to get rid of the 30s delay on power off.
* Enable CONFIG_DRM_PANEL_ILITEK_ILI9881C (new PineTab panel)
* Enable CONFIG_ZRAM
* Enable CONFIG_HID_MULTITOUCH

Related: https://xnux.eu/devices/feature/modem-pp.html#toc-modem-power-driver
Changelog: https://megous.com/git/linux/tag/?h=orange-pi-5.9-20201019-1553
Co-Authored-By: Martijn Braam <martijn@brixit.nl>
Co-Authored-By: Clayton Craft <clayton@craftyguy.net>
(cherry picked from commit dcc0a8c855)
2020-10-23 16:17:53 +02:00
Oliver Smith 146aa73de5 temp/chatty: upgrade to 0.1.16 (MR 1618)
Sync with Alpine's aport again.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/13307
2020-10-23 14:18:00 +02:00
Oliver Smith 9a8cc6836a Revert "main/postmarketos-ui-phosh: remove nemo from _pmb_recommends as workaround (MR 1638)" (MR 1639)
Nemo won't pull in mesa-dev anymore, so get rid of the workaround.
This reverts commit 58e951a1bb.
[ci:skip-vercheck]: _pmb_recommends change doesn't need version change
2020-10-23 13:43:47 +02:00
Oliver Smith 162ac55019 temp/nemo: add -dev subpackage (MR 1639)
Like in Alpine edge:
https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/13891

This fixes mesa-dev getting pulled in by installing nemo (which
currently conflicts with mesa-git-dev and causes an apk error, this is a
different issue and will also be resolved soon).
2020-10-23 13:35:16 +02:00
Oliver Smith 58e951a1bb main/postmarketos-ui-phosh: remove nemo from _pmb_recommends as workaround (MR 1638)
Remove nemo temporarily, until #834 is fixed.

[ci:skip-vercheck]: _pmb_recommends change doesn't need version change
2020-10-22 21:59:39 +02:00
clayton craft ce57516757 main/postmarketos-hidden-desktop-entries: add org.gnome.eog (MR 1583)
This application doesn't work 100% when launched from the 'desktop', but
it is still useful as a handler for opening image files from a file
browser, so the icon is hidden.

(cherry picked from commit 6ed62696c9)

[ci:skip-vercheck]: nemo has -r1, even though it's a new package in
                    pmaports. This is on purpose, because it's forked
		    from Alpine's aports and we want to keep it in sync
		    with their version.
2020-10-21 15:55:42 -07:00
Clayton Craft 2cbde0daf2 main/postmarketos-ui-phosh: add eog and Nemo to default apps (MR 1583)
eog is a nice image viewer that works pretty well on a
touchscreen/mobile display.

Nemo is a file manager from the Cinnamon desktop project, which forked
from Nautilus some time ago. It is much more usable than Nautilus on a
touchscreen/mobile display.

Set eog as default app in mimeapps.list, so it even works when hiding
the launcher with postmarketos-hidden-desktop-entries (we'll hide it,
because it doesn't work when opened directly; no image is shown and
opening a file does not work either). The list of associated mimetypes
is taken from here:
https://gitlab.gnome.org/GNOME/eog/-/blob/master/data/org.gnome.eog.desktop.in.in

(cherry picked from commit 0289b633f9)
2020-10-21 15:55:42 -07:00
Oliver Smith 4670cae1dd temp/nemo: fork from Alpine testing 2020-10-21 15:55:42 -07:00
Oliver Smith f48e2709b4 temp/cinnamon-desktop: fork from Alpine testing 2020-10-21 15:55:42 -07:00
Oliver Smith cc76e044a4 temp/xapp: fork from Alpine testing 2020-10-21 15:55:42 -07:00
Luca Weiss c227d28173 temp/feedbackd: fork from Alpine to provide newer version (MR 1616)
The new version has support for the PinePhone notification LED and more.
2020-10-05 17:13:45 +03:00
Oliver Smith 4622b5ec6b temp/megapixels: upgrade to 0.9.0 (MR 1612)
Set arch to all, as it builds for more than just ARM and the author
(Martijn) doesn't plan to make it ARM specific forever. We'd like to
ship this as default in postmarketos-ui-phosh, which is easier with
arch=all as well.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/13006
2020-10-01 12:08:36 +02:00
Bart Ribbers 8e7853c14d firmware-pine64-rtl8723bt: upgrade to 0_git20200705 (MR 1588)
(cherry picked from commit f88001e233)
2020-09-22 16:40:58 +02:00
Martijn Braam 2ac5e8f90a device/pine64-pinephone: remove megapixels config (MR 1587) 2020-09-21 16:54:36 +02:00
Martijn Braam 4a6bb34e86 temp/megapixels: upgrade to 0.7.0 (MR 1587) 2020-09-21 16:54:31 +02:00
Bart Ribbers c7a80bf667 main/postmarketos-mkinitfs: add new trigger for osk-sdl (MR 1563)
We now trigger on files in /usr/share/postmarketos-mkinitfs-triggers.
This can be used by other packages like osk-sdl for which an updated
version would otherwise never be used in the initramfs

(cherry picked from commit 01019884fb)

(fixed conflict wrt pkgver/pkgrel while cherry-picking)
2020-09-19 23:22:44 +03:00
Bart Ribbers 631a37a814 main/osk-sdl: add empty file to mkinitfs triggers directory (MR 1563)
(cherry picked from commit 4f6bec666c)
2020-09-19 23:18:38 +03:00
Bart Ribbers e28e6c1270 temp/megapixels: new aport (MR 1580) 2020-09-15 16:59:19 +02:00
Oliver Smith 7c1bf8f52b pine64-pinephone: add megapixels config (MR 1537) (MR 1580)
Copy of https://git.sr.ht/~martijnbraam/megapixels/tree/master/pinephone.ini
Let's do it like with other device specific configs, and put them into
the device package. It's a short file and it looks like it won't change
often.

(cherry picked from commit 1acf66c8bf)
2020-09-15 16:59:19 +02:00
Oliver Smith 9e9700e8a9 main/linux-postmarketos-allwinner: enable camera related kconfig options (MR 1569) (MR 1580)
(cherry picked from commit 05332c1e0b)
2020-09-15 16:59:19 +02:00
Serge Hallyn 3e5779b378 main/linux-postmarketos-allwinner: enable CONFIG_CGROUP_FREEZER (MR 1569) (MR 1580)
Enable the freezer cgroup. This allows a user to start a large application like
firefox, freeze it to save some power, and unfreeze it to continue using it,
without having to restart the application completely. Stopping and restarting
the application completely results in more battery usage as well as lost state.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
(cherry picked from commit fdd0dfebba)
2020-09-15 16:59:19 +02:00
Clayton Craft a506883463 main/linux-postmarketos-allwinner: enable LED for notifications (MR 1569) (MR 1580)
This config change is necessary for feedbackd to trigger LED
notifications.

fixes #776

(cherry picked from commit 0dc8eb9cce)
2020-09-15 16:59:19 +02:00
Bart Ribbers a23b660620 main/linux-postmarketos-allwinner: upgrade to 5.8 (MR 1569) (MR 1580)
(cherry picked from commit 37f9441e60)
2020-09-15 16:59:19 +02:00
Oliver Smith df16808825 [v20.05] CI: disable build-x86, build-armhf (MR 1581) 2020-09-15 15:54:12 +02:00
Miles Alan 02b422296e Add sxmo/ as an expected directory for gitlab CI directory structure testcase (MR 1472) (MR 1581)
(cherry picked from commit 5aff6dfaa4)
2020-09-15 15:54:08 +02:00
Oliver Smith 6ab8903bef CI: rename stages "first, second" to "lint, build" (MR 802) (MR 1581)
Make it more descriptive and match Alpine's gitlab-ci.yml.

(cherry picked from commit 816616c9de)
2020-09-15 15:54:08 +02:00
Oliver Smith 0b1dc55ab5 CI: build packages on all arches (MR 802) (MR 1581)
Split the aports-build job into arch-specific build-x86_64,
build-aarch64, ... jobs. Extend build_changed_aports.py to accept the
architecture as argument, and to build all packages for that arch where
possible.

Import and use pmbootstrap code for APKBUILD parsing etc, as we do this
already in various testcases running in this repository.

Co-Authored-By: Bart Ribbers <bribbers@disroot.org>
(cherry picked from commit e5b8b8631f)
2020-09-15 15:52:29 +02:00
Oliver Smith 1cf4803c60 CI: remove unused common.check_build() (MR 802) (MR 1581)
The function is also present in build_changed_aports.py, and it is only
used there.

(cherry picked from commit a5b75f3072)
2020-09-15 15:52:29 +02:00
Oliver Smith 86a34811d4 CI: add_pmbootstrap_to_import_path: add import (MR 802) (MR 1581)
Fix error on my machine:
	AttributeError: module 'importlib' has no attribute 'util'

(cherry picked from commit 67c0e167d2)
2020-09-15 15:52:29 +02:00
Oliver Smith d4bd9b9c15 CI: add distfile-check (MR 1388) (MR 1581)
Verify that each distfile has the same hash in a directory full of APKBUILDs.

I've considered merging the new job with aports-static, but since there
are quite a few setup steps, it would make the .gitlab-ci.yml less
readable.

Related: https://gitlab.com/postmarketOS/ci-common/-/blob/master/distfile-check/README.md
(cherry picked from commit 204a56c095)
2020-09-15 15:52:22 +02:00
Oliver Smith e65318f7dd CI: aports-static: remove redundant apk add git (MR 1388) (MR 1581)
install_pmbootstrap.sh is already installing git, and that line can be
used to install additional dependencies (as done currently with pytest).

(cherry picked from commit 76b3512a1c)
2020-09-15 15:52:13 +02:00
Oliver Smith 1a9fc14b52 CI: test_aports_ui: don't take arches from binary (MR 1508) (MR 1529)
Verify _pmb_recommends for architectures listed in the APKBUILD of
postmarketos-ui-* packages, not from their binary packages. Otherwise
disabling an architecture in a merge request will not be respected, as
the binary package still has the arch enabled.

(cherry picked from commit cedd5331e5)
2020-09-10 13:53:53 +02:00
Oliver Smith 0520275b7c hybris: remove (MR 1529)
Libhybris is failing to build for armhf too. Instead of adding !armhf
everywhere, let's just remove it: as it became clear in #703, nobody is
willing to put in the effort to maintain this properly.

If you would like to continue with libhybris on postmarketOS, please
create your own aports repository and put the aports there.

Related: https://wiki.postmarketos.org/wiki/Hybris
Closes: #703, #700, #678
(cherry picked from commit e1a3324e5a)
2020-09-10 13:53:53 +02:00
Antoine Fontaine 4cbc71ca7a ci: check for executable files (MR 1257) (MR 1529)
fix https://gitlab.com/postmarketOS/pmaports/-/issues/593.

(cherry picked from commit 11b60e838b)
2020-09-10 13:53:53 +02:00
Antoine Fontaine 264ab9e638 ci: check that kernels have pmb:cross-native enabled (MR 1247) (MR 1529)
follow up to
https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1910,
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1169 and
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1187.

Fixing the repo is good, but keeping it clean is better. Ensuring it
before merge will avoid yet another fixup commit.

(cherry picked from commit 307f4f19e6)
2020-09-10 13:53:53 +02:00
Daniele Debernardi 3d7ef2e389 CI: return output of common.run_pmbootstrap (MR 1132) (MR 1529)
(cherry picked from commit 233ec0d21c)
2020-09-10 13:53:43 +02:00
Oliver Smith f2cd5f3db4 main/osk-sdl: upgrade to 0.57 (MR 1486)
Also add myself as maintainer, since I've been reviewing quite a few
osk-sdl MRs lately, tagging new versions and upgrading this pmaport.

Related: https://gitlab.com/postmarketOS/osk-sdl/-/tags/0.57
(cherry picked from commit 372f1f8add)
2020-09-10 11:12:48 +02:00
Bart Ribbers ad53487a79 main/ofonoctl: re-add (MR 1544)
This was removed in ad9e8af2a2 due to a
missing dependency (it was only available in testing). However, an user
expressed interest in it so let's just fork the dep to us and re-add
ofonoctl
2020-09-10 10:41:36 +02:00
Bart Ribbers fd3e56bbf4 temp/py3-tabulate: fork from Alpine 2020-09-10 10:41:28 +02:00
Luca Weiss 1f47e97574 pine64-pinephone: add anx7688 module to initramfs for usb keyboards (MR 1555)
The anx7688 module is needed for any USB devices to probe which we want
in the initramfs for unlocking osk-sdl using a USB-connected keyboard.

(cherry picked from commit 3720293639)
2020-09-07 21:33:23 +02:00
Oliver Smith f62c768c84 temp/calls: fork from Alpine edge (MR 1516)
Upgrade from 0.1.5 (current version on Alpine 3.12) to 0.1.7.
2020-09-03 14:36:14 -07:00
Bart Ribbers d08764999c temp/u-boot-pinephone: set RAM block back to 552 (MR 1562)
We were using a frequency of 624 which froze my device and in the past
other units too. Set it back to 552 as before so this doesn't happen
anymore

The patch is being upstreamed, https://gitlab.com/pine64-org/u-boot/-/merge_requests/3
2020-09-03 01:46:29 -07:00
Oliver Smith 0ba7df11ad temp/gnome-software-plugin-apk: upgrade to 0.7.0 (fixup) (MR 1531)
Fix missing pkgrel bump and checksum update.

Fixes: 18b33877 ("temp/gnome-software-plugin-apk: upgrade to 0.7.0")
2020-09-03 01:12:59 -07:00
Oliver Smith 71deb1c26f temp/chatty: upgrade to 0.1.15 (MR 1515) 2020-09-03 00:57:46 -07:00
Oliver Smith 275f8694af Revert "temp/postmarketos-config-firefox: add transition pkg"
This reverts commit 1d1895c0e8.

Causes a segfault (seen by me and PureTryOut), let's revert it for now.

fetch http://postmarketos1.brixit.nl/postmarketos/v20.05/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/APKINDEX.tar.gz
2020-09-01T18:56:32.655 [trace] DbusServer.d:382:updateRepositories Successfully updated repositories.
2020-09-01T18:56:33.858 [trace] DbusServer.d:583:methodHandler Handling method listUpgradablePackages from sender :1.71
2020-09-01T18:56:33.872 [info] Polkit.d:68:queryPolkitAuth Polkit authorized operation dev.Cogitri.apkPolkit.Helper.listUpgradablePackages
2020-09-01T18:56:33.873 [trace] DbusServer.d:331:listUpgradablePackages Trying to list upgradable packages

(process:3403): GLib-CRITICAL **: 18:56:35.137: g_variant_get_child_value: assertion 'index_ < g_variant_n_children (value)' failed
Segmentation fault
2020-09-01 19:00:23 +02:00
Oliver Smith 1d1895c0e8 temp/postmarketos-config-firefox: add transition pkg
Workaround for a bug in apk-polkit, which prevents the renamed package
mobile-config-firefox to replace postmarketos-config-firefox. In the
factory image of the PinePhone we shipped the old package, so add this
transition package so the update works with GNOME software.

Related: https://gitlab.alpinelinux.org/Cogitri/apk-polkit/-/issues/18
2020-09-01 18:37:48 +02:00
Martijn Braam b394879408 main/linux-postmarketos-allwinner: hotfix for hdmi output (MR 1524)
Sloppy patch that makes the displayport alt-mode output signal work on
the PinePhone convergence edition. Proper fix is in the 5.8 tree

[ci:skip-build]: Martijn made sure that it builds and works. This is
		 time critical, so skip the CI build.

(cherry picked from commit 1039f705fb)
2020-09-01 17:02:06 +02:00
Oliver Smith c39d814103 temp/gnome-contacts: fork with purism patches (MR 1514)
Use fork, so we have the call and SMS buttons in the contacts list.

[ci:skip-build]: already built successfully in CI
2020-09-01 15:23:35 +02:00
Oliver Smith 8e2a6e3a3f temp/evolution-data-server: fork to enable libphonenumber (MR 1517)
Follow Alpine edge and enable libphonenumber. This makes the call and
SMS buttons in gnome-contacts work, and fixes selecting contacts in
chatty to start new SMS conversations.
2020-09-01 14:09:37 +02:00
Oliver Smith 4227ad38a6 main/mobile-config-firefox: set maintainer
(cherry picked from commit 5056fcb576)
2020-08-31 10:56:18 +02:00
Bart Ribbers 6ba9532d0b temp/purple-mm-sms: upgrade to 0.1.7 (MR 1471) 2020-08-30 19:05:34 +02:00
Oliver Smith d06adbe1f3 main/mobile-config-firefox: add pkgver to provides (MR 1507)
Fix mobile-config-firefox not replacing postmarketos-config-firefox on
upgrade. Without the pkgver in provides, apk only considers
mobile-config-firefox as virtual package name, not as replacement.

Verified with the CE factory image:

	$ sudo apk upgrade
	...
	(20/29) Purging postmarketos-config-firefox (1-r0)
	(21/29) Installing mobile-config-firefox (1.0.1-r1)
	...

(cherry picked from commit 838d5609ca)
2020-08-28 12:37:14 +02:00
Bart Ribbers 4d74ad1f51 main/postmarketos-base: depend on dnsmasq (MR 1438)
dnsmasq is required by NetworkManager for WiFi Hotspot to work.

(cherry picked from commit aced152afc)
2020-08-23 17:05:13 +02:00
Bart Ribbers c937dcc06d main/postmarketos-base: stop the power key from shutting down devices (MR 1499)
Pressing power button should not power off a device. Although it is
expected on desktops and laptops, it isn't expected on phones and
tablets. Instead it should just turn off the screen or go into a deep
sleep, but that isn't handled by elogind. So let elogind just ignore the
button altogether.

Also re-order the dependencies alphabetically while we're touching the
package anyway

(cherry picked from commit 7b58ed7fce)
2020-08-22 22:45:16 +02:00
Danct12 36f32032e2 temp/u-boot-pinephone: switch to pine64-org/u-boot (MR 1495)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit 5a29944d10)
2020-08-22 10:35:46 +02:00
Oliver Smith 74d586b0f4 temp/gtk+3.0: prevent unexpected downgrade (MR 1500)
Override the library version, so apk does not downgrade the package if
Alpine's package has a higher library version:

	$ sudo apk upgrade
	...
	(15/80) Downgrading gtk+3.0 (9999_git20191223-r0 -> 3.24.22-r0)
	...

[ci:skip-build]: already built successfully in CI
2020-08-22 08:39:27 +02:00
Oliver Smith 836a44ca6d temp/gtk+3.0: rebase on Alpine's APKBUILD (MR 1500)
Use meson instead of autotools and disable building manuals, man pages
and tests. This reduces the cross compile time for aarch64 (which had
forced -j1 before) from ~80 min to ~17 min (!). Most importantly, it
seems to pass every time now (whereas before it would get stuck in
~2 of 3 tries).
2020-08-22 08:39:10 +02:00
Oliver Smith 7feb46f8ab main/mobile-config-firefox: upgrade to 1.0.1 (MR 1501)
(cherry picked from commit c9987d2e30)
2020-08-21 13:10:30 +02:00
Danct12 72f2362a31 community/firmware-analogix: add new firmware (MR 1421)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit da565bb838)
2020-08-19 16:04:09 +02:00
Dolphin von Chips a313b703bb CI: allow running testcases with pmbootstrap from pip (MR 1467)
(cherry picked from commit 178558cb3d)
2020-08-15 21:06:05 +02:00
Dolphin von Chips d99387032f CI: check if packages in _pmb_recommends exist (MR 1467)
(cherry picked from commit 2bfb1417f7)
2020-08-15 21:06:05 +02:00
Antoine Fontaine dcc35c49e1 main/postmarketos-ui-plasma-desktop: fix dependency name (MR 1466)
(cherry picked from commit 5aa6d12268)
2020-08-15 21:06:00 +02:00
Oliver Smith d0ee389e77 main/postmarketos-ui-plasma-mobile: update _pmb_recommends (MR 1492)
[ci:skip-vercheck]: _pmb_recommends change doesn't need pkgrel bump

(cherry picked from commit af2f2e23a4)
2020-08-15 18:57:16 +02:00
Oliver Smith d2a855dd85 main/postmarketos-ui-phosh: no scaling for firefox (MR 1492)
With the new mobile-config-firefox, the window width is small enough
that the window does not need to be scaled. This looks better overall,
and avoids scaling glitches.

(cherry picked from commit fef3af0d75)
2020-08-15 18:57:16 +02:00
Oliver Smith fb494c88c4 main/postmarketos-ui-phosh: update _pmb_recommends (MR 1492)
(cherry picked from commit 4024d9a770)
2020-08-15 18:57:16 +02:00
Oliver Smith ac0ee64c31 main/{postmarketos => mobile}-config-firefox: replace (MR 1492)
New version does not just support Firefox 68 (firefox-esr in Alpine 3.12),
which is going to be EOL soon. It also supports the new ESR 78
(firefox-esr in Alpine edge, soon also in 3.12, supported until ~2021-04)
and 79 (current stable "rapid release" version; firefox in Alpine edge).

The source was moved to a dedicated git repo, so other distributions can
also use it. Keep the distro-specific links here in a separate HTML
file, so they can be modified without changing
mobile-config-firefox.git.

Related: https://gitlab.com/postmarketOS/mobile-config-firefox
(cherry picked from commit 56b9ddc27e)
2020-08-15 18:57:11 +02:00
Oliver Smith 194d9c0010 temp/phosh: fix build for armv7
Apply patch from upstream to fix the build. While at it, rename the pmOS
specific patch from 0002-* to 0001-*.
2020-08-12 18:14:50 +02:00
Bart Ribbers 75c430cf9b temp/phoc: upgrade to 0.4.2 (MR 1476) 2020-08-12 15:51:32 +02:00
Bart Ribbers ebea7af6c4 temp/phosh: upgrade to 0.4.3 (MR 1476) 2020-08-12 15:51:32 +02:00
Martijn Braam 468bc8a84e main/postmarketos-mkinitfs: fix error on missing dtb (MR 1491)
(cherry picked from commit 87a009a9b8)
2020-08-11 10:58:11 +02:00
Oliver Smith 6b6bd979ea treewide: avoid "More than one maintainer" error (MR 1480)
Alpine's abuild is soon going to complain if an APKBUILD has more than
one "Maintainer:" listed. Work around it by renaming the additional
maintainers to "Co-Maintainer:". While at it, move the devicepkg reference
link to the top in device-xiaomi-santoni for consistency.

In postmarketOS, we require at least two maintainers for devices in
main, therefore it does not make sense to drop additional maintainers
from the file.

In Alpine, this change was made because pkgs.alpinelinux.org apparently
can't handle more than one maintainer. I looked into it, and it would
require a database change to add it there, so it does not seem worth the
effort. I also thought about extending abuild to add an environment
variable to skip the check, but then the package would not build with
plain abuild without using the env var.

Related: https://gitlab.alpinelinux.org/alpine/abuild/-/commit/dd4cd9d606f5e28f382414e258af562e346c6ab5
[ci:skip-build] [ci:skip-vercheck]

(cherry picked from commit dbf4d13907)
2020-08-08 22:16:15 +02:00
Bart Ribbers 17fa587815 temp/gtk+3.0: upgrade to 9999_git20200616 (MR 1477) 2020-08-05 11:43:59 +02:00
Bart Ribbers 0dab1e636d pine64-pinephone: enable VoLTE (MR 1434)
Also fix configuring device sleep wakeup when modem receives a call

(cherry picked from commit 15acd86d60)
2020-08-04 12:27:07 +02:00
Oliver Smith ca70996603 Revert "temp/newlib-stage1: enable on aarch64 (MR 1464)"
This reverts commit ae413af003.
[ci:skip-vercheck] [ci:skip-build]
2020-08-04 09:52:08 +02:00
Oliver Smith 23989c3a5b Revert "temp/gcc-cross-embedded: enable on aarch64 (MR 1464)"
This reverts commit 66a3ceacb9.
2020-08-04 09:51:58 +02:00
Oliver Smith 8d95279325 Revert "temp/gcc-cross-embedded-stage1: enable on aarch64 (MR 1464)"
This reverts commit cf8ad3bdf5.
2020-08-04 09:51:49 +02:00
Oliver Smith 8d659ba0d9 Revert "temp/binutils-cross-embedded: enable on aarch64 (MR 1464)"
This reverts commit 57fdbda072.
2020-08-04 09:51:31 +02:00
Tilman Lacko ae413af003 temp/newlib-stage1: enable on aarch64 (MR 1464)
[ci:skip-vercheck]: only arch modified
[ci:skip-build]: already built successfully in CI
2020-08-03 15:29:54 +02:00
Tilman Lacko 66a3ceacb9 temp/gcc-cross-embedded: enable on aarch64 (MR 1464) 2020-08-03 15:29:23 +02:00
Tilman Lacko cf8ad3bdf5 temp/gcc-cross-embedded-stage1: enable on aarch64 (MR 1464) 2020-08-03 15:29:18 +02:00
Tilman Lacko 57fdbda072 temp/binutils-cross-embedded: enable on aarch64 (MR 1464) 2020-08-03 15:29:11 +02:00
Oliver Smith 2f6530a6f1 temp/android-tools: fork from Alpine
Use "make -j1", because cross compiling gets stuck otherwise. I have
verified, that this builds for x86_64, aarch64, armv7.
2020-08-03 14:40:04 +02:00
Bart Ribbers 18b33877a9 temp/gnome-software-plugin-apk: upgrade to 0.7.0
Make sure we have a higher and newer package then Alpine stable
2020-08-02 11:17:59 +02:00
Danct12 084f024c4c device-pine64-pinephone: make the proximity sensor usable within iio-sensor-proxy (MR 1416)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit 76cade06e1)
2020-07-31 18:08:45 +02:00
Luca Weiss f337ef4e1c temp/phosh: add patches for volume button support (MR 1451)
Nr 3 & 4 are technically not needed (nice anyways) but without them the
other patches don't apply cleanly.
2020-07-28 15:23:27 +02:00
Luca Weiss 254c4ad434 temp/phoc: add patch for volume button support (MR 1451) 2020-07-28 15:23:22 +02:00
Oliver Smith ec23a657b5 main/postmarketos-ui-phosh: open links in firefox (MR 1455)
Add mimeapps.list, so links clicked in postmarketos-welcome and other
applications properly open in firefox. Without this patch, they just
don't open at all.

Bump the pkgver instead of the pkgrel, so the APKBUILD is in sync again
on both master and v20.05 (right now, the pkgrel on v20.05 is ahead by
one, otherwise the file is the same).

Related: https://help.gnome.org/admin/system-admin-guide/stable/mime-types-application.html.en
(cherry picked from commit f1680651ea)
2020-07-26 10:46:09 +02:00
Oliver Smith d42286c08d main/postmarketos-ui-phosh: no gnome-software first run dialog (MR 1453)
Disable the first run screen in GNOME software, which invites the user
to browse and install apps. We do not want people to use GNOME software to
do that when they open it for the first time in postmarketOS after
installing, we want them to do updates. So this dialog is misleading for
our users, and will lead to a bad experience for those who follow what
it suggests.

I think there's more wrong with that dialog (in context of postmarketOS),
more detailed reasoning and screenshot in:
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1449#note_385456592

(cherry picked from commit 9bc80e151f)
2020-07-26 09:07:55 +02:00
Luca Weiss ecbe3abfaa temp/gnome-calculator: new aport (MR 1450)
Use version from Purism with mobile patches
2020-07-25 15:30:10 +02:00
Oliver Smith f89f5cebd4 main/postmarketos-hidden-desktop-entries: add FF-ESR safe mode (MR 1448)
Firefox ESR Safe Mode has another name for the .desktop file, hide it as
well.

(cherry picked from commit f6cdacfe53)
2020-07-24 18:43:40 +02:00
Martijn Braam 9fc14d21aa main/postmarketos-ui-plasma-mobile: add firefox config (MR 1445)
While at it, sort _pmb_recommends alphabetically.

[ci:skip-vercheck]: only _pmb_recommends changed

(cherry picked from commit 81eb346b87)
2020-07-24 17:34:07 +02:00
Martijn Braam b59c638d5a main/postmarketos-ui-phosh: add firefox config (MR 1445)
Replace firefox with firefox-esr, remove epiphany. With the current
version of epiphany, the postmarketOS wiki doesn't even load every time,
so that's not something we want to ship.

(cherry picked from commit 6279468f78)
2020-07-24 17:33:57 +02:00
Oliver Smith a6eae55e82 main/postmarketos-config-firefox: new aport (MR 1445)
Add policies.json and prefs.js to configure Firefox (yes, you need both
to be able to control all this):

Mobile improvements:
* Enable zooming with fingers
* Mobile user agent (from tor browser for android)

Privacy improvements:
* Disable search suggestions, so URLs do not get sent to search engines
  as they are getting typed.
* Disable Firefox studies
* Disable Telemetry
* Set DuckDuckGo as default search engine, not Google

Uncluttering (screen space, remove broken features, less distractions):
* Move all buttons to the overflow menu and remove spacers around the
  address bar
* Empty "new tab" page (loads faster, no annoying "top sites" etc.)
* Disable developer tools, so the hamburger menu fits the screen of the
  pinephone. These aren't really useful on phones anyway.
* Disable "Firefox Screenshots": the feature did not work with the mobile
  resolution in Phosh.
* No default bookmarks from Firefox
* Disable First Run Page
* Disable Post Update Page
* Disable "User Messaging" (What's new, Extension/Feature
  Recommendations, Urlbar Interventions)

Add a local html file that serves as lightweight default homepage. It
links to the postmarketOS blog and wiki, explains that this is desktop
firefox with mobile configuration and explains how to change settings
and install addons (with a direct link to ublock origin). Users can
override the homepage, new tab page, search engine, search suggestions
pre-configured by this package directly in the UI.

I chose Firefox ESR, because:
* It fits the screen better: the "new tab" button is bigger, the menu
  opening when you click the top-right button actually fits the screen,
  with all its submenus. There are zoom controls in the same menu, which
  make the preferences pages very usable.
* It's possible to override the default search engine with a policy
  file; that's not possible in non-ESR firefox (we'd probably need to
  change it in the sources).

Related: https://github.com/mozilla/policy-templates
Co-authored-by: Martijn Braam <martijn@brixit.nl>
(cherry picked from commit 9b2a0a796d)
2020-07-24 17:33:43 +02:00
Luca Weiss a6da8fb2db temp/phosh: hide logout action, add reboot action (MR 1443) 2020-07-24 14:06:34 +02:00
Oliver Smith d8ce78b462 main/postmarketos-ui-{phosh,plasma-mobile}: hide desktop icons (MR 1437)
[ci:skip-vercheck]: _pmb_recommends changes don't need a rebuild

(cherry picked from commit 24b7576bbb)
2020-07-24 14:03:45 +02:00
Oliver Smith aaa3c4c6c6 main/postmarketos-hidden-desktop-entries: new aport (MR 1437)
In phosh, we have broken Cheese (Camera) and Extensions (from GNOME shell)
icons in the launcher. They get dragged in via dependencies, so the
easiest way to disable them is just overruling the .desktop icon. We can
make Cheese visible again in a post-install script (just check if it
points to nodisplay.desktop and delete the link) once we have it working.

Hide icons for terminal programs (htop, nvim, vim) as well as "Firefox
Safe Mode" too. If somebody really wants to use the FF safe mode, they
can do so via terminal.

Have a simple initial version, maybe make it more sophisticated with
UI-specific hidden icons later (right now, it doesn't make sense to
install this in normal GNOME, because there you would need
org.gnome.Extensions). (There is "NotShowIn=phosh" (untested), but using
this would mean that we need to keep all the information of the original
desktop file for the UIs that will display them; we can't just use the
symlink trick. I'm not sure if we want that at all, but it's
definitively over-engineered for now.)

(cherry picked from commit 2cd60bfddf)
2020-07-24 14:02:56 +02:00
Oliver Smith 3506c41032 main/postmarketos-ui-phosh: add first run screen (MR 1441)
[ci:skip-vercheck]: only modified _pmb_recommends

(cherry picked from commit 8a3f6a5a46)
2020-07-24 13:46:10 +02:00
Oliver Smith 142d79d889 main/postmarketos-welcome-gtk3: upgrade to 0.2.0 (MR 1441)
Run automatically on first login, update text, put proper title and icon
in desktop launcher.

(cherry picked from commit 03abcef25b)
2020-07-24 13:46:06 +02:00
Bart Ribbers 97d5041cea temp/phosh: upgrade to 0.4.1 (MR 1417)
[ci:skip-build]: already built successfully in CI
2020-07-23 20:33:48 +02:00
Bart Ribbers 190877d6cb temp/phoc: upgrade to 0.4.1 (MR 1417) 2020-07-23 20:33:48 +02:00
Antoine Fontaine dec474dc97 main/postmarketos-ui-phosh: enable bluetooth support (MR 1352) (MR 1417)
Fixes https://gitlab.com/postmarketOS/pmaports/-/issues/529.

(cherry picked from commit e2d1438815)
2020-07-23 20:33:38 +02:00
Oliver Smith 066f19ac21 temp/xdg-user-dirs: fork from Alpine
postmarketos-ui-{phosh,plasma-mobile} have it in their _pmb_recommends
now.
2020-07-22 13:07:02 +02:00
Bart Ribbers aaf133ab15 main/postmarketos-ui-phosh: use xdg-user-dirs (MR 1432)
(cherry picked from commit aacc7ca8a4)
2020-07-22 12:02:03 +02:00
Bart Ribbers 7b18e24238 main/postmarketos-ui-plasma-mobile: use xdg-user-dirs (MR 1432)
(cherry picked from commit ad734ac4f9)
2020-07-22 12:01:55 +02:00
Oliver Smith f03d7a6948 device/*/device-*: bump pkgrel for machine-info
Generate /etc/machine-info with the new devicepkg-dev package, that has
just been cherry-picked to v20.05.
2020-07-22 11:03:52 +02:00
Luca Weiss 772ae5dda5 main/devicepkg-dev: generate /etc/machine-info (MR 1246)
(cherry picked from commit 7fc1292b9b)
2020-07-22 11:03:47 +02:00
Oliver Smith 677b2900b2 main/postmarketos-mkinitfs: fix device sed regex (MR 1436)
The p? is not redundant. Without it, the p in mmcblk0p2 for example does
not get cut off, meaning the resulting device is not "mmcblk0" but
"mmcblk0p". My bad, sorry for the breakage.

Fixes: 9f6600ba ("main/postmarketos-mkinitfs: rm pmOS_deleteme")
Fixes: 9d86f6fe ("main/postmarketos-mkinitfs: resize: unallocated space check, even if forced")
(cherry picked from commit bfa705b745)
2020-07-22 09:28:41 +02:00
Oliver Smith c6913666ae pine64-pinephone: use PMOS_FORCE_PARTITION_RESIZE (MR 1428)
Automatically resize the root partition, if it is followed by
unallocated space.

(cherry picked from commit 802add79d4)
2020-07-21 23:19:00 +02:00
Oliver Smith 05bd81cf9b main/postmarketos-mkinitfs: rm pmOS_deleteme (MR 1428)
Remove the "pmOS_deleteme" partition left behind by the on-device
installer, if it exists. Let the existing resize_root_partition() extend
the root partition over the newly gained space (and rest of the storage
device) right afterwards.

(cherry picked from commit 9f6600ba18)
2020-07-21 23:18:51 +02:00
Oliver Smith aab032e6aa main/postmarketos-mkinitfs: resize_root_partition: update comment (cosmetic) (MR 1428)
(cherry picked from commit b55d95f3a9)
2020-07-21 23:18:42 +02:00
Oliver Smith 3fe62bfa34 main/postmarketos-mkinitfs: resize: unallocated space check, even if forced (MR 1428)
In resize_root_partition(), put the unallocated space check into an
extra function has_unallocated_space(). Run it even if
PMOS_FORCE_PARTITION_RESIZE is used, so we don't attempt to resize the
partition if there is no free space.

While at it, change "sed 's/p?2$//'" to "sed 's/2$//' in an already
modified line, because it means the same thing and is less confusing
(? in regex means: 0 or 1 time).

(cherry picked from commit 9d86f6fe92)
2020-07-21 23:18:27 +02:00
Matej Ľach ae7abe75ab temp/phoc: install the scale-to-fit helper (MR 1431) 2020-07-21 11:09:13 +02:00
Oliver Smith 8ace569db0 pine64-pinephone: fix setup-modem.initd (MR 1427)
The OpenRC service failed with the following error, as shown on serial:
	command_background option used but no pidfile specified

(cherry picked from commit c19d5dfc26)
2020-07-20 20:22:50 +02:00
Bart Ribbers bb40afc0dd main/postmarketos-ui-xfce4: use _pmb_recommends (MR 1426)
(cherry picked from commit f343c6b011)
2020-07-20 19:19:32 +02:00
Bart Ribbers 1e6bdb3ef6 main/postmarketos-ui-weston: use _pmb_recommends (MR 1426)
(cherry picked from commit c759f7168e)
2020-07-20 19:19:32 +02:00
Bart Ribbers 8b821594fa main/postmarketos-ui-sway: use _pmb_recommends (MR 1426)
(cherry picked from commit 56abe23715)
2020-07-20 19:19:32 +02:00
Bart Ribbers 0d53ad9328 main/postmarketos-ui-plasma-mobile: use _pmb_recommends (MR 1426)
Also remove trojita as requested by Bhushan Shah

(cherry picked from commit d9d439a9ff)
2020-07-20 19:19:32 +02:00
Bart Ribbers 402355e51e main/postmarketos-ui-plasma-desktop: use _pmb_recommends (MR 1426)
(cherry picked from commit 83e97bd4fe)
2020-07-20 19:19:32 +02:00
Bart Ribbers 44124b3cab main/postmarketos-ui-phosh: use _pmb_recommends (MR 1426)
(cherry picked from commit dba56461f2)
2020-07-20 19:19:32 +02:00
Oliver Smith b66064edaf main/postmarketos-ondev: upgrade to 0.2.1 (MR 1423)
Most importantly, this makes the on-screen keyboard work reliably.

Related: https://gitlab.com/postmarketOS/postmarketos-ondev/-/tags/0.2.1
(cherry picked from commit 63226cf9b5)
2020-07-20 16:32:57 +02:00
Oliver Smith b9c874774f pmaports.cfg: require pmbootstrap 1.22.0
Require new version, which supports _pmb_recommends.

Related: pmbootstrap#1933
(cherry picked from commit 2a1fa1cf20)
2020-07-20 15:00:25 +02:00
Luca Weiss 164efeb854 temp/u-boot-pinephone: apply patch for 3GB RAM support (MR 1420)
(cherry picked from commit 9a878ee7ee)
2020-07-18 22:06:28 +02:00
Bart Ribbers 332f855a93 temp/gnome-control-center: fork from Alpine to apply mobile patches (MR 1419) 2020-07-18 15:38:43 +02:00
Martijn Braam 163a42effc pine64-pinephone: add multiple dtbs (MR 1163)
(cherry picked from commit 957dc9356a)
2020-07-16 23:59:20 +02:00
Martijn Braam cf3153eb5b main/postmarketos-mkinitfs: allow multiple dtbs (MR 1163)
Allow setting multiple dtb filenames in the deviceinfo seperated
by spaces

(cherry picked from commit 2fb6d11f91)
2020-07-16 23:59:20 +02:00
Bart Ribbers 6823479b18 pine64-pinephone: setup modem to wake device (MR 1163)
(cherry picked from commit dff419cf10)
2020-07-16 23:59:19 +02:00
Bart Ribbers c5f26eeb65 temp/u-boot-pinephone: add crust firmware (MR 1163)
(cherry picked from commit a1aae9ff47)
2020-07-16 23:59:19 +02:00
Martijn Braam 3c868bc254 main/crust: new aport (MR 1163)
(cherry picked from commit 5ac381fc46)
2020-07-16 23:59:15 +02:00
Oliver Smith a09d92d8c2 main/postmarketos-ui-{gnome,phosh}: less revealing epiphany user-agent (MR 1402)
Make it less trivial to fingerprint users of the epiphany browser on
postmarketOS, by replacing the postmarketOS specific user-agent with an
user-agent from a current pixel device.

Old:
	Mozilla/5.0 (postmarketOS device, like iPhone; X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15 Epiphany/605.1.15

New:
	Mozilla/5.0 (Linux; Android 10; Pixel) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.96 Mobile Safari/537.36

Taken from the following page. Note that this seems to be one of the few
cases, where not a full android build ID is included. Which makes it a
bit harder to fingerprint. Not as good as the tor browser one, but with
that one we'd have to pretend that a webkit browser is firefox.

https://developers.whatismybrowser.com/useragents/explore/operating_platform/pixel/2

Related: https://blog.torproject.org/browser-fingerprinting-introduction-and-challenges-ahead
Related: https://developer.chrome.com/multidevice/user-agent
Related: https://webaim.org/blog/user-agent-string-history/
(cherry picked from commit 2722f6cac5)
2020-07-15 13:43:34 +02:00
Bart Ribbers 5ad58ff0be temp/gnome-software-plugin-apk: add missing dep on alpinelinux-appstream-data (MR 1414) 2020-07-14 14:37:40 +02:00
Bart Ribbers 28365e0978 main/postmarketos-ui-phosh: add gnome-contacts to depends (MR 1415)
(cherry picked from commit e3e4b01add)
Signed-off-by: Bart Ribbers <bribbers@disroot.org>
2020-07-14 14:29:37 +02:00
Bart Ribbers 6ad46e30ed temp/chatty: fork from Alpine to upgrade to a newer release (MR 1413) 2020-07-14 14:25:49 +02:00
Bart Ribbers 2491984432 temp/purple-mm-sms: fork from Alpine to upgrade to a new release 2020-07-14 14:25:49 +02:00
Martijn Braam f3c6247f43 device/pine64-pinephone: use the correct ucm path for older pulseaudio (MR 1412) 2020-07-14 14:23:26 +02:00
Oliver Smith 00f73eeff4 temp/newlib-stage1: fix depends
Make the newlib-stage1 meta-package depend on newlib-or1k-elf-stage1
instead of newlib-or1k-elf. Otherwise, the meta-package could not be
installed in postmarketOS, v20.05 branch, because we have only forked
newlib-stage1 and not newlib. This is a bug in the upstream aport too.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/10318
2020-07-14 10:25:10 +02:00
Oliver Smith 59a374f6f9 temp: add or1k-elf cross-embedded toolchain
Fork gcc-cross-embedded and dependencies from Alpine edge. Limit it to
only build or1k-elf from x86_64, because that's what we need to build the
crust firmware for the pinephone. More architectures could be enabled on
demand. I've verified that this builds before pushing, and that it's
possible to build crust from the open merge request with this toolchain.
2020-07-14 00:54:16 +02:00
Oliver Smith b917f76531 main/postmarketos-base: keep /etc/fstab (MR 1398)
Only add a comment, do not try to mount the root or boot partitions
anymore. The initramfs is doing this already.

Related: https://postmarketos.org/fstab
(cherry picked from commit 784782f543)
2020-07-14 00:45:41 +02:00
Oliver Smith 11da9f51f9 main/postmarketos-mkinitfs: mount /sysroot/boot (MR 1398)
Mount the boot partition at /sysroot/boot and keep it mounted, when
running the switch_root command. This way, OpenRC doesn't need to mount
it and possibly use the wrong partition. The OpenRC service does not use
the same logic to find the boot partition, in particular it does not
support the pmos_boot kernel parameter.

While at it, print the mountpoint and read-only/read-write arguments in
the mounting log message for both root and boot.

Fixes: #664
(cherry picked from commit 863ec713ba)
2020-07-14 00:45:32 +02:00
Oliver Smith cc95140b96 main/postmarketos-base: rm write_unless_modified (MR 1398)
Get rid of the "write_unless_modified" code, which was supposed to only
change /etc/fstab, /etc/issue, /etc/motd if the user did not modify it.

This is nice in theory, but we have a bug report where the code did not
do what it should (apk audit possibly failed due to a qemu bug?), and
then it lead to strange bugs related to not having the expected
/etc/fstab installed.

Fixes: #661, #258
(cherry picked from commit 58ae4df2ef)
2020-07-14 00:45:25 +02:00
Federico Amedeo Izzo acc021adcd {nokia-n900,samsung-i9070}: move swclock initial timestamp back to postmaketos-base.post-install (MR 1166)
(cherry picked from commit b6ea0ba1de)
2020-07-14 00:45:03 +02:00
Federico Amedeo Izzo 472ab0b435 */*: add missing exit 0 in post-install scripts (MR 1166)
(cherry picked from commit 859772a915)
2020-07-14 00:44:17 +02:00
Federico Amedeo Izzo b25292607a postmarketos-base: disable swclock for all devices, enable it for nokia-n900 and samsung-i9070 (MR 1166)
(cherry picked from commit 0e502a5139)
2020-07-14 00:43:30 +02:00
Luca Weiss 47849bdca4 treewide: chmod -x files (MR 1237)
We don't want executable APKBUILDs, deviceinfo files, etc in pmaports.
Remove the executable bit from those files.

[ci:skip-build]
[ci:skip-vercheck]

(cherry picked from commit e350b00b9b)
2020-07-14 00:39:39 +02:00
Bart Ribbers e446bb9741 temp/evince: fork from Alpine to apply Purism's mobile patches (MR 1390) 2020-07-12 13:54:39 +02:00
Oliver Smith 2e71c343cb main/postmarketos-welcome-gtk3: new aport (MR 1381)
Add a simple welcome screen app, that we should eventually display when
starting Phosh for the first time (needs to be done in a different
patch).

(cherry picked from commit cb3f7f22ea)
2020-07-12 02:29:46 +02:00
Oliver Smith 4753cf3540 */linux-*: enable CONFIG_CRYPTO_XTS (MR 1405)
Enable CONFIG_CRYPTO_XTS for each kernel, so we can switch to using
aes-xts-plain64 as default cipher for cryptsetup (override with
"pmbootstrap --cipher"), instead of aes-cbc-plain64 (pmbootstrap#1940).

I have executed "pmbootstrap kconfig edit" on each kernel, and manually
toggled the option. The diff is not always clean, because for some
kernels it is apparently the first time, that menuconfig was executed on
the configs like that. In a few instances, it turned out that
CONFIG_ANDROID_PARANOID_NETWORK needed to be disabled too (this is
already a requirement, but as the config was incomplete, it was not
visible that this option was enabled). Very few times, I had to enable
CONFIG_EXPERIMENTAL in order to see and enable CONFIG_CRYPTO_XTS.

It would be great if we could automate such mass kconfig edits in the
future, see pmbootstrap#1942.

[skip ci]: I have verified, that every single one of these kernels builds.
           CI will likely run out of time while downloading source tarballs.

(cherry picked from commit 0cfcc52e0d)
2020-07-11 15:57:03 +02:00
Minecrell 3f932b85ae main/linux-postmarketos-stericsson: upgrade to 5.8-rc2 (MR 1360)
- Update to Linux 5.8-rc2
- samsung-golden: Add magnetometer/proximity sensor, touchkeys

(cherry picked from commit 51e97f026b)
2020-07-11 15:56:26 +02:00
Minecrell a8336387d6 main/linux-postmarketos-stericsson: rename from -novathor (MR 1360)
In the Linux kernel, the ST-Ericsson NovaThor U8500 SoC is barely
ever mentioned under the "NovaThor" name, more common are names like
U8500, Ux500, ST-Ericsson, STE, ...

Let's rename the kernel package to linux-postmarketos-stericsson
to make that more clear. Also cleanup the APKBUILD a bit while we're
at it, HOSTCC is unneeded, remove unnecessary depends, ...

(cherry picked from commit caa2018bce)
2020-07-11 15:56:12 +02:00
Pellegrino Prevete 7452c1afa9 linux-postmarketos-qcom-msm8974: enable CONFIG_USER_NS (MR 1282)
This fixes GNOME Web on the hammerhead and other devices using this
kernel

(cherry picked from commit fc98518f40)
2020-07-11 15:52:16 +02:00
ben clark b99636ef97 main/linux-postmarketos-qcom-msm8974: enable CONFIG_SECCOMP (!1218)
fixes an "Invalid argument" when running a flatpak

(cherry picked from commit cca40c66bf)
2020-07-11 15:52:07 +02:00
Luca Weiss 29ddfe49a5 main/linux-postmarketos-qcom-msm8974: updates for various devices (MR 1140)
* Support for sharp ls052t3sx02 video mode panel and max1187x
  touchscreen used in Sony Xperia Z2 (sirius)
* Support for display in OnePlus One (bacon)
* Support for touchscreen, touchkeys and notification led in Samsung
  Galaxy S5 (klte)

(cherry picked from commit b07717d564)
2020-07-11 15:51:58 +02:00
Martijn Braam e98f7ed18a main/linux-postmarketos-allwinner: upgrade to 5.7.0_git20200705 (MR 1397)
This adds panel stability patches and enables more resolutions on
the hdmi port of the A64.

(cherry picked from commit 4cff95a5bb)
2020-07-11 15:47:47 +02:00
Minecrell 1780b0c755 main/linux-postmarketos-qcom-msm8916: enable CONFIG_CRYPTO_XTS (MR 1405)
Seems like "pmbootstrap kconfig edit" causes unrelated kernel config
changes for some reason (probably because pmbootstrap does not install
a cross compiler for it). For now let's just edit the config manually
with the new options so everything else stays as-is.

(cherry picked from commit 2a8897b079)
2020-07-11 15:43:32 +02:00
Minecrell 1016a2c137 main/linux-postmarketos-qcom-msm8916: upgrade to 5.7.1 (MR 1295)
We are in the midst of the Linux 5.8 merge window so there is no new
-rc version to rebase on. -rc1 next week is also not the perfect choice
for a release (first rc is usually still a bit unstable).

On the other hand the changes that landed the last few days are quite
nice and ready to go, so I decided to rebase on a stable kernel release
(5.7.1). Not sure if I'm ever going to do this again :)

Changes:
- Update to Linux 5.7.1
- bq-paella: Add sound and modem
- Enable some new kernel options for DB410c

(cherry picked from commit 140a04816f)
2020-07-11 15:43:23 +02:00
Minecrell 8c5e5f0089 main/linux-postmarketos-qcom-msm8916: upgrade to 5.7 (MR 1284)
- Update to Linux 5.7
- motorola-harpia: Add battery reporting
- bq-paella: Add accelerometer/magnetometer/gyroscope
- bq-paella: Expose touch key backlight as LED

(cherry picked from commit 768ae7c1ee)
2020-07-11 15:43:15 +02:00
Minecrell 5199c9f337 main/linux-postmarketos-qcom-msm8916: upgrade to 5.7_rc5 (MR 1228)
- Update to Linux 5.7-rc5
- Add voice call audio
- samsung-a3u/a5u: add speaker
- wileyfox-crackling: add notification LED
- bq-paella: add display, touchscreen, buttons
- Initial support for Samsung Galaxy J5 (2015) (SM-J500FN)
- Initial support for Samsung Galaxy J3 (2016) (SM-J320P)

(cherry picked from commit e950f1215c)
2020-07-11 15:43:02 +02:00
Minecrell cb0a04988e *: remove quotes around pkgname (MR 1186)
TP:[AL3]:APKBUILD:5:pkgname must not be quoted

[skip ci]: won't finish within 3 hours

(cherry picked from commit c3dcc196ea)

cherry-picking notes: ollieparanoid is picking this commit, so there are
no conflicts when applying CONFIG_CRYPTO_XTS (MR 1405) related patches.
2020-07-11 15:41:41 +02:00
Minecrell 2766f8b3f3 main/linux-postmarketos-qcom-msm8916: upgrade to 5.7-rc2 (!1167)
- Update to Linux 5.7-rc2
- Initial support for BQ Aquaris X5 (bq-paella/picmt)
- Add speaker for samsung-gt510wifi/matissevewifi
- Add flash LED for wileyfox-crackling

(cherry picked from commit bfe15c5c85)
2020-07-11 15:37:54 +02:00
Martijn Braam 916f5df5b1 pine64-pinephone: use wys-pinephone (MR 1406)
(cherry picked from commit 7743b4a25d)
2020-07-11 13:33:11 +02:00
Martijn Braam 6e9a8456b2 temp/wys-pinephone: new aport (MR 1406)
(cherry picked from commit c6afbf8942)
2020-07-11 13:32:46 +02:00
Dolphin von Chips 378db3273a device/community/firmware-pine64-rtl8723bt: add missing "replaces=" (MR 1400)
Package got renamed and "provides" wasn't added, so right now
`apk upgrade -a` with firmware-rtl8723bt installed results in
`ERROR: firmware-pine64-rtl8723bt-0_git20181104-r0: trying to overwrite lib/firmware/rtl_bt/rtl8723bs_config-pine64.bin owned by firmware-rtl8723bt-0_git20181104-r0.`
Add `replaces="firmware-rtl8723bt"` so `apk` prefers this package.

[ci:skip-build]: already built successfully in CI

(cherry picked from commit f15f71c36f)
2020-07-07 20:25:27 +02:00
Oliver Smith fe3a8d8303 device/community/firmware-samsung-a5lte: remove
Upstream tarball disappeared. Remove for now, so it does not block bpo.
2020-07-07 17:36:55 +02:00
Oliver Smith 45a9f64691 CI: test_directory_structure: mention firmware mv (MR 1362)
Instead of encouraging the user to add the directory to
test_directory_structure.py, mention that we just moved the firmware to
device/{main,community,testing}/. This will be more helpful for users
who get the message after rebasing on master.

In the rare case that we need to change the directory structure, we will
figure out which file to edit.

[ci skip]: various firmware packages fail when built at the same time
           (they use generic source files like "bcmdhd.cal" with different checksums)

(cherry picked from commit 3e012e3714)
2020-07-07 16:19:03 +02:00
Minecrell df1224a7b1 firmware/*: move rest of firmware packages to device/testing (MR 1362)
After moving the firmware packages used by devices in community to
device/community, move the rest of the firmware packages to device/testing.

(cherry picked from commit c590ed74cf)

cherry picking note: the only change applied from this commit is the
removal of "firmware" in gitlab-ci/testcases/test_directory_structure.py.
2020-07-07 16:18:46 +02:00
Minecrell 0a950e8a0a firmware/*: move community firmware packages to device/community (MR 1362)
Right now we have all firmware packages under firmware/*.
This is problematic for mainly two reasons:

  - It's not immediately clear which firmware packages we need to keep
    when forking a new stable branch. (Where we delete testing devices
    at the moment...) We might end up deleting firmware packages that
    are actually used by one of the devices in community.

  - When backporting devices to the stable we cannot just cherry-pick
    the commit that moved the device to community (since it does not
    contain the firmware package). Instead we need to cherry-pick
    earlier commits as well, which may touch a lot of deleted files
    in the testing directory.

Let's make this consistent by also placing the firmware packages in
the device/* directory. We already have the common firmware- prefix
to distinguish them from device/kernel packages, which are already
both under the device/* directory.

(cherry picked from commit 4724b0f9c1)
2020-07-07 16:16:37 +02:00
Minecrell bc1e8288d2 firmware/firmware-pine64-rtl8723bt: add -pine64-, cleanup, install license (MR 1362)
For most firmware packages we use a vendor- prefix to make it clear
who has provided the firmware. The firmware-rtl8723bt package is only
used for Pine64 devices and actually contains configs that are specific
to Pine64 hardware (e.g. rtl8723bs_config-pine64.bin).

Let's rename it to firmware-pine64-rtl8723bt to make this more clear.
Also cleanup the APKBUILD a bit and provide the LICENSE file in a -doc
subpackage so we can legally redistribute that firmware.

(cherry picked from commit 1eff900dcb)
2020-07-07 16:15:40 +02:00
Martijn Braam 8f3fd3a5f4 main/postmarketos-ui-phosh: add scaling overrides (MR 1396)
(cherry picked from commit baa69a57f7)
2020-07-07 10:39:31 +02:00
PureTryOut 95093eb1d7 temp/epiphany: fork from Alpine to apply Purism's mobile patches (MR 1371) 2020-07-07 09:46:28 +02:00
Martijn Braam acf2331c95 main/linux-postmarketos-allwinner: upgrade to 5.7.0_git20200704 (MR 1393)
This enables mult-sensor support in sun6i-csi, support for the
gc2145 front camera, the new panel driver from mainline linux
and a small fix for the anx7688 that prevents it spamming the
kernel log when no cable is plugged in on 1.2a hardware.

(cherry picked from commit 0b00e23280)
2020-07-06 12:06:38 +02:00
Oliver Smith cbe0a0bef2 main/linux-postmarketos-allwinner: *** sync with master ***
Cherry-picking has gone wrong before, it was done in the wrong order,
and while commit 1e9d04 ("enable xt_owner and xt_time kernel modules (MR 1343)")
was picked, the changes in the kernel config from that commit are
missing on current v20.05 HEAD.

This patch copies the current kernel config from master to the v20.05
branch and thereby makes the v20.05 version equal with master. The only
difference is now the pkgrel, but this will also go away with the next
upgrade in the kernel version.

When cherry-picking patches, we should always cherry-pick all patches
from linux-postmarketos-allwinner from master to v20.05 and in the right
order. Then we don't have complicated diffs to resolve and errors like
this one happening, and we can be sure that the version on v20.05 is the
same that was tested on master.
2020-07-02 14:55:41 +02:00
Bradley 333bca33d5 linux-postmarketos-allwinner: enable f2fs module and fs compression (MR 1353)
[ci:skip-build] builds locally

(cherry picked from commit 1cf42e6db8)

cherry-picking notes: picked in wrong order, see note in previous commit
message.
2020-07-02 14:55:41 +02:00
Alexey Min 1df4264d19 main/linux-postmarketos-allwinner: add patch descriptions (MR 1372)
Fixes linter warnings

(cherry picked from commit 8217bbc3c2)

cherry-picking notes: picked in wrong order from master. let's pick all
of the linux-postmarketos-allwinner patches from master to v20.05, so
future cherry-picked commits apply cleanly and we have exactly the same
tested kernel as in master in the stable branch (at some point we will
do this with a delay to have a testing time - but still, it should be
the same commits after the testing time is over).
2020-07-02 14:55:41 +02:00
Martijn Braam 4ffe52b874 main/linux-postmarketos-allwinner: upgrade to 5.7.0_git20200629 (MR 1377)
[ci:skip-build]: already built successfully in CI

(cherry picked from commit d4c55e8712)
2020-07-02 14:05:33 +02:00
Bart Ribbers 4bfb9c049d temp/phosh: fork from Alpine to upgrade to newer release (MR 1365)
[ci:skip-build]: already built successfully in CI
2020-07-01 19:26:11 +02:00
Bart Ribbers 87d96df264 temp/phoc: upgrade to 0.4.0 (MR 1365) 2020-07-01 19:25:31 +02:00
Oliver Smith daf57f7e9e main/osk-sdl: upgrade to 0.56 (MR 1379)
(cherry picked from commit 2a83ff4ac0)
2020-07-01 00:35:11 +02:00
Oliver Smith f577bfbcff main/postmarketos-ondev: upgrade to 0.2.0 (MR 1378)
(cherry picked from commit c606d92296)
2020-07-01 00:28:58 +02:00
Danct12 47957f223d main/linux-postmarketos-allwinner: upgrade to 0_git20200528 (MR 1267)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit ea0fd7cb7f)
2020-06-25 15:23:40 +02:00
Alexey Min 3d600b0210 main/postmarketos-ondev: rebuild against new libcalamares
(cherry picked from commit df57eaf100)
2020-06-25 16:11:41 +03:00
Oliver Smith 6d0f6f8c7a temp/calamares: upgrade to 3.2.26.1 (MR 1366)
Upgrade to latest bugfix release, and add a patch to fix weird looking
borders on mobile.

(cherry picked from commit 2f05e21d67)
2020-06-25 07:23:18 +02:00
Oliver Smith c095935351 temp/plasma-phone-components: split vkbd style (MR 1363)
Put virtual keyboard style into a subpackage, and let the main package
depend on it. That way, it can be used in postmarketos-ondev, without
pulling in all of plasma-phone-components.

(cherry picked from commit 166e702da7)
2020-06-24 08:52:00 +02:00
Oliver Smith 7f72ef9c3f Revert "bq-paella: move to community (MR 1319)"
This reverts commit e8ba30763f.

Build fails because of missing dependencies, this blocks bpo.
2020-06-23 20:26:44 +02:00
Oliver Smith 9ffe49be97 temp/unclutter-xfixes: fork from Alpine edge
Fork it for postmarketos-ondev#13.
2020-06-23 17:26:17 +02:00
Bart Ribbers 045fc69f74 main/postmarketos-ui-phosh: install gnome-software by default (MR 1346) 2020-06-23 15:27:12 +02:00
Bart Ribbers df33857021 temp/gnome-software-plugin-apk: fork from Alpine
It needs rebuilding against our custom gnome-software
2020-06-23 15:27:08 +02:00
Bart Ribbers 5eab0792bd temp/gnome-software: fork from Alpine to apply Purism's mobile patches 2020-06-23 15:27:08 +02:00
Bart Ribbers 18ba5a8cdb temp/gtk+3.0: fork from Alpine to apply Purism mobile patches (MR 1312)
Purism has some patches to make GTK apps behave better on mobile screens
and dimensions. These break desktop usage so will not be applied to the
edge branch for now, but we should have these when shipping pmOS on the
PinePhone with the stable branch.

Please test applications known to be sized wrongly before, they should
look a lot better now.

The build hangs if -j > 1, so this package disables parallel make jobs when
building on these architectures. Everything else uses the default # of
parallel jobs for the CPU/system.
2020-06-23 15:08:44 +02:00
jonathan e8ba30763f bq-paella: move to community (MR 1319)
(cherry picked from commit 02aaf4620f)
2020-06-23 10:45:46 +02:00
Oliver Smith 09eee6b115 cross/musl-*: upgrade to 1.1.24-r9
Done with pmbootstrap channels-aportgen branch, which is being
upstreamed (see open MRs, reviews welcome).
2020-06-23 08:53:59 +02:00
Danct12 f75d0c9b71 main/linux-postmarketos-allwinner: only RTL8723CS_NEW (MR 1322)
We cannot have two of them at the same time, most compiler would fail here
but for some reason our didn't.

However, it's better to just use one (the new one, or the old one). Enable
CONFIG_RTL8723CS_NEW, which is the new driver that made it to pine64
kernel since 5.5.

Signed-off-by: Danct12 <danct12@disroot.org>

[ci:skip-build]: already built successfully in CI

(cherry picked from commit df5eec9de6)
2020-06-21 11:28:10 +02:00
Danct12 f33935a033 main/postmarketos-ui-phosh: disable auto-brightness by default (MR 1348)
We should disable it by default and let the user to enable it
when they want it.

And currently it's causing problems where the backlight would
go very dark with it enabled on PinePhone.

Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit f7ed67b1b7)
2020-06-20 18:07:24 +02:00
Martijn Braam 3105f126f2 main/postmarketos-ui-phosh: enable iio-sensor-proxy (MR 1229)
(cherry picked from commit 05969fc3bc)
2020-06-20 18:07:11 +02:00
Antoine Fontaine 1765dac445 temp/u-boot-pinephone: disable too fast fast dram clock speed (MR 1351)
Fixes https://gitlab.com/postmarketOS/pmaports/-/issues/547 and
https://gitlab.com/postmarketOS/pmaports/-/issues/606. See also
https://forum.pine64.org/showthread.php?tid=9832.

(cherry picked from commit d7d0a4b5aa)
2020-06-20 14:50:18 +02:00
Danct12 e97b944b1a temp/u-boot-pinephone: bump pkgrel to build for ARM TF 2.3 (MR 1286)
Signed-off-by: Danct12 <danct12@disroot.org>
(cherry picked from commit a67a00f038)

Cherry-picking note from ollieparanoid:
The commit message is misleading. This does not bump the pkgrel, but
instead package another git commit and change the pkgver from
2020.04_git20200228 to 2020.04_git20200421. I'm cherry-picking it to
v20.05, so the u-boot-pinephone version is in sync with master; the
version on master has seen the most testing currently, so there is no
benefit in holding this back. Also this makes the follow-up patch apply
cleanly.
2020-06-20 14:49:28 +02:00
Miles Alan 48056a0ebf main/linux-postmarketos-allwiner: add CONFIG_SND_ALOOP=m to allow loopback dev (MR 1309) (MR 1340)
This makes recording system audio very simple and feasible in a cross-device
manner since application-logic can always rely / forward ALSA audio to the
loopback device instead of a device-specific audio interface.

(cherry picked from commit b89fc77d7c)

Cherry picking notes from ollieparanoid:
The patch from MR 1343 "enable xt_owner and xt_time kernel modules" has
been cherry-picked to v20.05 before MR 1340. We should avoid this in the
future. I've rebased all other patches in this MR on top, and the
end-result is the APKBUILD being the same as in master again.
[ci:ignore-count]: many packages changed
[ci:skip-vercheck]: the pmb:cross-native commit doesn't bump versions
[ci:skip-build]: does not finish within 3h
2020-06-20 12:10:44 +02:00
Antoine Fontaine 72d1ecf880 pine64-pinephone: unbreak audio (MR 1323) (MR 1340)
Fixes #633.

(cherry picked from commit 1d2b62a109)
2020-06-20 12:10:31 +02:00
Antoine Fontaine b078a67f78 Support Anbox explicitly in some kernels: (MR 1232) (MR 1340)
* linux-postmarketos-allwinner
* linux-postmarketos-qcom-msm8916
* linux-asus-me176c

They support anbox already.

It will make CI catch errors such as the removal of anbox support in
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1205 when
https://gitlab.com/postmarketOS/pmbootstrap/-/merge_requests/1916 will
be merged.

[ci:skip-vercheck] and [ci:skip-build]: no need to rebuild the package.

(cherry picked from commit 6041d4eed0)
2020-06-20 12:10:31 +02:00
Antoine Fontaine b91f81712b main/linux-postmarketos-allwinner: add anbox support again (MR 1222) (MR 1340)
fix regression caused by
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1205
and closes
https://gitlab.com/postmarketOS/pmaports/-/issues/583.

(cherry picked from commit b6d8b5893f)
2020-06-20 12:10:30 +02:00
Martijn Braam 3006ac5a0d main/linux-postmarketos-allwinner: cleanup modules (MR 1205) (MR 1340)
Disable modules for hardware that's impossible to connect to the
allwinner devices or older than the 90's this shrinks the size from 380
to 250MB.

Then it enables module compression so it shrinks from 250MB to 57MB.

Then the module stripping was enabled, shrinking it to 20MB

[ci:skip-build]: already built successfully in CI

(cherry picked from commit dca8043c33)
2020-06-20 12:10:30 +02:00
Antoine Fontaine c80b2791ff cross/arch-bin-masquerade, main/anbox-image, linux-*: use pmb:cross-native (MR 1169) (MR 1340)
https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1910

[skip ci]: CI fails because it can't download every release tarball to
           check checksums in 3h.

(cherry picked from commit c1628ecdce)
2020-06-20 12:10:30 +02:00
Martijn Braam 3da51fe777 main/linux-postmarketos-allwinner: update to 5.6.0_git20200410 (MR 1143) (MR 1340)
(cherry picked from commit e5ae9d8e2d)
2020-06-20 12:10:30 +02:00
Luca Weiss 2e2a12d14e pine-a64lts: add wifi and bluetooth firmware (MR 153) (MR 1340)
Add firmware-rtl8723bt package and Pine wifi and bluetooth firmware
subpackage.

(cherry picked from commit 8c1ebc31a8)
2020-06-20 12:10:25 +02:00
Bart Ribbers b88df955bd temp/phoc: fork from Alpine to upgrade to newer version (MR 1313)
Has important fix to handle phosh crash gracefully.

[ci:skip-build]: already built successfully in CI
2020-06-20 11:01:52 +02:00
Luca Weiss 78d4e4b895 main/postmarketos-ondev: upgrade to 0.1.5 (MR 1342)
This release gets rid of the hacks needed for out-of-tree modules in the
previous version of calamares.

[ci:skip-build]: already built successfully in CI

(cherry picked from commit eb30e7b8a8)
2020-06-20 10:45:30 +02:00
Luca Weiss 5e4fa95d1e temp/calamares: upgrade to 3.2.26 (MR 1342)
(cherry picked from commit bf452101bd)
2020-06-20 10:45:24 +02:00
Wazup b5fcc3afb8 enable xt_owner and xt_time kernel modules (MR 1343)
(cherry picked from commit 1e9d04e60c)
2020-06-19 09:21:15 +02:00
Oliver Smith f3c1570dd3 main/postmarketos-ondev: new aport (MR 1296)
(cherry picked from commit bb5c0cdc7f)
2020-06-18 22:11:17 +02:00
Oliver Smith 8cfa41c971 temp/calamares: new aport (MR 1296)
Based on PureTryOut's testing/calamares branch. Thanks!

(cherry picked from commit b6a7d80e45)
2020-06-18 22:11:09 +02:00
Oliver Smith 19f075664b temp/os-prober: new aport (MR 1296)
Taken from PureTryOut's testing/calamares repository, thanks!

(cherry picked from commit 2f3f0bf333)
2020-06-18 22:11:02 +02:00
Oliver Smith 9f0ca81da6 main/postmarketos-mkinitfs: support pmOS_install (MR 1296)
Prefer booting from a pmOS_install partition if it exists, but do not
resize it.

Related: https://wiki.postmarketos.org/wiki/On-device_installer
(cherry picked from commit 9be8b59a00)
2020-06-18 22:10:55 +02:00
Antoine Fontaine 470101358c main/postmarketos-mkinitfs: add mkinitfs to replaces (MR 1300)
fixes pmbootstrap#1851.

(cherry picked from commit 41c2e1a307)
2020-06-18 22:09:36 +02:00
Oliver Smith e8bd4e4d1e CI: use check_mr_settings.py from ci-common.git (MR 1320) 2020-06-17 16:32:13 +02:00
Oliver Smith f092bb64ed CI: support release channels (v20.05 branch) (MR 1321)
Add common.get_upstream_branch() and use it instead of assuming "master"
as upstream branch.

Example: user forks v20.05 to v20.05_some-fix, then creates a merge
request. CI must use v20.05 as upstream branch, when comparing for
modified files etc.
2020-06-17 16:29:06 +02:00
Oliver Smith 1c64dfe120 CI: common.py: add cache (MR 1321)
Don't query the pmaports dir more than once. This cache will also be
used to store the upstream branch in the next commit.
2020-06-17 16:29:06 +02:00
Anjandev Momi dc09126241 CI: check for pkgrel=0 in new aports (MR 1211)
(cherry picked from commit bcfdb0f914)
2020-06-16 20:47:44 +02:00
Antoine Fontaine efd71386d3 temp/anbox, main/anbox-image: disable on armv7 (MR 1305)
Anbox is half-broken on 32bits, it probably doesn't qualify for stable.
2020-06-16 20:20:26 +03:00
Oliver Smith d9fea2af81 main/osk-sdl: upgrade to 0.55 (MR 1316)
Improved keyboard with bigger buttons and layout change from 4 rows
(+ space row) to 3 rows for easier typing.

(cherry picked from commit 1807426f67)
2020-06-16 17:31:58 +03:00
Raatty 3c5789200a CI: store built apks as artifacts (MR 1264)
(cherry picked from commit 86c6ce9ad0)
2020-06-16 16:01:58 +02:00
Daniele Debernardi 284b02c3ba CI: use pmbootstrap lint for checking packages (MR 1132)
(cherry picked from commit 5ead73e86c)
2020-06-16 16:00:59 +02:00
Oliver Smith 3db21d5852 gitlab-ci.yml: adjust to v20.05 branch 2020-06-16 15:51:32 +02:00
Oliver Smith 5d10a2d66b cross/busybox-static-*: fix checksums
For some reason, the Alpine mirrors (or at least most of them?) give a
file with a different checksum now.
2020-06-16 15:43:32 +02:00
Oliver Smith 9013626904 cross/busybox-static-*: upgrade to 1.31.1-r19
Done with pmbootstrap branch channels-aportgen (integrating that to
master is planned, see pmbootstrap#1917).
2020-06-16 15:28:12 +02:00
Oliver Smith a07e273007 cross/binutils-*: set arch="x86_64"
Don't build for other arches. These are currently failing on
build.postmarketos.org, and they are not useful.

Related: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1917#note_356558508

[ci:skip-vercheck]
2020-06-06 10:19:34 +02:00
Oliver Smith c7c52d89bb cross/binutils-*: upgrade to 2.34-r1
Done with pmbootstrap branch channels-aportgen.
2020-06-05 15:26:02 +02:00
Oliver Smith 528d62883e temp/atinout: fork from Alpine edge
Needed by device-pine64-pinephone.
2020-05-25 20:14:23 +02:00
Oliver Smith 3b6f950e3d pine64-pinephone: add deviceinfo_chassis 2020-05-25 20:14:23 +02:00
Bart Ribbers 1df6f9d3d0 pine64-pinephone: move to community (MR 1175)
[ci:skip-build]: already built successfully in CI
2020-05-25 20:14:18 +02:00
Oliver Smith 8ec2760445 device/*: Add deviceinfo_chassis variable (MR 1246)
Apply to v20.05 branch as well, because we require this variable in
pmbootstrap from now on. This caused all v20.05 builds to fail in
"pmbootstrap init". We should think of that in the future :p
2020-05-25 19:45:45 +02:00
Oliver Smith dbd4670271 temp/u-boot-librem5: remove
Depends on newlib-arm-none-eabi from Alpine testing, which in turn
depends on gcc-arm-none-eabi from Alpine testing, which is part of
gcc-cross-embedded and depends on gcc-arm-none-eabi itself. Yay,
resolving cross compiler dependencies.

Related: https://gitlab.com/postmarketOS/pmaports/-/issues/598
2020-05-24 03:35:43 +02:00
Oliver Smith 9d5d8167f4 hybris: remove
glamor-hybris does not build anymore:

In file included from glamor_egl.c:38:
/usr/include/xf86drm.h:40:10: fatal error: drm.h: No such file or directory
   40 | #include <drm.h>
      |          ^~~~~~~
compilation terminated.

hybris-base indirectly depends on this, so remove all of hybris for the
v20.05 branch. If somebody wants to work on adding it again, we can
discuss it; but right now it is too broken.

Related: https://builds.sr.ht/~postmarketos/job/216229#task-pmbootstrap_build-698
2020-05-24 03:17:57 +02:00
Oliver Smith aac67acb87 kde/voicememo: bump pkgrel
Failed with similar qt related error:

  Could not find a configuration file for package "Qt5Quick" that is
  compatible with requested version "5.14.2".
2020-05-24 03:01:00 +02:00
Oliver Smith 09490e3fef kde/*, main/*: bump pkgrel of various qt programs
Now that our outdated qt forks are gone from the v20.05 branch, try to
build programs again that failed with:

CMake Error at /usr/lib/cmake/Qt5Qml/Qt5QmlConfig.cmake:112 (find_package):
  Could not find a configuration file for package "Qt5Network" that is
  compatible with requested version "5.14.2".

  The following configuration files were considered but not accepted:

    /usr/lib/cmake/Qt5Network/Qt5NetworkConfig.cmake, version: 5.14.1
2020-05-24 02:58:08 +02:00
Oliver Smith e8e0c2a550 temp/*qt5*: drop
All changes were upstreamed to Alpine, and landed in the upcoming 3.12
release. Awesome!
2020-05-24 02:58:04 +02:00
Oliver Smith b65c71f2ea cross/musl-*: upgrade to 1.1.24-r8 2020-05-24 02:46:04 +02:00
Oliver Smith 443ba0d367 cross/busybox-static-*: upgrade to 1.31.1-r16 2020-05-24 02:45:59 +02:00
Oliver Smith 93440ecb1f trigger bpo: aarch64, armv7 enabled 2020-05-22 21:50:12 +02:00
Oliver Smith 65c5863827 temp/anbox: bump pkgrel
Rebuild it, now that depends are available.
2020-05-22 21:28:33 +02:00
Oliver Smith e0e1f2b395 temp/properties-cpp: fork from Alpine edge
Needed for anbox.
2020-05-22 21:27:03 +02:00
Oliver Smith c975a3d3e3 temp/cmake-extras: fork from Alpine edge
Needed for anbox.
2020-05-22 21:26:58 +02:00
Oliver Smith 8e2ccf9594 main/postmarketos-ui-plasma-mobile-extras: remove dep trojita
Only available in Alpine edge. We can fork it to postmarketOS on demand.
2020-05-22 21:19:28 +02:00
Oliver Smith 80cd5dcdbc cross/musl-*: upgrade to 1.1.24-r7 2020-05-19 22:59:42 +02:00
Oliver Smith da704ea809 temp/anbox: fork from Alpine edge 2020-05-19 22:44:39 +02:00
Oliver Smith 7a0583e80e temp/kgx: fork from Alpine edge
Also add a patch to make it build.
2020-05-19 22:33:13 +02:00
Oliver Smith df75f6f234 temp/xfce4-pulseaudio-plugin: fork from Alpine edge 2020-05-19 22:13:58 +02:00
Oliver Smith 84fd68c6c8 temp/lcov: fork from Alpine edge 2020-05-19 22:13:49 +02:00
Oliver Smith a43f3bbfdd kde/qrca: remove
Does not build and nothing depends on it.

src/QrCodeDecoder.cpp:58:14: error: 'class ZXing::DecodeHints' has no member named 'setShouldTryRotate'; did you mean 'setTryRotate'?

Related: https://builds.sr.ht/~postmarketos/job/213157#task-pmbootstrap_build-709
2020-05-19 21:55:13 +02:00
Oliver Smith ad9e8af2a2 main/ofonoctl: remove
Depends on py3-tabulate, which is not available in Alpine 3.12. I don't
mind if we add it back, together with the dependency, to v20.05, but
right now let's rather unbreak the repo. Nothing depends on it.
2020-05-19 21:54:57 +02:00
Oliver Smith 856008e1c2 modem/libsamsung-ipc: remove
Source is gone, and this is not used by any devices outside of testing.

Related: https://gitlab.com/postmarketOS/pmaports/-/issues/595
2020-05-19 21:34:18 +02:00
Ruby Iris Juric b920ec64f2 cross/gcc-*: upgrade to 9.3.0-r2 (MR 1253)
Bring the GCC packages up to date with upstream.
Fixes libstdc++ unsatisfiable constrains related error messages.

Upstream commits:
- https://gitlab.alpinelinux.org/alpine/aports/-/commit/1069d8331c7125eb84994d624d45579a660acc41
- https://gitlab.alpinelinux.org/alpine/aports/-/commit/e296f565dbf916871242d0551922984f4e2e8b8c

[ci:skip-build]
2020-05-19 21:29:35 +02:00
Oliver Smith 487ac41ed8 firmware: remove firmware from testing devices
For future reference, the script to do this is here:
https://wiki.postmarketos.org/wiki/Create_release_branch
2020-05-19 21:20:47 +02:00
Oliver Smith 50604efc0b cross/*-x86: remove 2020-05-19 21:00:39 +02:00
Oliver Smith ebb3022898 cross/*-armhf: remove
We will not enable the armhf repository for v20.05, as we won't have
armhf devices outside of testing. So no need for the cross/*-armhf
packages. Same with x86. Follow up commits will delete more packages.
2020-05-19 20:59:33 +02:00
Oliver Smith 2bd016c459 trigger bpo 2020-05-17 15:55:18 +02:00
Martijn Braam 67101ee5d0 trigger bpo
the last time, I promise
2020-05-17 13:13:35 +02:00
Oliver Smith b9a7135807 trigger bpo 2020-05-17 12:38:42 +02:00
Oliver Smith 535c350e55 trigger bpo
The push hook on gitlab had the master branch hardcoded. There's no
button to test the push hook with a branch other than master, so here's
an empty commit that should do the job.
2020-05-17 08:58:41 +02:00
Minecrell 8ecce307b4 asus-me176c: move to community (MR 1185) 2020-05-17 08:40:39 +02:00
Oliver Smith 52257709fb device/testing: remove
We only want to build these for the master branch.
2020-05-17 08:23:33 +02:00
Oliver Smith 8982f37a88 cross/musl-*: upgrade to 1.1.24-r6
Generated with pmbootstrap channels-aportgen branch.
2020-05-17 08:20:36 +02:00
Oliver Smith fc390510bc cross/grub-efi-x86: upgrade to 2.04-r1
Generated with pmbootstrap channels-aportgen branch.
2020-05-17 08:20:36 +02:00
Oliver Smith 8785de1747 cross/busybox-static-*: upgrade to 1.31.1-r15
Generated with pmbootstrap channels-aportgen branch.
2020-05-17 08:20:31 +02:00
Oliver Smith 7adc4e1893 CI: use install-pmbootstrap.sh from ci-common repo (MR 1147)
This script is used by multiple repositories by now, let's make sure we
only have one place where we need to maintain it. The version in
ci-common is shellchecked and displays less output for 'pmbootstrap
init' again (unless it fails, then it shows the whole log).
2020-04-15 20:58:25 +02:00
Oliver Smith ae0a051f01 .bpo/install_pmbootstrap.sh: remove (MR 1147)
This file is not used anymore by the bpo code, so remove it.
2020-04-15 20:58:17 +02:00
Niklas Cathor b341c1d2f6 main/postmarketos-mkinitfs: fix mkbootimg call for devices w/o dtb (MR 1148)
Don't pass empty arguments to mkbootimg, when _second or _dt are not set.
2020-04-15 20:57:41 +02:00
Oliver Smith 0be9aa2cad channels.cfg: remove
Channels.cfg should only be on matrix branch, as explained here:
https://postmarketos.org/channels.cfg ("Location" section)
2020-04-15 20:53:55 +02:00
Oliver Smith d2f4a4eeec pmaports.cfg: set channel=stable 2020-04-12 15:36:26 +02:00
6422 changed files with 74134 additions and 2141688 deletions

No files matched your search

+84
View File
@@ -0,0 +1,84 @@
#!/usr/bin/env python3
# Copyright 2019 Martijn Braam
# Copyright 2019 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import json
import os
import requests
# Require environment vars
for key in ["BPO_API_ENDPOINT",
"BPO_API_HOST",
"BPO_ARCH",
"BPO_BRANCH",
"BPO_JOB_ID",
"BPO_JOB_NAME",
"BPO_TOKEN_FILE",
"BPO_PAYLOAD_FILES", # one file per line
"BPO_PAYLOAD_IS_JSON", # set to "1" to enable
"BPO_PKGNAME",
"BPO_VERSION", # $pkgver-r$pkgrel
]:
if key not in os.environ:
print("ERROR: missing environment variable: " + key)
exit(1)
# Parse and check files
files = os.environ["BPO_PAYLOAD_FILES"].split("\n")
for path in files:
if not os.path.exists(path):
print("ERROR: file not found: " + path)
exit(1)
# Load token
with open(os.path.expanduser(os.environ["BPO_TOKEN_FILE"]),
encoding="utf-8") as handle:
token = handle.read().strip()
# Load other env vars
url = (os.environ["BPO_API_HOST"] + "/api/job-callback/" +
os.environ["BPO_API_ENDPOINT"])
is_json = (os.environ["BPO_PAYLOAD_IS_JSON"] == "1")
# Prepare HTTP headers
headers = {"X-BPO-Arch": os.environ["BPO_ARCH"],
"X-BPO-Branch": os.environ["BPO_BRANCH"],
"X-BPO-Job-Id": os.environ["BPO_JOB_ID"],
"X-BPO-Job-Name": os.environ["BPO_JOB_NAME"],
"X-BPO-Token": token,
"X-BPO-Pkgname": os.environ["BPO_PKGNAME"],
"X-BPO-Version": os.environ["BPO_VERSION"]}
# Submit JSON
if is_json:
if len(files) > 1:
print("ERROR: json mode doesn't support multiple input files")
exit(1)
# Send contents of file as HTTP POST with json payload
with open(files[0], encoding="utf-8") as handle:
data = handle.read()
data = json.loads(data)
print("Sending JSON to: " + url)
response = requests.post(url, json=data, headers=headers)
else: # Submit blobs
blobs = []
for path in files:
print("Appending: " + path)
filename = os.path.basename(path)
# Send contents of file as HTTP POST with multipart/formdata payload
blobs.append(("file[]", (filename,
open(path, "rb"),
"application/octet-stream")))
print("Uploading to: " + url)
response = requests.post(url, files=blobs, headers=headers)
if response.status_code > 399:
print("Error occurred:")
print(response.content.decode())
exit(1)
else:
print(response.content.decode())
-22
View File
@@ -1,22 +0,0 @@
#!/bin/sh -e
# Description: run apkbuild-lint on modified APKBUILDs
# Options: native
# Use 'native' because it requires git commit history.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
# Wrap pmbootstrap to use this repository for --aports
pmaports="$(cd "$(dirname "$0")"/..; pwd -P)"
_pmbootstrap="$(command -v pmbootstrap)"
pmbootstrap() {
"$_pmbootstrap" --aports="$pmaports" "$@"
}
.ci/lib/apkbuild_linting.py
-111
View File
@@ -1,111 +0,0 @@
#!/bin/sh -e
# Description: update a list of packages
# Options: native slow
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk add git openssh-keygen grep curl
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0 $*"
fi
git config --global --add safe.directory "$CI_PROJECT_DIR"
git config --global user.name "postmarketOS CI"
# pmaports
# The email address is the username of the bot (from the GitLab group members page) @noreply.gitlab.com
git config --global user.email "project_8065375_bot_13cf44ca4cd2c938688af6e3d500d9cb@noreply.gitlab.com"
# For testing with pmaports-autoupdate-test repo
# git config --global user.email "project_58002231_bot_be2d4e9e7aba929855726aafe12940d6@noreply.gitlab.com"
# Configure SSH key for signing
mkdir -p ~/.ssh
cp "$PMAPORTS_SSH_KEY" ~/.ssh/pmaports
chmod 600 ~/.ssh/pmaports
# Generate public key from private
ssh-keygen -t ecdsa -f ~/.ssh/pmaports -y > ~/.ssh/pmaports.pub
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/pmaports.pub
export PYTHONUNBUFFERED=1
PKGS="$1"
if [ -z "$PKGS" ]; then
echo "Usage: $0 <packages>"
exit 1
fi
echo "Checking for new versions of packages: $PKGS"
update_linux_next() {
# Check for the latest -next tag
local latest
local pkgver
local new_pkgver
# Get the current version
# shellcheck source=/dev/null
pkgver=$(. device/testing/linux-next/APKBUILD; echo "$pkgver")
curl -s "https://gitlab.com/linux-kernel/linux-next/-/tags?format=atom" | grep -oP "(?<=<title>)[^<]+" | tail -n +2 > /tmp/tags
latest=$(grep -v "v" < /tmp/tags | head -n1)
if [ -z "$latest" ]; then
echo "Failed to get the latest -next tag"
exit 1
fi
echo "Latest -next tag: $latest"
new_pkgver=$(grep "v" < /tmp/tags | head -n1)
if [ -z "$new_pkgver" ]; then
echo "Failed to get the latest mainline tag from atom feed, reusing current pkgver"
new_pkgver="${pkgver%_git*}"
else
echo "Latest mainline tag: $new_pkgver"
# new_pkgver is like 'v6.9-rc1' but we want '6.9'
new_pkgver=$(echo "$new_pkgver" | sed -e 's/^v//' -e 's/-.*//')
fi
new_pkgver="${new_pkgver}_git${latest#*-}"
if [ "$pkgver" = "$new_pkgver" ]; then
echo "No new version of linux-next"
exit 0
fi
echo "Updating linux-next from $pkgver to $new_pkgver..."
sed -i -e "s/pkgver=$pkgver/pkgver=$new_pkgver/" device/testing/linux-next/APKBUILD
# Update the checksums
pmbootstrap checksum linux-next
# Ensure it builds
pmbootstrap --details-to-stdout build linux-next
# Commit
git add device/testing/linux-next/APKBUILD
git commit -S -m "linux-next: upgrade to $latest"
}
# For testing
#git remote add gitlab https://pmos-ci:"$PMAPORTS_PUSH_TOKEN"@gitlab.com/postmarketOS/pmaports-autoupdate-test.git
git remote add gitlab https://pmos-ci:"$PMAPORTS_PUSH_TOKEN"@gitlab.com/postmarketOS/pmaports.git
git fetch gitlab
git checkout --track gitlab/master
for pkg in $PKGS; do
case "$pkg" in
linux-next)
update_linux_next
;;
*)
echo "Unknown package: $pkg"
exit 1
;;
esac
done
git push
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-1
View File
@@ -1 +0,0 @@
lib/build_changed_aports.sh
-43
View File
@@ -1,43 +0,0 @@
#!/bin/sh -e
# Description: verify CODEOWNERS file is sane
# https://postmarketos.org/pmb-ci
# TODO Future improvements:
# * Check that all devices in main/community have someone in CODEOWNERS
# * Check that GitLab user actually exists (e.g. deleted account, account with
# changed user name)
if grep -q " " CODEOWNERS; then
echo
echo "ERROR: Found space indentation in CODEOWNERS."
echo "ERROR: Please indent with tab characters."
grep " " CODEOWNERS
echo
exit 1
fi
fail=0
tmppipe=$(mktemp -u)
mkfifo "$tmppipe"
grep -v "^#" CODEOWNERS | cut -d' ' -f1 > "$tmppipe" &
while IFS= read -r line; do
[ -z "$line" ] && continue
# Check if entry generally exists
# shellcheck disable=SC2086
ls $line >/dev/null 2>&1 || { fail=1; echo "Non-existing: $line"; }
# Check that directories end with a slash
# shellcheck disable=SC2086
if test -d "$(ls -d $line)"; then
echo "$line" | grep -q '/$' || { fail=1; echo "Missing trailing slash: $line"; }
fi
done < "$tmppipe"
rm "$tmppipe"
if [ "$fail" = 1 ]; then
echo
echo "ERROR: Invalid CODEOWNERS entries, see above."
echo
exit 1
fi
-20
View File
@@ -1,20 +0,0 @@
#!/bin/sh -e
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: check pkgver/pkgrel bumps, amount of changed pkgs etc
# Options: native
# Use 'native' because it requires git commit history.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
# In .gitlab-ci.yml currently .ci/pytest.sh runs before this and
# already downloads and runs install_pmbootstrap.sh.
if ! [ -e install_pmbootstrap.sh ]; then
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
fi
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
.ci/lib/check_changed_aports_versions.py
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh -e
# Description: editorconfig-checker: lint for trailing whitespaces etc.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add \
editorconfig-checker
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
ec
-90
View File
@@ -1,90 +0,0 @@
#!/bin/sh -e
# Description: check various bad patterns with grep
# https://postmarketos.org/pmb-ci
exit_code=0
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add grep
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
# Find CHANGEMEs in APKBUILDs
if grep -qr '(CHANGEME!)' -- *; then
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
grep --color=always -r '(CHANGEME!)' -- *
exit_code=1
fi
# DTBs installed to /usr/share/db
# shellcheck disable=SC2016
if grep -qr 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/; then
echo 'ERROR: Please do not install dtbs to /usr/share/dtb!'
echo 'ERROR: Unless you have a good reason not to, please put them in /boot/dtbs'
echo 'ERROR: Files that need fixing:'
# shellcheck disable=SC2016
grep --color=always -r 'INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb' device/
exit_code=1
fi
# Find old mkinitfs paths (pre mkinitfs 2.0)
if grep -qr '/etc/postmarketos-mkinitfs' -- *; then
echo "ERROR: Please replace '/etc/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
grep --color=always -r '/etc/postmarketos-mkinitfs' -- *
exit_code=1
fi
if grep -qr '/usr/share/postmarketos-mkinitfs' -- *; then
echo "ERROR: Please replace '/usr/share/postmarketos-mkinitfs' with '/usr/share/mkinitfs' in the following files:"
grep --color=always -r '/usr/share/postmarketos-mkinitfs' -- *
exit_code=1
fi
# Direct sourcing of deviceinfo
if grep --exclude='source_deviceinfo' -qEr 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *; then
echo 'ERROR: Please source the source_deviceinfo script instead of sourcing deviceinfo directly!'
grep --color=always --exclude='rootfs-usr-share-misc-source_deviceinfo' -Er 'source /etc/deviceinfo|\. /etc/deviceinfo' -- *
exit_code=1
fi
# Removed deviceinfo variable
if grep -qr 'deviceinfo_modules_initfs' -- *; then
echo 'ERROR: deviceinfo_modules_initfs variable has been removed. Use "modules-initfs" file instead.'
grep --color=always -r 'deviceinfo_modules_initfs' -- *
exit_code=1
fi
POSTMARKETOS_WALLPAPER_PATH='/usr/share/wallpapers/postmarketos.jpg'
# The excluded devices are "grandfathered in". New devices should not be added here.
# See https://gitlab.com/postmarketOS/pmaports/-/issues/2529
if grep -qr $POSTMARKETOS_WALLPAPER_PATH \
--exclude-dir='device-pine64-pinetab' \
--exclude-dir='device-oneplus-kebab' \
--exclude-dir='device-xiaomi-willow' \
-- device; then
echo "ERROR: Please don't include configuration files that set the default wallpaper in device-specific packages!"
grep --color=always -r $POSTMARKETOS_WALLPAPER_PATH \
--exclude-dir='device-pine64-pinetab' \
--exclude-dir='device-oneplus-kebab' \
--exclude-dir='device-xiaomi-willow' \
-- device
exit_code=1
fi
OPENRC_SERVICE_FILES=$(find . -name '*.initd')
# shellcheck disable=SC2086
if grep -q 'before wpa_supplicant' $OPENRC_SERVICE_FILES; then
echo "ERROR: Please use 'before wlan' in OpenRC service files! This ensures compatibility with both wpa_supplicant and iwd."
grep --color=always 'before wpa_supplicant' $OPENRC_SERVICE_FILES
exit_code=1
fi
if grep -qEr 'PMOS_NO_OUTPUT_REDIRECT' -- *; then
echo "ERROR: PMOS_NO_OUTPUT_REDIRECT is deprecated and doesn't do anything."
echo "Please remove it from the following files:"
grep --color=always -Er 'PMOS_NO_OUTPUT_REDIRECT' -- *
exit_code=1
fi
exit "$exit_code"
-16
View File
@@ -1,16 +0,0 @@
#!/bin/sh -e
# Description: check modified kernel configs
# Options: native
# Use 'native' because it requires running pmbootstrap.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
export PYTHONUNBUFFERED=1
.ci/lib/check_changed_kernels.py
-1
View File
@@ -1 +0,0 @@
../testcases/add_pmbootstrap_to_import_path
-31
View File
@@ -1,31 +0,0 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-or-later
import common
import os.path
import sys
if __name__ == "__main__":
common.add_upstream_git_remote()
apkbuilds = {file for file in common.get_changed_files(removed=False)
if os.path.basename(file) == "APKBUILD"}
if len(apkbuilds) < 1:
print("No APKBUILDs to lint")
sys.exit(0)
packages = []
for apkbuild in apkbuilds:
if apkbuild.startswith("temp/") or apkbuild.startswith("cross/"):
print(f"NOTE: Skipping linting of {apkbuild}")
continue
packages.append(os.path.basename(os.path.dirname(apkbuild)))
if len(packages) < 1:
print("No APKBUILDs to lint")
sys.exit(0)
result = common.run_pmbootstrap(["-q", "lint"] + packages, output_return=True)
if len(result) > 0:
print("Linting issues found:")
print(result)
sys.exit(1)
-19
View File
@@ -1,19 +0,0 @@
#!/bin/sh -e
# Description: build modified packages for this architecture
# Options: native slow
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
export PYTHONUNBUFFERED=1
# Get the architecture from the symlink we are running
arch="$(echo "$0" | cut -d '-' -f 2 | cut -d '.' -f 1)"
set -x
.ci/lib/build_changed_aports.py "$arch"
-205
View File
@@ -1,205 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import pathlib
import tempfile
import sys
import subprocess
# Same dir
import common
# pmbootstrap
import add_pmbootstrap_to_import_path # noqa
import pmb.parse
import pmb.parse.version
import pmb.helpers.logging
from pmb.core.context import get_context
def get_package_contents(package, revision, check=True):
# Redirect stderr to /dev/null, so git doesn't complain about files not
# existing in upstream branch for new packages
stderr = None
if not check:
stderr = subprocess.DEVNULL
# Run something like "git show upstream/master:main/hello-world/APKBUILD"
pmaports_dir = common.get_pmaports_dir()
pattern = pmaports_dir + "/**/" + package + "/APKBUILD"
path = glob.glob(pattern, recursive=True)[0][len(pmaports_dir + "/"):]
apkbuild_content = common.run_git(["show", revision + ":" + path], check,
stderr)
if not apkbuild_content:
return None
# Save APKBUILD to a temporary path and parse it from there. (Not the best
# way to do things, but good enough for this CI script.)
with tempfile.TemporaryDirectory() as tempdir:
with open(tempdir + "/APKBUILD", "w", encoding="utf-8") as handle:
handle.write(apkbuild_content)
parsed = pmb.parse.apkbuild(pathlib.Path(tempdir, "APKBUILD"),
False, False)
return parsed
def get_package_version(package, revision, check=True):
""" returns version in the format "{pkgver}-r{pkgrel}", or None if no
matching package is found """
parsed = get_package_contents(package, revision, check)
if parsed is None:
return None
return parsed["pkgver"] + "-r" + parsed["pkgrel"]
def version_compare_operator(result):
""" :param result: return value from pmb.parse.version.compare() """
if result == -1:
return "<"
elif result == 0:
return "=="
elif result == 1:
return ">"
raise RuntimeError("Unexpected version_compare_operator input: " + result)
def exit_with_error_message():
branch = common.get_upstream_branch()
print()
print("ERROR: Modified package(s) don't have an increased version or a")
print("new package has a nonzero pkgrel!")
print()
print("This can happen if you added a new package with a nonzero")
print("pkgrel, or if you did not change the pkgver/pkgrel")
print("variables in the APKBUILDs. Or you did change them, but the")
print(f"packages have been updated in the official '{branch}' branch, and")
print("now your versions are not higher anymore.")
print()
print("Your options:")
print("a) If you made changes to the packages, and did not increase the")
print(" pkgrel/pkgver: increase them now, and force push your branch.")
print(" => https://postmarketos.org/howto-bump-pkgrel-pkgver")
print("b) If you had already increased the package versions, rebase on")
print(f" '{branch}', increase the versions again and then force push:")
print(" => https://postmarketos.org/rebase")
print("c) If you made a change, that does not require rebuilding the")
print(" packages, such as only changing the arch=... line: you can")
print(" disable this check by adding '[ci:skip-vercheck]' to the")
print(" latest commit message, then force push.")
print()
print("Thank you and sorry for the inconvenience.")
exit(1)
def check_versions(packages):
error = False
# Get relevant commits: compare HEAD against upstream branch or HEAD~1
# (the latter if this CI check is running on upstream branch). Note that
# for the common.get_changed_files() code, we don't check against
# upstream branch HEAD, but against the latest common ancestor. This is not
# desired here, since we already know what packages changed, and really
# want to check if the version was increased towards *current* upstream
# branch HEAD.
commit = f"upstream/{common.get_upstream_branch()}"
if common.run_git(["rev-parse", "HEAD"]) == common.run_git(["rev-parse",
commit]):
print(f"NOTE: {commit} is on same commit as HEAD, comparing"
" HEAD against HEAD~1.")
commit = "HEAD~1"
for package in packages:
# Get versions, skip new packages
head = get_package_version(package, "HEAD")
upstream = get_package_version(package, commit, False)
if not upstream:
if head.rpartition('r')[2] != "0":
print(f"- {package}: {head} (HEAD) (new package) [ERROR]")
error = True
else:
print(f"- {package}: {head} (HEAD) (new package)")
continue
# Check pkgver follows expected format for device packages
pkgver = head.rpartition('-r')[0]
if package.startswith('device-') and not pkgver.isdigit():
print(f" - {package}: invalid pkgver \"{pkgver}\""
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
error = True
# Additional checks for device packages
if package.startswith('device-'):
head_parsed = get_package_contents(package, "HEAD", False)
upstream_parsed = get_package_contents(package, commit, False)
# checksums did not change
if head_parsed["sha512sums"] == upstream_parsed["sha512sums"]:
# Check that pkgver did not change
if head_parsed["pkgver"] != upstream_parsed["pkgver"]:
print(f" - {package}: pkgver should not change when package source checksums did not change."
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
error = True
# We do not check for a bumped pkgrel, because not everything
# needs it, e.g: pmb_recommends
# checksums changed
else:
# Check that pkgrel was reset to 0
if head_parsed["pkgrel"] != "0":
print(f" - {package}: pkgrel should be 0 when package source checksums change."
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
error = True
# Check that pkgver was changed
if head_parsed["pkgver"] == upstream_parsed["pkgver"]:
print(f" - {package}: pkgver should change when package source checksums change."
"See: https://wiki.postmarketos.org/wiki/Packaging#device_packages_and_other_packages_without_sources")
error = True
# Compare head and upstream versions
result = pmb.parse.version.compare(head, upstream)
if result != 1:
error = True
# Print result line ("- hello-world: 1-r2 (HEAD) > 1-r1 (HEAD~1)")
formatstr = "- {}: {} (HEAD) {} {} ({})"
if result != 1:
formatstr += " [ERROR]"
operator = version_compare_operator(result)
print(formatstr.format(package, head, operator, upstream, commit))
if error:
exit_with_error_message()
if __name__ == "__main__":
# Get and print modified packages
common.add_upstream_git_remote()
packages = common.get_changed_packages()
print(f"Changed packages: {packages}")
# Verify modified package count
common.get_changed_packages_sanity_check(len(packages))
if len(packages) == 0:
print("no aports changed in this branch")
exit(0)
# Potentially skip this check
if common.commit_message_has_string("[ci:skip-vercheck]"):
print("WARNING: not checking for changed package versions"
" ([ci:skip-vercheck])!")
exit(0)
# Initialize args (so we can use pmbootstrap's APKBUILD parsing)
sys.argv = ["pmbootstrap.py", "chroot"]
args = pmb.parse.arguments()
context = get_context()
# pmb.helpers.logging.init(args)
pmb.helpers.logging.init(context.log, args.verbose, context.details_to_stdout)
# Verify package versions
print("checking changed package versions...")
check_versions(packages)
-98
View File
@@ -1,98 +0,0 @@
#!/usr/bin/env python3
# Copyright 2024 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import tempfile
import sys
import subprocess
# Same dir
import common
def check_kconfig(pkgnames):
last_failed = None
for i in range(len(pkgnames)):
pkgname = pkgnames[i]
print(f" ({i+1}/{len(pkgnames)}) {pkgname}")
p = subprocess.run(["pmbootstrap", "kconfig", "check", "--keep-going", pkgname],
check=False)
if p.returncode:
last_failed = pkgname
return last_failed
def check_kconfig_all():
p = subprocess.run(["pmbootstrap", "kconfig", "check", "--keep-going"], check=False)
return p.returncode == 0
def show_error(last_failed):
print("")
print("---")
print("")
print("Please adjust your kernel config. This is required for getting your"
" patch merged.")
print("")
print("Edit your kernel config:")
print(f" pmbootstrap kconfig edit {last_failed}")
print("")
print("Test this kernel config again:")
print(f" pmbootstrap kconfig check {last_failed}")
print("")
print("Run this check again (on all kernels you modified):")
print(" pmbootstrap ci kconfig")
print("")
print("---")
print("")
def show_error_all():
print("")
print("---")
print("")
print("Please adjust the failed kernel configs. This is required for")
print("getting your patch merged.")
print("")
print("If a kernel in the testing category failed, and fixing is too much")
print("effort, remove 'pmb:kconfigcheck-community' from the APKBUILD.")
print("")
print("Edit a kernel config:")
print(" pmbootstrap kconfig edit <PACKAGE NAME>")
print("")
print("Test a specific kernel config again:")
print(" pmbootstrap kconfig check <PACKAGE NAME>")
print("")
print("Run this check again (on all kernels you modified):")
print(" pmbootstrap ci kconfig")
print("")
print("---")
print("")
if __name__ == "__main__":
common.add_upstream_git_remote()
if "kconfigcheck.toml" in common.get_changed_files():
print("kconfigcheck.toml changed -> checking all kernels")
if not check_kconfig_all():
show_error_all()
exit(1)
exit(0)
pkgnames = common.get_changed_kernels()
print(f"Changed kernels: {pkgnames}")
if len(pkgnames) == 0:
print("No kernels changed in this branch")
exit(0)
last_failed = check_kconfig(pkgnames)
if last_failed:
show_error(last_failed)
exit(1)
-17
View File
@@ -1,17 +0,0 @@
#!/bin/sh -e
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
if ! mount | grep -q /proc/sys/fs/binfmt_misc; then
echo "Mounting binfmt_misc"
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
fi
if id "build" > /dev/null 2>&1; then
echo "User 'build' exists already"
else
echo "Creating build user"
adduser -D build
chown -R build:build .
echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
fi
-42
View File
@@ -1,42 +0,0 @@
#!/bin/sh -e
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: lint with various python tests
# Options: native
# Use 'native' because it requires pmbootstrap.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh pytest
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
# Require pytest to be installed on the host system
if [ -z "$(command -v pytest)" ]; then
echo "ERROR: pytest command not found, make sure it is in your PATH."
exit 1
fi
pmaports="$(cd "$(dirname "$0")"/..; pwd -P)"
# Make sure that the work folder format is up to date, and that there are no
# mounts from aborted test cases (pmbootstrap#1595)
pmbootstrap work_migrate
pmbootstrap config aports "$pmaports"
pmbootstrap -q shutdown
# Make sure we have a valid device (pmbootstrap#1128)
device="$(pmbootstrap config device)"
deviceinfo="$pmaports/device/*/device-$device/deviceinfo"
# shellcheck disable=SC2086
if ! [ -e $deviceinfo ]; then
echo "ERROR: Could not find deviceinfo file for selected device '$device'."
echo "Expected path: $deviceinfo"
echo "Maybe you have switched to a branch where your device does not exist?"
echo "Use 'pmbootstrap config device qemu-amd64' to switch to a valid device."
exit 1
fi
# Run testcases
pytest -vv -x --tb=native "$pmaports/.ci/testcases" "$@"
-14
View File
@@ -1,14 +0,0 @@
#!/bin/sh -e
# Description: lint CI related python scripts/tests
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add ruff
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
# shellcheck disable=SC2046
ruff check --ignore E501,F401,E722,W605 $(find .ci -name '*.py')
-50
View File
@@ -1,50 +0,0 @@
#!/bin/sh -e
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: lint all shell scripts
# https://postmarketos.org/pmb-ci
DIR="$(cd "$(dirname "$0")/.." && pwd -P)"
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add shellcheck
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
# Shell: shellcheck
sh_files="
./main/mdss-fb-init-hack/mdss-fb-init-hack.sh
./main/postmarketos-base/rootfs-usr-lib-firmwareload.sh
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-dns-filter.sh
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-tethering.sh
./main/postmarketos-installkernel/installkernel-pmos
./main/postmarketos-initramfs/init.sh
./main/postmarketos-initramfs/init_functions.sh
./main/postmarketos-mkinitfs-hook-debug-shell/setup_usb_storage.sh
./main/postmarketos-mkinitfs-hook-netboot/netboot.sh
./main/ttyescape/*.post-install
./main/unl0kr/unlock.sh
./main/msm-firmware-loader/*.post-install
./device/community/soc-qcom-sdm845/call_audio_idle_suspend_workaround.sh
$(find . -path './main/postmarketos-ui-*/*.sh')
$(find . -path './main/postmarketos-ui-*/*.pre-install')
$(find . -path './main/postmarketos-ui-*/*.post-install')
$(find . -path './main/postmarketos-ui-*/*.pre-upgrade')
$(find . -path './main/postmarketos-ui-*/*.post-upgrade')
$(find . -path './main/postmarketos-ui-*/*.pre-deinstall')
$(find . -path './main/postmarketos-ui-*/*.post-deinstall')
$(find . -name '*.trigger')
$(find . -path './main/devicepkg-dev/*.sh')
$(find . -path './main/postmarketos-mvcfg/*.sh')
$(find . -path './.ci/**.sh')
"
for file in $sh_files; do
echo "Test with shellcheck: $file"
cd "$DIR/$(dirname "$file")"
shellcheck -e SC1008 -e SC3043 -x "$(basename "$file")"
done
@@ -1,44 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import shutil
import sys
import os
import importlib
import importlib.util
from site import getsitepackages
def path_pmbootstrap():
""" Find the pmbootstrap installation folder, so we can import the Python
code from there.
returns: pmbootstrap installation folder
"""
# This variable is set by pmbootstrap 1.52 and later
# If it's undefined, try to find 'pmbootstrap' in path
bin = os.environ.get("PMBOOTSTRAP_CMD") or shutil.which("pmbootstrap")
if not bin:
print("ERROR: 'pmbootstrap' not found in $PATH")
sys.exit(1)
# Resolve the symlink and verify the folder
directory = os.path.dirname(os.path.realpath(bin))
if os.path.exists(directory + "/pmb/__init__.py"):
return directory
directories = getsitepackages()
for directory in directories:
if os.path.exists(directory + "/pmb/__init__.py"):
return directory
# Symlink not set up properly
print("ERROR: unable to find path to pmbootstrap.py. Try setting 'PMBOOTSTRAP_CMD'.")
sys.exit(1)
# Check if pmb module can be imported
if importlib.util.find_spec("pmb") is None:
# Add pmbootstrap dir to import path
sys.path.append(os.path.realpath(path_pmbootstrap()))
-34
View File
@@ -1,34 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
from pathlib import Path
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.helpers.args import init as init_args
from pmb.types import PmbArgs
import pmb.config
from pmb.core.pkgrepo import pkgrepo_default_path
import pytest
import sys
import os
@pytest.fixture(scope="session", autouse=True)
def args(request):
# Initialize args
pmaports = Path(os.path.realpath(f"{os.path.dirname(__file__)}/../.."))
args = PmbArgs()
args.aports = [pmaports]
args.config = pmb.config.defaults["config"]
args.timeout = 900
args.details_to_stdout = False
args.quiet = False
args.verbose = True
args.offline = False
args.action = "init"
args.cross = False
args.log = None
init_args(args)
request.addfinalizer(pmb.helpers.logging.logfd.close)
return args
-198
View File
@@ -1,198 +0,0 @@
#!/usr/bin/env python3
# Copyright 2024 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import fnmatch
import glob
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
from pmb.core.pkgrepo import pkgrepo_default_path, pkgrepo_iglob, pkgrepo_relative_path
from pmb.core.arch import Arch
# Cache for codeowners_parse
codeowners_parsed = {}
# Don't complain if these nicknames are the only maintainers of an APKBUILD,
# because they are actually a group of people
gitlab_groups = [
"@sdm845-mainline",
]
def device_dependency_check(apkbuild, path):
""" Raise an error if a device package has a dependency that is not allowed
(e.g. because it should be in a subpackage instead). """
for depend in apkbuild["depends"]:
if depend == "mesa-dri-gallium":
raise RuntimeError(f"{path}: mesa-dri-gallium shouldn't be in"
" depends anymore (see pmaports!3478)")
def test_aports_device():
"""
Various tests performed on the /device/*/device-* aports.
"""
for path in pkgrepo_iglob("device/*/device-*/APKBUILD"):
apkbuild = pmb.parse.apkbuild(path)
# Depends: Require "postmarketos-base"
depend_flag = False
for dependency in apkbuild["depends"]:
if "postmarketos-base" == dependency or "postmarketos-base>" in dependency:
depend_flag = True
if not depend_flag:
raise RuntimeError("Missing 'postmarketos-base' in depends of " +
path)
# Depends: Must not have specific packages
for depend in apkbuild["depends"]:
device_dependency_check(apkbuild, path)
# Architecture
device = apkbuild["pkgname"][len("device-"):]
deviceinfo = pmb.parse.deviceinfo(device)
if Arch.from_str("".join(apkbuild["arch"])) != deviceinfo.arch:
raise RuntimeError("wrong architecture, please change to arch=\""
f"{deviceinfo.arch}\": {path}")
if "!archcheck" not in apkbuild["options"]:
raise RuntimeError("!archcheck missing in options= line: " + path)
def test_aports_device_kernel():
"""
Verify the kernels specified in the device packages:
* Kernel must not be in depends when kernels are in subpackages
* Check if only one kernel is defined in depends
"""
aports = pkgrepo_default_path()
# Iterate over device aports
for path in aports.glob("device/*/device-*/APKBUILD"):
# Parse apkbuild and kernels from subpackages
apkbuild = pmb.parse.apkbuild(path)
device = apkbuild["pkgname"][len("device-"):]
kernels_subpackages = pmb.parse._apkbuild.kernels(device)
# Parse kernels from depends
kernels_depends = []
for depend in apkbuild["depends"]:
if not depend.startswith("linux-") or depend.startswith("linux-firmware-"):
continue
kernels_depends.append(depend)
# Kernel in subpackages *and* depends
if kernels_subpackages:
raise RuntimeError(f"Kernel package '{depend}' needs to"
" be removed when using kernel" +
f" subpackages: {path}")
# No kernel
if not kernels_depends and not kernels_subpackages:
raise RuntimeError("Device doesn't have a kernel in depends or"
f" subpackages: {path}")
# Multiple kernels in depends
if len(kernels_depends) > 1:
raise RuntimeError("Please use kernel subpackages instead of"
" multiple kernels in depends (see"
f" <https://postmarketos.org/devicepkg>): {path}")
def codeowners_parse():
global codeowners_parsed
pattern_prev = None
aports = pkgrepo_default_path()
with open(aports / "CODEOWNERS") as h:
for line in h:
line = line.rstrip()
if not line or line.startswith("#"):
continue
pattern_nicks = line.split()
assert len(pattern_nicks) > 1, f"CODEOWNERS line without nicks: {line}"
pattern = pattern_nicks[0]
if pattern.endswith("/"):
pattern += "*"
nicks = []
for word in pattern_nicks[1:]:
if word.startswith("@"):
nicks += [word]
codeowners_parsed[pattern] = nicks
if pattern_prev:
assert pattern_prev <= pattern, "CODEOWNERS: please order entries alphabetically"
pattern_prev = pattern
def require_enough_codeowners_entries(path, maintainers):
"""
:param path: full path to an APKBUILD (e.g. /home/user/…/APKBUILD)
:param maintainers: list of one or more maintainers
"""
_, path = pkgrepo_relative_path(path)
nicks = set()
for pattern, pattern_nicks in codeowners_parsed.items():
if fnmatch.fnmatch(path, pattern):
for nick in pattern_nicks:
nicks.add(nick)
print(f"{path}:")
print(f" APKBUILD: {maintainers}")
print(f" CODEOWNERS: {nicks}")
if len(nicks) < len(maintainers):
for nick in nicks:
if nick in gitlab_groups:
print(f" -> {nick} is a group")
return
assert len(nicks) >= len(maintainers), \
f"{path}: make sure that each maintainer is listed in CODEOWNERS!"
# @pytest.mark.xfail # Not all aports have been updated yet
def test_aports_maintained():
"""
Ensure that aports in /device/{main,community} have "Maintainer:" and
"Co-Maintainer:" (only required for main) listed in their APKBUILDs. Also
check that at least as many are listed in CODEOWNERS.
"""
codeowners_parse()
for path in pkgrepo_iglob("device/main/*/APKBUILD"):
if 'firmware-' in path.parent.name:
continue
maintainers = pmb.parse._apkbuild.maintainers(path)
assert maintainers and len(maintainers) >= 2, \
f"{path} in main needs at least 1 Maintainer and 1 Co-Maintainer"
require_enough_codeowners_entries(path, maintainers)
for path in pkgrepo_iglob("device/community/*/APKBUILD"):
if 'firmware-' in path.parent.name:
continue
maintainers = pmb.parse._apkbuild.maintainers(path)
assert maintainers, f"{path} in community needs at least 1 Maintainer"
require_enough_codeowners_entries(path, maintainers)
def test_aports_unmaintained():
"""
Ensure that aports in /device/unmaintained have an "Unmaintained:" comment
that describes why the aport is unmaintained.
"""
for path in pkgrepo_iglob("device/unmaintained/*/APKBUILD"):
unmaintained = pmb.parse._apkbuild.unmaintained(path)
assert unmaintained, f"{path} should have an Unmaintained: " +\
"comment that describes why the package is unmaintained"
-91
View File
@@ -1,91 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import os
import pytest
import re
import sys
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob
def deviceinfo_obsolete(info):
"""
Test for obsolete options used in the deviceinfo file. They must still be
defined in pmbootstrap's config/__init__.py.
"""
obsolete_options = [
"usb_rndis_function",
"weston_pixman_type",
]
for option in obsolete_options:
if getattr(info, option, None):
raise RuntimeError(f"option {option} is obsolete, please rename"
" or remove it (see reasons for removal of at"
" https://postmarketos.org/deviceinfo)")
def test_deviceinfo():
"""
Parse all deviceinfo files successfully and run checks on the parsed data.
"""
# Iterate over all devices
last_exception = None
count = 0
pattern = re.compile("^deviceinfo_[a-zA-Z0-9_]*=\".*\"$")
for folder in pkgrepo_iglob("device/*/device-*"):
device = folder.name.split("-", 1)[1]
f = open(folder / "deviceinfo")
lines = f.read().split("\n")
f.close()
try:
for line in lines:
# Require space after # for comments
if line.startswith("#") and not line.startswith("# "):
raise RuntimeError("Comment style: please change '#' to"
f" '# ': {line}")
# Skip empty lines and comments
if not line or line.startswith("# "):
continue
# Variable can not be empty
if '=""' in line:
raise RuntimeError("Please remove the empty variable: " + line)
# Check line against regex (can't use multiple lines etc.)
if not pattern.match(line) or line.endswith("\\\""):
raise RuntimeError("Line looks invalid, maybe missing"
" quotes/multi-line string/comment next"
f" to line instead of above? {line}")
# Successful deviceinfo parsing / obsolete options
info = pmb.parse.deviceinfo(device)
deviceinfo_obsolete(info)
# deviceinfo_name must start with manufacturer
name = info.name
manufacturer = info.manufacturer
if not name.startswith(manufacturer) and \
not name.startswith("Google"):
raise RuntimeError("Please add the manufacturer in front of"
" the deviceinfo_name, e.g.: '" +
manufacturer + " " + name + "'")
# Don't abort on first error
except Exception as e:
last_exception = e
count += 1
print(device + ": " + str(e))
# Raise the last exception
if last_exception:
print("deviceinfo error count: " + str(count))
raise last_exception
-51
View File
@@ -1,51 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Johannes Marbach
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import os
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_default_path, pkgrepo_iglob
def test_aports_firmware():
"""
Various tests performed on the /**/firmware-* aports.
"""
excluded = [
"firmware-motorola-ali", # Depends on firmware-qcom-adreno-a530
"firmware-motorola-potter", # Depends on soc-qcom-msm8916-ucm
"firmware-oneplus-msm8998", # Depends on soc-qcom-sdm845-nonfree-firmware
"firmware-xiaomi-sagit", # Depends on soc-qcom-sdm845-nonfree-firmware
"firmware-samsung-baffinlite", # Depends on firmware-aosp-broadcom-wlan
"firmware-samsung-crespo", # Depends on firmware-aosp-broadcom-wlan
"firmware-samsung-maguro", # Depends on firmware-aosp-broadcom-wlan
"firmware-xiaomi-ferrari", # Depends on soc-qcom-msm8916
"firmware-xiaomi-willow", # Doesn't build, source link is dead (pma#1212)
]
for path in pkgrepo_iglob("**/firmware-*/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(path)
aport_name = os.path.basename(path.parent)
if aport_name not in excluded:
if "pmb:cross-native" not in apkbuild["options"]:
raise RuntimeError(f"{aport_name}: \"pmb:cross-native\" missing in"
" options= line. The pmb:cross-native option is"
" preferred because it results in significantly"
" lower build times. If the package doesn't build"
" with the option, you can add an exemption in"
" .gitlab-ci/testcases/test_firmware.py.")
if "!tracedeps" not in apkbuild["options"]:
raise RuntimeError(f"{aport_name}: \"!tracedeps\" missing in"
" options= line. The tracedeps option is superfluous"
" for firmware packages.")
if "noarch" in apkbuild["arch"]:
raise RuntimeError(f"{aport_name}: \"arch\" must not be \"noarch\"!"
" Please limit this firmware package to the"
" required architectures only!")
-119
View File
@@ -1,119 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
""" Make sure that components of frameworks (Qt, KDE, ...) have the same
version in all packages. We scan all packages, categorize them by URL
and then compare the versions of all packages in each category. """
import glob
import logging
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.config
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs
def get_categorized_packages():
"""
Parse all aports and categorize them.
:returns: {"plasma": {"kwin": "5.13.3", ...},
"kde": {"kcrash": "5.48.0", ...},
"qt": {"qt5-qtbase": "5.12.0", ...},
"other": {"konsole": "1234", ...}}
"""
ret = {}
for path in pkgrepo_iter_package_dirs():
# Parse APKBUILD
apkbuild = pmb.parse.apkbuild(path)
url = apkbuild["url"]
pkgname = apkbuild["pkgname"]
pkgver = apkbuild["pkgver"]
if pkgver == "9999":
pkgver = apkbuild["_pkgver"]
if "_git" in pkgver:
continue
# Categorize by URL
category = "other"
if "https://www.kde.org/workspaces/plasmadesktop" in url:
category = "plasma"
elif "https://community.kde.org/Frameworks" in url:
category = "kde"
elif url in ["http://qt-project.org/",
"https://www.qt.io/developers/"]:
category = "qt"
# Remove hotfix number (i.e. 5.16.90.1 becomes 5.16.90)
if category in ["kde", "plasma"]:
pkgver = ".".join(pkgver.split(".")[0:3])
# Save result
if category not in ret:
ret[category] = {}
ret[category][pkgname] = pkgver
return ret
def check_categories(categories):
"""
Make sure that all packages in one framework (kde, plasma, ...) have the
same package version (and that there is at least one package in each
category).
:param categories: see return of get_categorized_packages()
:returns: True when the check passed, False otherwise
"""
ret = True
for category, packages in categories.items():
reference = None
for pkgname, pkgver in packages.items():
# Use the first package as reference and print a summary
if not reference:
logging.info("---")
logging.info("Package category: " + category)
logging.info("Packages count: " + str(len(packages)))
# Category "other": done after printing the basic summary, no
# need to print each package or compare the package versions
if category == "other":
reference = True
break
# Print all packages
logging.info("Packages: " + ", ".join(sorted(packages.keys())))
# Print the reference and skip checking it against itself
reference = {"pkgname": pkgname, "pkgver": pkgver}
logging.info("Reference pkgver: " + pkgver + " (from '" +
pkgname + "')")
continue
# Check version against reference
if pkgver != reference["pkgver"]:
logging.info("ERROR: " + pkgname + " has version " + pkgver)
ret = False
# Each category must at least have one package
if not reference:
logging.info("ERROR: could not find any packages in category: " +
category)
ret = False
return ret
def test_framework_versions():
"""
Make sure that packages of the same framework have the same version.
"""
categories = get_categorized_packages()
if not check_categories(categories):
raise RuntimeError("Framework version check failed!")
-52
View File
@@ -1,52 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import pytest
import sys
import os
import re
from pathlib import Path
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob, pkgrepo_relative_path
def test_aports_kernel():
"""
Various tests performed on the /**/linux-* aports.
"""
for path in pkgrepo_iglob("**/linux-*/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(path)
aport_name = os.path.basename(os.path.dirname(path))
if "pmb:cross-native" not in apkbuild["options"]:
raise RuntimeError(f"{aport_name}: \"pmb:cross-native\" missing in"
" options= line")
# cross-compilers should not be in makedepends
for ccc in ["gcc-armv7", "gcc-armhf", "gcc-aarch64",
"gcc4-armv7", "gcc4-armhf", "gcc4-aarch64",
"gcc6-armv7", "gcc6-armhf", "gcc6-aarch64"]:
if ccc in apkbuild["makedepends"]:
raise RuntimeError(f"{aport_name}: Cross-compiler ({ccc}) should"
" not be explicitly specified in makedepends!"
" pmbootstrap installs cross-compiler"
" automatically.")
# check some options only for main and community devices
_, relpath = pkgrepo_relative_path(path)
for part in ["main", "community"]:
if part in relpath.parts:
if "pmb:kconfigcheck-community" not in apkbuild["options"]:
raise RuntimeError(f"{aport_name}: \"pmb:kconfigcheck-community\" missing in"
" options= line, required for all community/main devices.")
# check for postmarketos-installkernel in makedepends when installing kernel with make
if bool(re.search("make z?install", path.read_text(encoding="utf-8"))):
if "postmarketos-installkernel" not in apkbuild["makedepends"]:
raise RuntimeError(f"{aport_name}: \"postmarketos-installkernel\" missing in"
" makedepends, required when using make install/zinstall.")
-89
View File
@@ -1,89 +0,0 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import logging
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs, pkgrepo_relative_path
def apkbuild_check_provides(path, apkbuild, version, pkgname, subpkgname=None):
"""
Verify that a package or subpackage is using provides correctly.
:param path: to the APKBUILD for the error message
:param apkbuild: either the full return of pmb.parse.apkbuild() or a
subpackage of it (apkbuild["subpackages"][$subpkgname])
:param version: like 1.0.0-r3 so we can check against it
:param pkgname: package name
:param subpkgname: subpackage name, if we are looking at a subpackage
:returns: list of error strings
"""
name = pkgname
if subpkgname:
name = f"{pkgname}:{subpkgname}"
logging.info(f"{name}: checking provides")
ret = []
if not apkbuild["provides"]:
return ret
for provide in apkbuild["provides"]:
# Having provides entries without version is valid if the
# provider_priorty is also set (pma#1766)
if apkbuild["provider_priority"]:
continue
# Otherwise the version =$pkgver-r$pkgrel needs to be set. pmbootstrap
# already replaces the variables, so we check against the inserted
# values here.
if not provide.endswith(f"={version}"):
provide_no_ver = provide.split("=", 1)[0]
error = f"error in {path}:\n"
if subpkgname:
error += f"in subpackage:\n {subpkgname}\n"
else:
error += f"in package:\n {pkgname}\n"
error += f"broken provides entry:\n {provide_no_ver}\n"
error += "\n"
error += "This provides entry needs to be changed to"
error += f" '{provide_no_ver}=$pkgver-r$pkgrel'"
error += " (do not replace the variables, without '').\n"
error += "\n"
error += "If you know what you are doing and didn't add the"
error += " version on purpose, you also need to set a"
error += " provider_priority (pma#1766).\n"
error += "Reference:"
error += " https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#provides"
ret += [error]
return ret
def test_provides():
errors = []
for path in pkgrepo_iter_package_dirs():
path = path / "APKBUILD"
apkbuild = pmb.parse.apkbuild(path)
pkgname = apkbuild["pkgname"]
version = f"{apkbuild['pkgver']}-r{apkbuild['pkgrel']}"
_, path_rel = pkgrepo_relative_path(path)
errors += apkbuild_check_provides(path_rel, apkbuild, version, pkgname)
for subpkg, subpkg_data in apkbuild["subpackages"].items():
if not subpkg_data:
# default packaging function like -doc
continue
errors += apkbuild_check_provides(path_rel, subpkg_data, version,
pkgname, subpkg)
if errors:
for error in errors:
logging.error(error)
raise RuntimeError(f"test_provides failed with {len(errors)} errors")
-157
View File
@@ -1,157 +0,0 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Various checks on source= in the APKBUILDs
import glob
import logging
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.parse.apkindex
import pmb.helpers.repo
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs, pkgrepo_relative_path
def parse_source_from_checksums(apkbuild_path):
"""
Read the APKBUILD file and parse source files from the checksums at the
bottom. This has always the same format, even if $source is built with hard
to parse shell code (like in postmarketos-base).
:param apkbuild_path: full path to the APKBUILD
:returns: dict of parsed "source" filenames and checksums, e.g.:
{"first.patch": "b4dc4f3…",
"second.patch": "b4dc4f3…"}
"""
start = 'sha512sums="'
in_block = False
ret = {}
with open(apkbuild_path, encoding="utf-8") as handle:
for line in handle.readlines():
# Find start
if not in_block:
if line.startswith(start):
in_block = True
else:
continue
# sha512sums may have lines without checksums:
# https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/73
if " " not in line:
continue
try:
checksum, filename = line.rstrip().split(" ", 2)
except ValueError:
raise ValueError("Failed to parse checksums. Try to delete the"
" checksums and generate them again with"
f" 'pmbootstrap checksum': {apkbuild_path}")
# Cut off 'sha512sums="' if the first checksum is in that line
if checksum.startswith(start):
checksum = checksum[len(start):]
# Find end
if filename.endswith('"'):
filename = filename[:-1]
ret[filename] = checksum
return ret
def test_aports_unreferenced_files():
"""
Raise an error if an unreferenced file is found
"""
for apkbuild_path in pkgrepo_iter_package_dirs():
# pmbootstrap parser has some issues with complicated APKBUILDs, skip those.
_, relpath = pkgrepo_relative_path(apkbuild_path)
if relpath.parts[0] == "cross":
continue
apkbuild_path = apkbuild_path / "APKBUILD"
apkbuild = pmb.parse.apkbuild(apkbuild_path)
sources_chk = parse_source_from_checksums(apkbuild_path)
# Collect files from subpackages
subpackage_installs = []
subpackage_triggers = []
if apkbuild["subpackages"]:
for subpackage in apkbuild["subpackages"].values():
if not subpackage:
continue
subpackage_installs += subpackage.get("install", [])
subpackage_triggers += subpackage.get("triggers", [])
# Collect trigger files
trigger_sources = []
for trigger in apkbuild["triggers"] + subpackage_triggers:
trigger_sources.append(trigger.split("=")[0])
dirname = os.path.dirname(apkbuild_path)
for file in glob.iglob(dirname + "/**", recursive=True):
rel_file_path = os.path.relpath(file, dirname)
# Skip APKBUILDs and directories
if rel_file_path == "APKBUILD" or os.path.isdir(file):
continue
if os.path.basename(rel_file_path) not in sources_chk \
and rel_file_path not in apkbuild["install"] \
and rel_file_path not in subpackage_installs \
and rel_file_path not in trigger_sources:
raise RuntimeError(f"{apkbuild_path}: found unreferenced file: {rel_file_path}")
def test_distfiles_conflict():
"""
Make sure that each filename mentioned in any source= of any APKBUILD
always has the same checksum. This is important because apk caches
downloaded source files in a flat distfiles directory. So if two APKBUILDs
both download a file with the same filename but different checksum, and the
user builds both after each other, abuild will fail on the second build
with a checksum error.
"""
source_all = {}
for apkbuild_path in pkgrepo_iter_package_dirs():
apkbuild_path = apkbuild_path / "APKBUILD"
source = parse_source_from_checksums(apkbuild_path)
dir_path = os.path.dirname(apkbuild_path)
_, apkbuild_rel = pkgrepo_relative_path(apkbuild_path)
for filename, checksum in source.items():
# Files bundled with the APKBUILD don't get copied to the distfiles
# cache, so not relevant for this check. Use glob.glob here and not
# iglob, because we don't want an iterator.
if glob.glob(f"{dir_path}/**/{filename}", recursive=True):
continue
# First time seeing this file
if filename not in source_all:
source_all[filename] = {"checksum": checksum,
"apkbuild_rel": apkbuild_rel}
continue
# Saw this file already with same checksum
if checksum == source_all[filename]["checksum"]:
continue
# Saw this file already with different checksum
logging.error("")
logging.error(f"ERROR: the source file '{filename}' has different"
" checksums in the following files:")
logging.error(f"- {source_all[filename]['apkbuild_rel']}:")
logging.error(f" {source_all[filename]['checksum']}")
logging.error(f"- {apkbuild_rel}:")
logging.error(f" {checksum}")
logging.error("")
logging.error("Fix this by setting a different target filename in"
" the package you modified:")
logging.error("https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#source")
logging.error("")
raise RuntimeError(f"Conflict with source file '{filename}'")
-43
View File
@@ -1,43 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import pytest
import sys
import os
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob
def test_aports_ui():
"""
Raise an error if package in _pmb_recommends is not found
"""
pmaports_cfg = pmb.config.pmaports.read_config()
for arch in pmaports_cfg["supported_arches"].split(","):
for path in pkgrepo_iglob("main/postmarketos-ui-*/APKBUILD"):
apkbuild = pmb.parse.apkbuild(path)
# Skip if arch isn't enabled
if not pmb.helpers.package.check_arch(apkbuild["pkgname"], arch, False):
continue
for package in apkbuild["_pmb_recommends"]:
depend = pmb.helpers.package.get(package,
arch, must_exist=False)
if depend is None or not pmb.helpers.package.check_arch(package, arch):
raise RuntimeError(f"{path}: package '{package}' from"
f" _pmb_recommends not found for arch '{arch}'")
# Check packages from "_pmb_recommends" of -extras subpackage if one exists
if f"{apkbuild['pkgname']}-extras" in apkbuild["subpackages"]:
apkbuild = apkbuild["subpackages"][f"{apkbuild['pkgname']}-extras"]
for package in apkbuild["_pmb_recommends"]:
depend = pmb.helpers.package.get(package,
arch, must_exist=False)
if depend is None or not pmb.helpers.package.check_arch(package, arch):
raise RuntimeError(f"{path}: package '{package}' from _pmb_recommends "
f"of -extras subpackage is not found for arch '{arch}'")
-15
View File
@@ -1,15 +0,0 @@
#!/bin/sh -e
# Description: verify devices are documented in the wiki
# Options: native
# Run natively so we don't need to set up a chroot, python3 is the only dep.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add \
python3
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
.ci/lib/check_devices_in_wiki.py --booting
-4
View File
@@ -1,4 +0,0 @@
{
"SpacesAftertabs": true,
"Exclude": ["temp"]
}
+2 -2
View File
@@ -7,8 +7,8 @@
# Top-most EditorConfig file.
root = true
[{**.{md,ini,sh,rules,nft},**/APKBUILD,CODEOWNERS}]
[**/APKBUILD]
indent_style = tab
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
trim_trailing_whitespace = true
-119
View File
@@ -1,119 +0,0 @@
#!/bin/sh
#
# This hook checks that all local sources specified in the staged APKBUILDs
# are staged too or already committed and that checksums are correct.
#
set -eu
# Maximal allowed size (in bytes) of a file.
FILE_SIZE_LIMIT=262144 # 256 kiB
if ! command -v sha512sum >/dev/null; then
# macOS / BSDs (?) don't have sha512sum, but shasum.
alias sha512sum='shasum -a 512'
fi
error() {
printf '\033[0;31mpre-commit:\033[0m %s\n' "$1" >&2 # red
}
# Prints paths of created or modified files being committed.
changed_files() {
git diff-index \
--name-only \
--cached \
--diff-filter=ACMR HEAD \
-- "$@"
}
# Prints file names and checksums (in format <SHA-512>:<filename>) of local
# sources specified in the APKBUILD ($1).
apkbuild_local_sources() {
apkbuild="$1"
set +eu
. "$apkbuild" || {
error "$apkbuild is invalid"
return 1
}
set -eu
status=0
: ${source:=""}
for src in $source; do
# Skip remote sources.
case "$src" in */*) continue;; esac
echo "$sha512sums" | awk -v src="$src" '
{ if ($2 == src) { ok=1; print($2 ":" $1) } }
END { if (ok != 1) exit 1 }' || {
status=1
error "${apkbuild%/*}: file \"$src\" is missing in \$sha512sums (hint: run pmbootstrap checksum)"
}
done
return $status
}
# check if given object is a symlink
is_symlink() {
test "$(git ls-files --stage "$1" | awk '{print $1}')" = "120000"
}
# Checks that all local sources specified in the APKBUILD file ($1) are
# available in git tree and checksums are correct.
check_local_sources() {
local apkbuild="$1"
local startdir="${apkbuild%/*}"
local status=0
local checksum_act checksum_exp content filename line sources
sources=$(apkbuild_local_sources "$apkbuild")
for line in $sources; do
filename=${line%%:*}
checksum_exp=${line#*:}
if ! git cat-file -e ":$startdir/$filename" 2>/dev/null; then
error "$startdir: missing file \"$filename\""
status=1
continue
fi
if is_symlink ":$startdir/$filename"; then
continue
fi
checksum_act=$(git show ":$startdir/$filename" | sha512sum)
if [ "$checksum_act" != "$checksum_exp -" ]; then
local cmd="pmbootstrap checksum $(basename "$startdir")"
error "$startdir: bad checksum for file \"$filename\" (hint: run $cmd)"
status=1
fi
done
return $status
}
# Checks if the file ($1) being committed is not bigger than FILE_SIZE_LIMIT.
check_file_size() {
local path="$1"
local size
size=$(git cat-file -s ":$path")
if [ $size -gt $FILE_SIZE_LIMIT ]; then
local size_kb=$(( size / 1024 ))
error "file \"$path\" is quite big ($(( size / 1024 )) kiB), better put a remote url in source="
return 1
fi
}
for apkbuild in $(changed_files '**/APKBUILD'); do
check_local_sources "$apkbuild"
done
for path in $(changed_files); do
check_file_size "$path"
done
-49
View File
@@ -1,49 +0,0 @@
#!/bin/sh
#
# This hook adds prefix "<repo>/<pkgname>: " to the commit message when
# committing changes of a single package.
#
MSG_FILE="$1"
SOURCE="$2"
longest_common_prefix() {
awk -F/ '
(NR == 1) { split($0, prefix); prefix_len = NF }
(NR > 1) {
for (i = 1; i <= prefix_len; i++) {
if (prefix[i] != $i) {
prefix_len = i - 1; break
}
}
}
(prefix_len == 0) { exit }
END {
res = prefix[1]
for (i = 2; i <= prefix_len; i++) {
res = res FS prefix[i]
}
print(res)
}'
}
prepend_msg() {
local prefix="$1"
printf '%s\n%s\n' "$prefix" "$(cat "$MSG_FILE")" > "$MSG_FILE"
}
# Do nothing if message has been given using -m, template, merge etc.
[ -z "$SOURCE" ] || exit 0
lcp=$(git diff-index --name-only --cached HEAD | longest_common_prefix)
case "$lcp" in
device/*/*) prepend_msg "$(echo "$lcp" | cut -d/ -f3): ";;
# Multiple packages touched for same device category
# More logic could be added to detect if they all belong to same device
device/*) ;;
[^.]*/*) prepend_msg "$(echo "$lcp" | cut -d/ -f1-2): ";;
esac
exit 0
+2 -1
View File
@@ -20,6 +20,7 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
@@ -114,7 +115,7 @@ ENV/
.idea
# Sources as unpacked and built by abuild
**/src/
/*/*/src/
# Allow having untracked packages in aports using a custom-something directory
/custom-*/
+90 -113
View File
@@ -2,82 +2,76 @@
# global settings
image: alpine:latest
before_script: &global_before_scripts
- apk upgrade -U
after_script:
- .ci/lib/move_logs.sh $CI_PROJECT_DIR
- .gitlab-ci/move_logs.sh $CI_PROJECT_DIR
stages:
- lint
- build
- autoupdate
# This defines the rules for when a pipeline should run.
workflow:
rules:
# Don't run branch pipeline if an MR is open (only the MR pipeline will run)
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never
# Run for merge requests
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Run scheduled pipeline for autoupdate or manually triggered pipeline
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"
# defaults for "only"
# We need to run the CI jobs in a "merge request specific context", if CI is
# running in a merge request. Otherwise the environment variable that holds the
# merge request ID is not available. This means, we must set the "only"
# variable accordingly - and if we only do it for one job, all other jobs will
# not get executed. So have the defaults here, and use them in all jobs that
# should run on both the master branch, and in merge requests.
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/index.html#excluding-certain-jobs
.only-default: &only-default
only:
- v20.05
- merge_requests
- tags
# device documentation
wiki:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
changes:
- .ci/**/*
- .gitlab-ci.yml
- device/*/device-*/*
<<: *only-default
only:
refs:
- merge_requests
changes:
- device/*/device-*/*
before_script:
- apk -q add python3
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/wiki.sh
- .gitlab-ci/check_devices_in_wiki.py --booting
# testcases linting
ruff:
testcases-linting:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
changes:
- .ci/*
- .ci/*/*
- .gitlab-ci.yml
<<: *only-default
only:
refs:
- merge_requests
changes:
- .gitlab-ci/*
- .gitlab-ci/*/*
before_script:
- apk -q add py-flake8
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/ruff.sh
- flake8 --ignore E501,F401,E722,W504,W605
# shellcheck and various grep checks
shellcheck-grep:
# shellcheck
shellcheck:
stage: lint
<<: *only-default
image: alpine:edge
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
before_script:
- apk -q upgrade
- apk -q add shellcheck
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/shellcheck.sh
- .ci/grep.sh
- .ci/codeowners.sh
editor-config:
stage: lint
image: alpine:edge
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/ec.sh
- .gitlab-ci/shellcheck.sh
# aports checks (generic)
pytest-commits:
aports-static:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
<<: *only-default
before_script:
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh pytest
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/pytest.sh
- .ci/commits.sh
- su pmos -c ".gitlab-ci/run_testcases.sh"
- su pmos -c ".gitlab-ci/check_changed_aports_versions.py"
artifacts:
when: on_failure
paths:
@@ -86,37 +80,53 @@ pytest-commits:
- pmbootstrap.cfg
expire_in: 1 week
distfile-check:
stage: lint
<<: *only-default
before_script:
- apk -q add make findutils
- wget "https://gitlab.com/postmarketOS/ci-common/-/archive/master/ci-common-master.tar.bz2"
- tar -xf ci-common-master.tar.bz2
- mv ci-common-master/distfile-check/*.sh ci-common-master/distfile-check/Makefile .
- rm -r ci-common-master ci-common-master.tar.bz2
script:
- make -j999
# APKBUILD linting
aport-lint:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
before_script:
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/apkbuild-lint.sh
- su pmos -c ".gitlab-ci/apkbuild-linting.py"
only:
- merge_requests
allow_failure: true
# kernel kconfig check
kernel-kconfig:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
changes:
- kconfigcheck.toml
- device/*/linux-*/config-*
- main/linux-*/config-*
only:
refs:
- v20.05
- merge_requests
changes:
- device/*/linux-*/config-*
- main/linux-*/config-*
before_script:
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh pytest
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/kconfig.sh
- su pmos -c "pmbootstrap kconfig check"
# MR settings
# (Checks for "Allow commits from members who can merge to the target branch")
mr-settings:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
only:
- merge_requests
before_script:
- *global_before_scripts
- apk -q add python3
script:
- wget -q "https://gitlab.com/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
@@ -125,64 +135,31 @@ mr-settings:
# build changed aports
.build:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "false"
<<: *only-default
before_script:
- *global_before_scripts
- .ci/lib/gitlab_prepare_ci.sh
after_script:
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script:
- .gitlab-ci/build.sh
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
artifacts:
expire_in: 1 week
paths:
- packages/
timeout: 10 h
build-x86_64:
extends: .build
script:
- .ci/build-x86_64.sh
build-x86:
extends: .build
script:
- .ci/build-x86.sh
# disabled on v20.05
# build-x86:
# extends: .build
build-aarch64:
extends: .build
script:
- .ci/build-aarch64.sh
build-armv7:
extends: .build
script:
- .ci/build-armv7.sh
build-armhf:
extends: .build
script:
- .ci/build-armhf.sh
build-riscv64:
extends: .build
script:
- .ci/build-riscv64.sh
auto-update:
stage: autoupdate
rules:
# This variable is set in the scheduled pipeline configuration. It should be a space separated list of
# package names to update.
- if: $AUTOUPDATE_PACKAGES != null && $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"
before_script:
- .ci/lib/gitlab_prepare_ci.sh
script:
- .ci/autoupdate.sh "$AUTOUPDATE_PACKAGES"
after_script:
- .ci/lib/move_logs.sh $CI_PROJECT_DIR
artifacts:
when: on_failure
paths:
- log.txt
- log_testsuite_pmaports.txt
- pmbootstrap.cfg
# disabled on v20.05
# build-armhf:
# extends: .build
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-or-later
import common
import os.path
import sys
if __name__ == "__main__":
common.add_upstream_git_remote()
apkbuilds = {file for file in common.get_changed_files(removed=False)
if os.path.basename(file) == "APKBUILD"}
if len(apkbuilds) < 1:
print("No APKBUILDs to lint")
sys.exit(0)
issues = []
for apkbuild in apkbuilds:
if apkbuild.startswith("temp/") or apkbuild.startswith("cross/"):
print(f"NOTE: Skipping linting of {apkbuild}")
continue
package = os.path.basename(os.path.dirname(apkbuild))
result = common.run_pmbootstrap(["-q", "lint", package], output_return=True)
if len(result) > 0:
issues.append([apkbuild, result])
if len(issues) > 0:
print("Linting issues found:")
for issue in issues:
print(issue[0] + ": " + issue[1])
sys.exit(1)
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh -e
# Convenience wrapper for short arch-specific build jobs in .gitlab-ci.yml
export PYTHONUNBUFFERED=1
JOB_ARCH="${CI_JOB_NAME#build-}"
set -x
su pmos -c ".gitlab-ci/build_changed_aports.py $JOB_ARCH"
@@ -1,25 +1,22 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
import pathlib
# Same dir
import common
# pmbootstrap
import add_pmbootstrap_to_import_path
import testcases.add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.helpers.pmaports
from pmb.core.context import get_context
def build_strict(packages, arch):
common.run_pmbootstrap(["build_init"])
common.run_pmbootstrap(["--details-to-stdout", "--no-ccache", "build",
"--strict", "--force",
"--arch", arch, ] + list(packages))
common.run_pmbootstrap(["--details-to-stdout", "build", "--strict",
"--force", "--arch", arch] + list(packages))
def verify_checksums(packages, arch):
@@ -30,10 +27,6 @@ def verify_checksums(packages, arch):
" not here.")
return
if len(packages) == 0:
print("no packages changed, not doing any checksums verification")
return
common.run_pmbootstrap(["build_init"])
common.run_pmbootstrap(["--details-to-stdout", "checksum", "--verify"] +
list(packages))
@@ -61,16 +54,16 @@ if __name__ == "__main__":
verify_checksums(packages, arch)
sys.exit(0)
# Load context
sys.argv = ["pmbootstrap.py", "chroot"]
# Prepare "args" to use pmbootstrap code
sys.argv = ["pmbootstrap", "chroot"]
args = pmb.parse.arguments()
context = get_context()
# Filter out packages that can't be built for given arch
# (Iterate over copy of packages, because we modify it in this loop)
for package in packages.copy():
apkbuild_path = pmb.helpers.pmaports.find(package)
apkbuild = pmb.parse._apkbuild.apkbuild(pathlib.Path(apkbuild_path, "APKBUILD"))
apkbuild_path = pmb.helpers.pmaports.find(args, package)
apkbuild = pmb.parse._apkbuild.apkbuild(args,
f"{apkbuild_path}/APKBUILD")
if not pmb.helpers.pmaports.check_arches(apkbuild["arch"], arch):
print(f"{package}: not enabled for {arch}, skipping")
+156
View File
@@ -0,0 +1,156 @@
#!/usr/bin/env python3
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import tempfile
import sys
import subprocess
# Same dir
import common
# pmbootstrap
import testcases.add_pmbootstrap_to_import_path # noqa
import pmb.parse
import pmb.parse.version
import pmb.helpers.logging
def get_package_version(args, package, revision, check=True):
# Redirect stderr to /dev/null, so git doesn't complain about files not
# existing in upstream branch for new packages
stderr = None
if not check:
stderr = subprocess.DEVNULL
# Run something like "git show upstream/master:main/hello-world/APKBUILD"
pmaports_dir = common.get_pmaports_dir()
pattern = pmaports_dir + "/**/" + package + "/APKBUILD"
path = glob.glob(pattern, recursive=True)[0][len(pmaports_dir + "/"):]
apkbuild_content = common.run_git(["show", revision + ":" + path], check,
stderr)
if not apkbuild_content:
return None
# Save APKBUILD to a temporary path and parse it from there. (Not the best
# way to do things, but good enough for this CI script.)
with tempfile.TemporaryDirectory() as tempdir:
with open(tempdir + "/APKBUILD", "w", encoding="utf-8") as handle:
handle.write(apkbuild_content)
parsed = pmb.parse.apkbuild(args, tempdir + "/APKBUILD", False, False)
return parsed["pkgver"] + "-r" + parsed["pkgrel"]
def version_compare_operator(result):
""" :param result: return value from pmb.parse.version.compare() """
if result == -1:
return "<"
elif result == 0:
return "=="
elif result == 1:
return ">"
raise RuntimeError("Unexpected version_compare_operator input: " + result)
def exit_with_error_message():
branch = common.get_upstream_branch()
print()
print("ERROR: Modified package(s) don't have an increased version or a")
print("new package has a nonzero pkgrel!")
print()
print("This can happen if you added a new package with a nonzero")
print("pkgrel, or if you did not change the pkgver/pkgrel")
print("variables in the APKBUILDs. Or you did change them, but the")
print(f"packages have been updated in the official '{branch}' branch, and")
print("now your versions are not higher anymore.")
print()
print("Your options:")
print("a) If you made changes to the packages, and did not increase the")
print(" pkgrel/pkgver: increase them now, and force push your branch.")
print(" => https://postmarketos.org/howto-bump-pkgrel-pkgver")
print("b) If you had already increased the package versions, rebase on")
print(f" '{branch}', increase the versions again and then force push:")
print(" => https://postmarketos.org/rebase")
print("c) If you made a change, that does not require rebuilding the")
print(" packages, such as only changing the arch=... line: you can")
print(" disable this check by adding '[ci:skip-vercheck]' to the")
print(" latest commit message, then force push.")
print()
print("Thank you and sorry for the inconvenience.")
exit(1)
def check_versions(args, packages):
error = False
# Get relevant commits: compare HEAD against upstream branch or HEAD~1
# (the latter if this CI check is running on upstream branch). Note that
# for the common.get_changed_files() code, we don't check against
# upstream branch HEAD, but against the latest common ancestor. This is not
# desired here, since we already know what packages changed, and really
# want to check if the version was increased towards *current* upstream
# branch HEAD.
commit = f"upstream/{common.get_upstream_branch()}"
if common.run_git(["rev-parse", "HEAD"]) == common.run_git(["rev-parse",
commit]):
print(f"NOTE: {commit} is on same commit as HEAD, comparing"
" HEAD against HEAD~1.")
commit = "HEAD~1"
for package in packages:
# Get versions, skip new packages
head = get_package_version(args, package, "HEAD")
upstream = get_package_version(args, package, commit, False)
if not upstream:
if head.rpartition('r')[2] != "0":
print(f"- {package}: {head} (HEAD) (new package) [ERROR]")
error = True
else:
print(f"- {package}: {head} (HEAD) (new package)")
continue
# Compare head and upstream versions
result = pmb.parse.version.compare(head, upstream)
if result != 1:
error = True
# Print result line ("- hello-world: 1-r2 (HEAD) > 1-r1 (HEAD~1)")
formatstr = "- {}: {} (HEAD) {} {} ({})"
if result != 1:
formatstr += " [ERROR]"
operator = version_compare_operator(result)
print(formatstr.format(package, head, operator, upstream, commit))
if error:
exit_with_error_message()
if __name__ == "__main__":
# Get and print modified packages
common.add_upstream_git_remote()
packages = common.get_changed_packages()
print(f"Changed packages: {packages}")
# Verify modified package count
common.get_changed_packages_sanity_check(len(packages))
if len(packages) == 0:
print("no aports changed in this branch")
exit(0)
# Potentially skip this check
if common.commit_message_has_string("[ci:skip-vercheck]"):
print("WARNING: not checking for changed package versions"
" ([ci:skip-vercheck])!")
exit(0)
# Initialize args (so we can use pmbootstrap's APKBUILD parsing)
sys.argv = ["pmbootstrap.py", "chroot"]
args = pmb.parse.arguments()
pmb.helpers.logging.init(args)
# Verify package versions
print("checking changed package versions...")
check_versions(args, packages)
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import argparse
@@ -13,17 +13,9 @@ def get_devices():
""":returns: list of all devices"""
ret = []
pmaports = (os.path.realpath(os.path.join(os.path.dirname(__file__) +
"/../..")))
"/..")))
for path in glob.glob(pmaports + "/device/*/device-*/"):
device = os.path.dirname(path).split("device-", 1)[1]
# -downstream suffix is used when packaging the downstream kernel for
# devices that have a working mainline kernel. Those are usually
# unmaintained and therefore might not appear in the wiki. However,
# the main device should be documented (remove the -downstream suffix).
if device.endswith('-downstream'):
device = device[:-len('-downstream')]
ret.append(device)
return sorted(ret)
@@ -53,13 +45,6 @@ def get_wiki_devices_html(path):
return {"booting": split[0], "not_booting": split[1]}
def get_wiki_renamed_devices_html():
""":returns: HTML of the page"""
# Download wiki page
url = "http://wiki.postmarketos.org/wiki/Renamed_Devices"
return urllib.request.urlopen(url).read().decode("utf-8")
def check_device(device, html, is_booting):
""":param is_booting: require the device to be in the booting section, not
just anywhere in the page (i.e. in the not booting
@@ -74,9 +59,6 @@ def check_device(device, html, is_booting):
" section already)")
return False
return True
if device in html["renamed"]:
print(f"WARNING: {device} was renamed in the wiki")
return True
print(device + ": not in the wiki yet.")
return False
@@ -97,7 +79,6 @@ def main():
# Check all devices
html = get_wiki_devices_html(args.path)
html["renamed"] = get_wiki_renamed_devices_html()
error = False
for device in get_devices():
if not check_device(device, html, args.booting):
@@ -106,11 +87,11 @@ def main():
# Ask to adjust the wiki
if error:
print("*** Wiki check failed!")
print("Thank you for porting postmarketOS to a new device! \\o/")
print("Thank you for porting postmarketOS to a new device! \o/")
print("")
print("Now it's time to add some documentation:")
print("1) Create a device specific wiki page as described here:")
print(" https://wiki.postmarketos.org/wiki/Help:Device_Page")
print(" <https://wiki.postmarketos.org/wiki/Help:Device_Page>")
print("2) Set 'booting = yes' in the infobox of your device page.")
print("3) Run these tests again with an empty commit in your MR:")
print(" $ git commit --allow-empty -m 'run tests again'")
@@ -121,10 +102,6 @@ def main():
print("it more easily. Many times one person did a port with basic")
print("functionality, and then someone else jumped in and")
print("contributed major new features.")
print("")
print("NOTE: if you renamed a device in pmaports, rename it in the")
print("wiki as well and make sure to add it here:")
print("https://postmarketos.org/renamed")
return 1
else:
print("*** Wiki check successful!")
+24 -38
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Various functions used in CI scripts
@@ -17,7 +17,7 @@ def get_pmaports_dir():
global cache
if "pmaports_dir" in cache:
return cache["pmaports_dir"]
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/../.."))
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
cache["pmaports_dir"] = ret
return ret
@@ -59,11 +59,6 @@ def get_upstream_branch():
channels.cfg from master to retrieve the upstream branch.
:returns: branch name, e.g. "v20.05" """
# Prefer gitlab CI target branch name if it's set (i.e. running in gitlab CI)
if target_branch := os.environ.get("CI_MERGE_REQUEST_TARGET_BRANCH_NAME"):
return target_branch
global cache
if "upstream_branch" in cache:
return cache["upstream_branch"]
@@ -135,28 +130,27 @@ def get_changed_packages_sanity_check(count):
return
branch = get_upstream_branch()
print(f"""
ERROR: Too many packages have changed!
This is a sanity check, so we don't end up building packages that
have not been modified. CI won't run for more than three hours
anyway.
Your options:
a) If you *did not* modify everything listed above, then rebase
your branch on the official postmarketOS/pmaports.git {branch}
branch. Feel free to ask in the chat for help if you need any.
b) If you *did* modify all these packages, and you assume that
they will build within one hour: skip this sanity check by
adding '[ci:ignore-count]' to the commit message of the last
commit in the merge request (then force push).
c) If you *did* modify all these packages, and you are sure that
they won't build in time, please add '[ci:skip-build]' to the
commit message (then force push). Make sure that all packages
build with 'pmbootstrap build --strict'!
Thank you and sorry for the inconvenience.
""")
print()
print("ERROR: Too many packages have changed!")
print()
print("This is a sanity check, so we don't end up building packages that")
print("have not been modified. CI won't run for more than one hour")
print("anyway.")
print()
print("Your options:")
print("a) If you *did not* modify everything listed above, then rebase")
print(f" your branch on the official postmarketOS/pmaports.git {branch}")
print(" branch. Feel free to ask in the chat for help if you need any.")
print("b) If you *did* modify all these packages, and you assume that")
print(" they will build within one hour: skip this sanity check by")
print(" adding '[ci:ignore-count]' to the commit message (then force")
print(" push).")
print("c) If you *did* modify all these packages, and you are sure that")
print(" they won't build in time, please add '[ci:skip-build]' to the")
print(" commit message (then force push). Make sure that all packages")
print(" build with 'pmbootstrap build --strict'!")
print()
print("Thank you and sorry for the inconvenience.")
sys.exit(1)
@@ -168,7 +162,7 @@ def get_changed_packages():
# Skip files:
# * in the root dir of pmaports (e.g. README.md)
# * path with a dot (e.g. .ci/, device/.shared-patches/)
# * path with a dot (e.g. .gitlab-ci/, device/.shared-patches/)
if not dirname or file.startswith(".") or "/." in file:
continue
@@ -196,11 +190,3 @@ def get_changed_packages():
ret.add(os.path.basename(dirname))
return ret
def get_changed_kernels():
ret = []
for pkgname in get_changed_packages():
if pkgname.startswith("linux-"):
ret += [pkgname]
return ret
@@ -1,9 +1,9 @@
#!/bin/sh -e
# Copyright 2021 Oliver Smith
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
if [ -z "$1" ]; then
echo "usage: $(basename "$0") \$CI_PROJECT_DIR"
echo "usage: $(basename $0) \$CI_PROJECT_DIR"
exit 1
fi
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh -e
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Require pmbootstrap
if ! command -v pmbootstrap > /dev/null; then
echo "ERROR: pmbootstrap needs to be installed."
exit 1
fi
# Wrap pmbootstrap to use this repository for --aports
pmaports="$(cd $(dirname $0)/..; pwd -P)"
_pmbootstrap="$(command -v pmbootstrap)"
pmbootstrap() {
"$_pmbootstrap" --aports="$pmaports" "$@"
}
# Make sure that the work folder format is up to date, and that there are no
# mounts from aborted test cases (pmbootstrap#1595)
pmbootstrap work_migrate
pmbootstrap -q shutdown
# Make sure we have a valid device (pmbootstrap#1128)
device="$(pmbootstrap config device)"
deviceinfo="$pmaports/device/*/device-$device/deviceinfo"
if ! [ -e $deviceinfo ]; then
echo "ERROR: Could not find deviceinfo file for selected device '$device'."
echo "Expected path: $deviceinfo"
echo "Maybe you have switched to a branch where your device does not exist?"
echo "Use 'pmbootstrap config device qemu-amd64' to switch to a valid device."
exit 1
fi
# Run testcases
pytest -vv -x --tb=native "$pmaports/.gitlab-ci/testcases" "$@"
+45
View File
@@ -0,0 +1,45 @@
#!/bin/sh -e
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
set -e
DIR="$(cd "$(dirname "$0")" && pwd -P)"
cd "$DIR/.."
# Find CHANGEMEs in APKBUILDs
if grep -qr '(CHANGEME!)' *; then
echo "ERROR: Please replace '(CHANGEME!)' in the following files:"
grep --color=always -r '(CHANGEME!)' *
exit 1
fi
# Shell: shellcheck
sh_files="
./main/postmarketos-base/firmwareload.sh
./main/postmarketos-mkinitfs/init.sh.in
./main/postmarketos-mkinitfs/init_functions.sh
./main/postmarketos-mkinitfs/mkinitfs.sh
./main/postmarketos-mkinitfs/mkinitfs_functions.sh
./main/postmarketos-mkinitfs/mkinitfs_test.sh
./main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh
./main/postmarketos-update-kernel/update-kernel.sh
./main/mdss-fb-init-hack/mdss-fb-init-hack.sh
$(find . -path './main/postmarketos-ui-*/*.sh')
$(find . -path './main/postmarketos-ui-*/*.pre-install')
$(find . -path './main/postmarketos-ui-*/*.post-install')
$(find . -path './main/postmarketos-ui-*/*.pre-upgrade')
$(find . -path './main/postmarketos-ui-*/*.post-upgrade')
$(find . -path './main/postmarketos-ui-*/*.pre-deinstall')
$(find . -path './main/postmarketos-ui-*/*.post-deinstall')
$(find . -name '*.trigger')
$(find . -path './main/devicepkg-dev/*.sh')
$(find . -path '.gitlab-ci/*.sh')
"
for file in $sh_files; do
echo "Test with shellcheck: $file"
cd "$DIR/../$(dirname "$file")"
shellcheck -e SC1008 -x "$(basename "$file")"
done
@@ -0,0 +1,41 @@
#!/usr/bin/env python3
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import shutil
import sys
import os
import importlib
import importlib.util
from distutils.sysconfig import get_python_lib
def path_pmbootstrap():
""" Find the pmbootstrap installation folder, so we can import the Python
code from there.
returns: pmbootstrap installation folder
"""
# Find 'pmbootstrap' executable
bin = shutil.which("pmbootstrap")
if not bin:
print("ERROR: 'pmbootstrap' not found in $PATH")
sys.exit(1)
# Resolve the symlink and verify the folder
dir = os.path.dirname(os.path.realpath(bin))
if os.path.exists(dir + "/pmb/__init__.py"):
return dir
dir = get_python_lib()
if os.path.exists(dir + "/pmb/__init__.py"):
return dir
# Symlink not set up properly
print("ERROR: 'pmbootstrap' is not a symlink to pmbootstrap.py")
sys.exit(1)
# Check if pmb module can be imported
if importlib.util.find_spec("pmb") is None:
# Add pmbootstrap dir to import path
sys.path.append(os.path.realpath(path_pmbootstrap()))
+205
View File
@@ -0,0 +1,205 @@
#!/usr/bin/env python3
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import pytest
import sys
import os
import add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.parse.apkindex
import pmb.helpers.repo
@pytest.fixture
def args(request):
# Initialize args
sys.argv = ["pmbootstrap",
"--aports", os.path.dirname(__file__) + "/../..",
"--log", "$WORK/log_testsuite_pmaports.txt"
"chroot"]
args = pmb.parse.arguments()
# Initialize logging
pmb.helpers.logging.init(args)
request.addfinalizer(args.logfd.close)
return args
def deviceinfo_obsolete(info):
"""
Test for obsolete options used in the deviceinfo file. They must still be
defined in pmbootstrap's config/__init__.py.
"""
obsolete_options = ["weston_pixman_type"]
for option in obsolete_options:
if info[option]:
raise RuntimeError("option '" + option + "' is obsolete, please"
" remove it (reasons for removal are at"
" <https://postmarketos.org/deviceinfo>)")
def test_deviceinfo(args):
"""
Parse all deviceinfo files successfully and run checks on the parsed data.
"""
# Iterate over all devices
last_exception = None
count = 0
for folder in glob.glob(args.aports + "/device/*/device-*"):
device = folder[len(args.aports):].split("-", 1)[1]
try:
# Successful deviceinfo parsing / obsolete options
info = pmb.parse.deviceinfo(args, device)
deviceinfo_obsolete(info)
# deviceinfo_name must start with manufacturer
name = info["name"]
manufacturer = info["manufacturer"]
if not name.startswith(manufacturer) and \
not name.startswith("Google"):
raise RuntimeError("Please add the manufacturer in front of"
" the deviceinfo_name, e.g.: '" +
manufacturer + " " + name + "'")
# Don't abort on first error
except Exception as e:
last_exception = e
count += 1
print(device + ": " + str(e))
# Raise the last exception
if last_exception:
print("deviceinfo error count: " + str(count))
raise last_exception
def device_dependency_check(apkbuild, path):
""" Raise an error if a device package has a dependency that is not allowed
(e.g. because it should be in a subpackage instead). """
# asus-me176c: without this, the device will simply run the broken ACPI
# DSDT table, so we might as well update it. See pmaports!699.
firmware_ok = {"device-asus-me176c": ["firmware-asus-me176c-acpi"]}
pkgname = apkbuild["pkgname"]
for depend in apkbuild["depends"]:
if (depend.startswith("firmware-") or
depend.startswith("linux-firmware")):
if pkgname in firmware_ok and depend in firmware_ok[pkgname]:
continue
raise RuntimeError("Firmware package '" + depend + "' found in"
" depends of " + path + ". These go into"
" subpackages now, see"
" <https://postmarketos.org/devicepkg>.")
def test_aports_kernel(args):
"""
Various tests performed on the /**/linux-* aports.
"""
for path in glob.iglob(args.aports + "**/linux-*/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(args, path)
if "pmb:cross-native" not in apkbuild["options"]:
raise RuntimeError("\"pmb:cross-native\" missing in"
f" options= line: {path}")
def test_aports_device(args):
"""
Various tests performed on the /device/*/device-* aports.
"""
for path in glob.iglob(args.aports + "/device/*/device-*/APKBUILD"):
apkbuild = pmb.parse.apkbuild(args, path)
# Depends: Require "postmarketos-base"
if "postmarketos-base" not in apkbuild["depends"]:
raise RuntimeError("Missing 'postmarketos-base' in depends of " +
path)
# Depends: Must not have firmware packages
for depend in apkbuild["depends"]:
device_dependency_check(apkbuild, path)
# Architecture
device = apkbuild["pkgname"][len("device-"):]
deviceinfo = pmb.parse.deviceinfo(args, device)
if "".join(apkbuild["arch"]) != deviceinfo["arch"]:
raise RuntimeError("wrong architecture, please change to arch=\"" +
deviceinfo["arch"] + "\": " + path)
if "!archcheck" not in apkbuild["options"]:
raise RuntimeError("!archcheck missing in options= line: " + path)
def test_aports_device_kernel(args):
"""
Verify the kernels specified in the device packages:
* Kernel must not be in depends when kernels are in subpackages
* Check if only one kernel is defined in depends
"""
# Iterate over device aports
for path in glob.glob(args.aports + "/device/*/device-*/APKBUILD"):
# Parse apkbuild and kernels from subpackages
apkbuild = pmb.parse.apkbuild(args, path)
device = apkbuild["pkgname"][len("device-"):]
kernels_subpackages = pmb.parse._apkbuild.kernels(args, device)
# Parse kernels from depends
kernels_depends = []
for depend in apkbuild["depends"]:
if not depend.startswith("linux-"):
continue
kernels_depends.append(depend)
# Kernel in subpackages *and* depends
if kernels_subpackages:
raise RuntimeError("Kernel package '" + depend + "' needs to"
" be removed when using kernel" +
" subpackages: " + path)
# No kernel
if not kernels_depends and not kernels_subpackages:
raise RuntimeError("Device doesn't have a kernel in depends or"
" subpackages: " + path)
# Multiple kernels in depends
if len(kernels_depends) > 1:
raise RuntimeError("Please use kernel subpackages instead of"
" multiple kernels in depends (see"
" <https://postmarketos.org/devicepkg>): " +
path)
def test_aports_ui(args):
"""
Raise an error if package in _pmb_recommends is not found
"""
for arch in pmb.config.build_device_architectures:
for path in glob.iglob(args.aports + "/main/postmarketos-ui-*/APKBUILD"):
apkbuild = pmb.parse.apkbuild(args, path)
# Skip if arch isn't enabled
if not pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch, False):
continue
for package in apkbuild["_pmb_recommends"]:
depend = pmb.helpers.package.get(args, package,
arch, must_exist=False)
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
raise RuntimeError(f"{path}: package '{package}' from"
f" _pmb_recommends not found for arch '{arch}'")
# Check packages from "_pmb_recommends" of -extras subpackage if one exists
if f"{apkbuild['pkgname']}-extras" in apkbuild["subpackages"]:
apkbuild = apkbuild["subpackages"][f"{apkbuild['pkgname']}-extras"]
for package in apkbuild["_pmb_recommends"]:
depend = pmb.helpers.package.get(args, package,
arch, must_exist=False)
if depend is None or not pmb.helpers.package.check_arch(args, package, arch):
raise RuntimeError(f"{path}: package '{package}' from _pmb_recommends "
f"of -extras subpackage is not found for arch '{arch}'")
@@ -0,0 +1,133 @@
#!/usr/bin/env python3
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
""" Make sure that components of frameworks (Qt, KDE, ...) have the same
version in all packages. We scan all packages, categorize them by URL
and then compare the versions of all packages in each category. """
import glob
import logging
import os
import pytest
import sys
import add_pmbootstrap_to_import_path
import pmb.config
import pmb.parse
@pytest.fixture
def args(request):
# Initialize args
sys.argv = ["pmbootstrap",
"--aports", os.path.dirname(__file__) + "/../..",
"--log", "$WORK/log_testsuite_pmaports.txt"
"chroot"]
args = pmb.parse.arguments()
# Initialize logging
pmb.helpers.logging.init(args)
request.addfinalizer(args.logfd.close)
return args
def get_categorized_packages(args):
"""
Parse all aports and categorize them.
:returns: {"plasma": {"kwin": "5.13.3", ...},
"kde": {"kcrash": "5.48.0", ...},
"qt": {"qt5-qtbase": "5.12.0", ...},
"other": {"konsole": "1234", ...}}
"""
ret = {}
for path in glob.glob(args.aports + "/*/*/APKBUILD"):
# Parse APKBUILD
apkbuild = pmb.parse.apkbuild(args, path)
url = apkbuild["url"]
pkgname = apkbuild["pkgname"]
pkgver = apkbuild["pkgver"]
if pkgver == "9999":
pkgver = apkbuild["_pkgver"]
if "_git" in pkgver:
continue
# Categorize by URL
category = "other"
if "https://www.kde.org/workspaces/plasmadesktop" in url:
category = "plasma"
elif "https://community.kde.org/Frameworks" in url:
category = "kde"
elif url in ["http://qt-project.org/",
"https://www.qt.io/developers/"]:
category = "qt"
# Remove hotfix number (i.e. 5.16.90.1 becomes 5.16.90)
if category in ["kde", "plasma"]:
pkgver = ".".join(pkgver.split(".")[0:3])
# Save result
if category not in ret:
ret[category] = {}
ret[category][pkgname] = pkgver
return ret
def check_categories(categories):
"""
Make sure that all packages in one framework (kde, plasma, ...) have the
same package version (and that there is at least one package in each
category).
:param categories: see return of get_categorized_packages()
:returns: True when the check passed, False otherwise
"""
ret = True
for category, packages in categories.items():
reference = None
for pkgname, pkgver in packages.items():
# Use the first package as reference and print a summary
if not reference:
logging.info("---")
logging.info("Package category: " + category)
logging.info("Packages count: " + str(len(packages)))
# Category "other": done after printing the basic summary, no
# need to print each package or compare the package versions
if category == "other":
reference = True
break
# Print all packages
logging.info("Packages: " + ", ".join(sorted(packages.keys())))
# Print the reference and skip checking it against itself
reference = {"pkgname": pkgname, "pkgver": pkgver}
logging.info("Reference pkgver: " + pkgver + " (from '" +
pkgname + "')")
continue
# Check version against reference
if pkgver != reference["pkgver"]:
logging.info("ERROR: " + pkgname + " has version " + pkgver)
ret = False
# Each category must at least have one package
if not reference:
logging.info("ERROR: could not find any packages in category: " +
category)
ret = False
return ret
def test_framework_versions(args):
"""
Make sure that packages of the same framework have the same version.
"""
categories = get_categorized_packages(args)
if not check_categories(categories):
raise RuntimeError("Framework version check failed!")
@@ -5,14 +5,15 @@ import os
import stat
expected_directories = [
"console",
"cross",
"device/archived",
"device/community",
"device/main",
"device/testing",
"kde",
"maemo",
"main",
"modem",
"non-free",
"sxmo",
"temp",
]
@@ -30,7 +31,7 @@ def test_directories():
# Ensure no file in pmaports are executable.
# see https://gitlab.com/postmarketOS/pmaports/-/issues/593.
def test_executable_files():
for file in glob.iglob("[!temp]**/**/*", recursive=True):
for file in glob.iglob("**/*", recursive=True):
if os.path.isdir(file) or os.path.islink(file):
continue
# still check other less common inode types
@@ -46,7 +47,7 @@ def test_executable_files():
# Make sure files are either:
# - in root directory (README.md)
# - hidden (.ci/, device/.shared-patches/)
# - hidden (.gitlab-ci/, device/.shared-patches/)
# - or belong to a package (below a directory with APKBUILD)
def test_files_belong_to_package():
# Walk directories and set package_dir when we find an APKBUILD
@@ -1,31 +0,0 @@
<!-- Use this template to kick off the discussion for changing one or more
related kernel config options.
-->
### Read the fine manual, please :)
- [ ] I have read https://postmarketos.org/kconfig-adjust-multiple
### What benefit does the change have?
### Which option(s) would you like to change?
<!-- Make sure to specify if you would like to enable/disable/set a value. -->
### Did you already test that this works as expected?
<!-- Not required, but recommended. If you did test it, please list which
device you have tested it with. -->
### For which kernel configs would you do the change?
<!-- If it makes sense, we encourage to adjust all kernels used by devices in
the main and community categories, so devices behave consistently. -->
- [ ] all in main and community
- [ ] certain SoC(s):
- [ ] other (please specify):
<!-- leave this, so it applies the correct label in gitlab -->
/label ~"change-kernel-config"
-62
View File
@@ -1,62 +0,0 @@
<!--
Thank you for using postmarketOS! In order to speed up process of resolving your issue,
we would like you to fill in the following form.
*** NOTE FOR CONFIDENTIAL ISSUES: ***
A lot of people can read confidential pmaports issues! If you want to
submit something that only the postmarketOS Core Team can see, write to
team@postmarketos.org
instead of opening an issue here!
-->
### Describe your issue
#### What's the expected behaviour?
#### What's the current behaviour?
#### How to reproduce your issue?
### What device are you using?
<!--
Leave name of your device in vendor-codename format.
If unsure, check name in the device package or leave full name of device
PinePhone: which revision exactly? See https://wiki.pine64.org/index.php/PinePhone#Hardware_revisions
-->
### On what postmarketOS version did you encounter the issue?
<!--
Replace space inside `[ ]` with `x` to fill the checkbox
-->
* [ ] edge (`master` branch)
* [ ] `v24.06`
* [ ] I confirm that the issue still is present after running `sudo apk upgrade -a`
### On what environment did you encounter the issue?
#### Environments
* [ ] GNOME Shell on Mobile
* [ ] Phosh
* [ ] Plasma Mobile
* [ ] Sxmo (Wayland/Sway) **Please post the output of `sxmo_version.sh`**
* [ ] Other: **Please fill out**
### How did you get postmarketOS image?
* [ ] from https://images.postmarketos.org
* [ ] I built it using pmbootstrap
* [ ] It was preinstalled on my device
### What's the build date of the image? (in yyyy-mm-dd format)
<!--
Notes:
can be left empty if unsure
If you downloaded image from images.postmarketos.org, date will be in yyyymmdd format
-->
### Additional information
<!--
logs, etc. -- make use <details> for long listings
If your device displays an error message on boot or drops to the debug
shell, attaching it to your PC with a USB cable may show a removable USB
drive. You can drag and drop the .tar.gz file or otherwise upload it
here.
Refer to the README file on the device for more information.
-->
+6 -1
View File
@@ -1,7 +1,12 @@
{
"subject_format": {
"pass": [
"^(([a-z]+\\/[a-z\\-0-9*{}]+),?)+: [A-Za-z\\/\\-0-9*{}\\(\\)\\.,_&:=' ]+( \\(MR \\d+\\)|)$",
"^[a-z]+/[a-z-0-9*{}]+: new aport(s|)( \\(MR \\d+\\)|)$",
"^[a-z]+/[a-z-0-9*{}]+: pkgrel bump( \\(MR \\d+\\)|)$",
"^[a-z-0-9*{}]+: new device \\([^\\)]+\\)( \\(MR \\d+\\)|)",
"^[a-z]+/[a-z-0-9*{}]+: upgrade to [0-9\\.a-z\\-_]+( \\(MR \\d+\\)|)$",
"^[a-z]+/[a-z-0-9*{}]+: remove( \\(MR \\d+\\)|)$",
"^[a-z]+/[a-z-0-9*{}]+: remove, upstreamed( \\(MR \\d+\\)|)$",
"^CI: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$",
"^mrhlpr.json: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$",
"^pmaports.cfg: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$"
-141
View File
@@ -1,141 +0,0 @@
# https://docs.gitlab.com/ee/user/project/code_owners.html
# Put groups like @sdm845-mainline into test_device.py:gitlab_groups.
# Order lines alphabetically!
device/*/*-amlogic-s905*/ @funderscore
device/*/*-arrow-db410c/ @Minecrell
device/*/*-asus-me176c/ @Minecrell
device/*/*-ayn-odin/ @jenneron
device/*/*-bq-paella/ @Minecrell
device/*/*-bq-tenshi/ @fossdd
device/*/*-google-gru/ @jenneron
device/*/*-google-kukui/ @jenneron @binarycraft
device/*/*-google-oak/ @jenneron @adamthiede
device/*/*-google-trogdor/ @jenneron
device/*/*-google-veyron/ @jenneron
device/*/*-google-x64cros/ @jenneron @JustSoup321 @alpernebbi
device/*/*-htc-golfu/ @Newbyte
device/*/*-htc-m8qlul/ @Newbyte
device/*/*-kobo-clara/ @akemnade
device/*/*-lenovo-21bx/ @craftyguy @jane400
device/*/*-lenovo-a6000/ @jenneron @Minecrell
device/*/*-lenovo-a6010/ @jenneron @Minecrell
device/*/*-librecomputer-lafrite/ @funderscore
device/*/*-librecomputer-lepotato/ @funderscore
device/*/*-librecomputer-solitude/ @Newbyte @funderscore
device/*/*-motorola-harpia/ @Minecrell
device/*/*-nokia-n900/ @sicelo @Danct12
device/*/*-pine64-pinebookpro/ @QC8086
device/*/*-pine64-pinephone/ @craftyguy @milesalan @proycon @anjandev @StacyHarper @Arnavion @PsychoGame
device/*/*-pine64-pinephonepro/ @PsychoGame
device/*/*-pine64-rockpro64/ @PureTryOut
device/*/*-purism-librem5/ @craftyguy @alistair23 @Newbyte
device/*/*-qcom-msm8916/ @Minecrell @TravMurav
device/*/*-qcom-sdm670/ @flamingradian
device/*/*-qcom-sdm845/ @sdm845-mainline
device/*/*-qcom-sm6350/ @z3ntu
device/*/*-samsung-a3/ @Mis012 @TravMurav @Minecrell
device/*/*-samsung-a5/ @Minecrell @minlexx
device/*/*-samsung-e7/ @wonderfulShrineMaidenOfParadise
device/*/*-samsung-espresso10/ @MightyM17
device/*/*-samsung-espresso7/ @MightyM17 @antoni.aloytorrens
device/*/*-samsung-grandmax/ @wonderfulShrineMaidenOfParadise
device/*/*-samsung-gt510/ @TravMurav
device/*/*-samsung-gt58/ @TravMurav
device/*/*-samsung-j5/ @wonderfulShrineMaidenOfParadise
device/*/*-samsung-j5x/ @wonderfulShrineMaidenOfParadise
device/*/*-samsung-serranove/ @Minecrell
device/*/*-tolino-shine2hd/ @akemnade
device/*/*-videostrong-kii-pro/ @funderscore
device/*/*-wileyfox-crackling/ @TravMurav @Minecrell
device/*/*-xiaomi-beryllium/ @joelselvaraj
device/*/*-xiaomi-daisy/ @joelselvaraj @alikates
device/*/*-xiaomi-markw/ @vipaoL
device/*/*-xiaomi-mido/ @barni2000
device/*/*-xiaomi-scorpio/ @Tooniis
device/*/*-xiaomi-tissot/ @jiaxyga @barni2000
device/*/*-xiaomi-vince/ @M0Rf30
device/*/*-xiaomi-wt88047/ @Minecrell
device/*/*-xiaomi-ysl/ @barni2000
device/*/alsa-ucm-conf-cros/ @WeirdTreeThing
device/*/alsa-ucm-conf-qcom-sdm670/ @flamingradian
device/*/device-fairphone-*/ @z3ntu
device/*/device-generic-x86_64/ @craftyguy @ollieparanoid
device/*/device-google-nyan-big/ @jenneron
device/*/device-google-nyan-blaze/ @jenneron
device/*/device-google-peach-pi/ @jenneron
device/*/device-google-peach-pit/ @jenneron
device/*/device-google-sargo/ @flamingradian
device/*/device-google-snow/ @jenneron
device/*/device-huawei-plank/ @gtrxAC
device/*/device-lg-judyln/ @Newbyte
device/*/device-lg-judyp/ @jenneron
device/*/device-microsoft-surface-rt/ @jenneron @jethrob
device/*/device-nvidia-tegra-armv7/ @clamor-s @okias @mschwalm @nokun
device/*/device-odroid-xu4/ @Grimler
device/*/device-oneplus-enchilada/ @calebccff
device/*/device-oneplus-fajita/ @calebccff
device/*/device-postmarketos-trailblazer/ @calebccff
device/*/device-qcom-msm8909/ @wonderfulShrineMaidenOfParadise
device/*/device-qemu-aarch64/ @Minecrell @ollieparanoid
device/*/device-qemu-amd64/ @Minecrell @ollieparanoid
device/*/device-qemu-riscv64/ @Minecrell @z3ntu
device/*/device-qualcomm-sdm845/ @calebccff
device/*/device-raspberry-pi3/ @fossdd
device/*/device-samsung-chagallwifi/ @Grimler
device/*/device-samsung-coreprimevelte/ @legolivesmatter @balejk
device/*/device-samsung-j5y17lte/ @andrisas
device/*/device-samsung-klimtlte/ @Grimler
device/*/device-samsung-lt01/ @knuxify
device/*/device-samsung-m0/ @Newbyte
device/*/device-samsung-manta/ @jenneron @alexmrqt
device/*/device-shift-axolotl/ @amartinz @calebccff @dylanvanassche
device/*/firmware-google-sargo/ @flamingradian
device/*/firmware-google-veyron-brcm/ @jenneron
device/*/firmware-odroid-xu4/ @Grimler
device/*/firmware-oneplus-sdm845/ @calebccff
device/*/firmware-powervr-gx6250/ @jenneron
device/*/kobo-epdc-extractor/ @akemnade
device/*/linux-google-nyan/ @jenneron
device/*/linux-google-veyron/ @jenneron
device/*/linux-huawei-plank/ @gtrxAC
device/*/linux-next/ @calebccff
device/*/linux-postmarketos-allwinner/ @Arnavion @PsychoGame
device/*/linux-postmarketos-amlogic/ @funderscore @exkc
device/*/linux-postmarketos-exynos4/ @Newbyte @Grimler @knuxify
device/*/linux-postmarketos-exynos5/ @jenneron @Grimler
device/*/linux-postmarketos-grate/ @clamor-s @jenneron @jethrob
device/*/linux-postmarketos-imx-ereader/ @akemnade
device/*/linux-postmarketos-mediatek-mt8173/ @jenneron @adamthiede
device/*/linux-postmarketos-mediatek-mt8183/ @jenneron @binarycraft
device/*/linux-postmarketos-omap/ @MightyM17 @Sicelo
device/*/linux-postmarketos-qcom-msm8939/ @Newbyte
device/*/linux-postmarketos-qcom-msm8953/ @M0Rf30 @Ultra-azu @barni2000
device/*/linux-postmarketos-qcom-msm8996/ @Tooniis
device/*/linux-postmarketos-qcom-sc7180/ @jenneron
device/*/linux-postmarketos-rockchip/ @QC8086
device/*/linux-postmarketos-stericsson/ @Newbyte
device/*/linux-samsung-chagallwifi/ @Grimler
device/*/linux-samsung-coreprimevelte/ @legolivesmatter @balejk
device/*/linux-samsung-j5y17lte/ @andrisas
device/*/linux-samsung-klimtlte/ @Grimler
device/*/oem-amd/ @craftyguy
device/*/oem-intel/ @craftyguy
device/*/oem-nvidia/ @craftyguy
device/*/soc-mediatek-mt8183/ @jenneron
device/*/soc-qcom-msm8953/ @barni2000
device/*/soc-qcom-msm8996/ @Tooniis
device/*/soc-qcom-sc7180/ @jenneron
device/*/soc-rockchip-rk3399/ @jenneron
device/*/soc-samsung-exynos4412/ @Newbyte
device/*/u-boot-librem5/ @craftyguy @alistair23 @Newbyte
device/*/u-boot-pinebookpro/ @QC8086
device/*/u-boot-pinephone/ @Arnavion @PsychoGame
device/*/wl1251-cal/ @Danct12
main/postmarketos*gnome*/ @pabloyoyoista @Newbyte
main/postmarketos-initramfs/ @calebccff @craftyguy
main/postmarketos-ui-i3wm/ @fossdd
main/postmarketos-ui-phosh/ @pabloyoyoista @Newbyte
main/postmarketos-ui-plasma-mobile/ @PureTryOut
main/shutdown-clear-rtc-wakealarm/ @Arnavion
main/ttyescape/ @calebccff
-89
View File
@@ -1,89 +0,0 @@
# Policy for commits in pmaports
This document defines policy for organising and titling commits for
inclusion in pmaports.
## Definitions
### Device-specific package
A device-specific package is used to apply configuration and
functionality specifically for device support in postmarketOS.
This is in contrast to other packages
(e.g. main/postmarketos-ui-phosh) in postmarketOS that are used
for configuring the distribution without consideration of the
target device.
## General policy
We follow Alpine's aports commit style with some minor exceptions
and additions. Alpine's commit style can be found here:
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/COMMITSTYLE.md
## Exceptions
### Changes to packages inside of the device directory
While Alpine has the policy of always prefixing package names with
the name of the repository they are in, in the case of pmaports
this can lead to excessively long commit titles due to the nested
subfolders of the device directory. As such, commits changing
packages inside of the device directory should omit the directory
prefix, for example:
device-pine64-pinephone: description of change
Or:
soc-qcom-msm8996: description of change
If the commit only makes device-specific changes, the
commit title can opt to use the following format:
manufacturer-codename: description of change
### Moving devices between categories
As we do not include directory prefixes in device-related commits,
Alpine's commit style for moving packages does not apply. Instead,
we do the following:
manufacturer-codename: move from category to category
For example:
samsung-m0: move from testing to community
## Additions
### Forking packages from Alpine
Run `pmbootstrap aportgen --fork-alpine package` and modify it.
#### Template
- temp/package-name: fork from Alpine
Example: temp/pulseaudio: fork from Alpine
#### Rules
One commit per forked package.
### Adding new devices
Adding a new device package and optionally also a device-specific
Linux and firmware package.
#### Template
- manufacturer-codename: new device
Example: htc-m8qlul: new device
#### Rules
If the device has the option of making use of a device-specific
kernel and/or firmware package, those packages should be included
in the same commit that adds the device package. One device per
commit.
+2 -4
View File
@@ -3,7 +3,5 @@
Helpful resources:
* [How to create a package](https://wiki.postmarketos.org/wiki/Create_a_package)
* [APKBUILD reference](https://wiki.alpinelinux.org/wiki/APKBUILD_Reference)
* [Alpine Linux aports](https://gitlab.alpinelinux.org/alpine/aports/)
* [Alpine Linux package search](https://pkgs.alpinelinux.org/packages)
* [postmarketOS package search](https://pkgs.postmarketos.org/packages)
* [postmarketOS commit style](./COMMITSTYLE.md)
* [Alpine Linux aports](https://git.alpinelinux.org/cgit/aports)
* [Alpine Linux package search](https://pkgs.alpinelinux.org/packages)
-63
View File
@@ -1,63 +0,0 @@
# Reference: https://postmarketos.org/channels.cfg
[channels.cfg]
recommended=edge
[edge]
description=Rolling release / Most devices / Occasional breakage: https://postmarketos.org/edge
branch_pmaports=master
branch_aports=master
mirrordir_alpine=edge
[v24.06]
description=Latest release / Recommended for best stability
branch_pmaports=v24.06
branch_aports=3.20-stable
mirrordir_alpine=v3.20
[v23.12]
description=Old release (unsupported)
branch_pmaports=v23.12
branch_aports=3.19-stable
mirrordir_alpine=v3.19
[v23.06]
description=Old release (unsupported)
branch_pmaports=v23.06
branch_aports=3.18-stable
mirrordir_alpine=v3.18
[v22.12]
description=Old release (unsupported)
branch_pmaports=v22.12
branch_aports=3.17-stable
mirrordir_alpine=v3.17
[v22.06]
description=Old release (unsupported)
branch_pmaports=v22.06
branch_aports=3.16-stable
mirrordir_alpine=v3.16
[v21.12]
description=Old release (unsupported)
branch_pmaports=v21.12
branch_aports=3.15-stable
mirrordir_alpine=v3.15
[v21.06]
description=Old release (unsupported)
branch_pmaports=v21.06
branch_aports=3.14-stable
mirrordir_alpine=v3.14
[v21.03]
description=Old release (unsupported)
branch_pmaports=v21.03
branch_aports=3.13-stable
mirrordir_alpine=v3.13
[v20.05]
description=Old release (unsupported)
branch_pmaports=v20.05
branch_aports=3.12-stable
mirrordir_alpine=v3.12
+29
View File
@@ -0,0 +1,29 @@
# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Danct12 <danct12@disroot.org>
pkgname=console-keyboard-basic
pkgver=0_git20200104
pkgrel=0
pkgdesc="A basic console keyboard"
arch="all"
url="https://github.com/Daniel-Abrecht/console-keyboard-basic"
license="GPL-3.0-or-later"
options="!check" # no testsuite
depends="console-keyboard-multiplexer"
makedepends="ncurses-dev libconsolekeyboard-dev"
# Source
_commit="005fd482e9423b5d45743f098e52ba25255bffc0"
source="
$pkgname-$_commit.tar.gz::https://github.com/Daniel-Abrecht/$pkgname/archive/$_commit.tar.gz
"
builddir="$srcdir/$pkgname-$_commit"
build() {
make
}
package() {
make install-all DESTDIR="$pkgdir"
ln -sf /usr/bin/console-keyboard-basic $pkgdir/usr/bin/console-keyboard
}
sha512sums="6e4ffbfa6f44a2a7a90e7bafc3944e5c34c007ae9c9ab0d7cd26930422af9fb381ece6e4357b4bd2568d319393491130e880ebc0861c729fff482c02cce0114e console-keyboard-basic-005fd482e9423b5d45743f098e52ba25255bffc0.tar.gz"
@@ -0,0 +1,32 @@
# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Danct12 <danct12@disroot.org>
pkgname=console-keyboard-multiplexer
pkgver=0_git20200104
pkgrel=0
pkgdesc="An on screen keyboard for terminals"
arch="all"
url="https://github.com/Daniel-Abrecht/console-keyboard-multiplexer"
install="$pkgname.post-install"
license="AGPL-3.0-or-later"
options="!check" # no testsuite
depends="libconsolekeyboard kbd terminus-font"
makedepends="libconsolekeyboard-dev libttymultiplex-dev libexecinfo-dev"
# Source
_commit="e304969224ba79cdac9e6715fd329a8af278cc33"
source="
$pkgname-$_commit.tar.gz::https://github.com/Daniel-Abrecht/$pkgname/archive/$_commit.tar.gz
ckmvt
"
builddir="$srcdir/$pkgname-$_commit"
build() {
make
}
package() {
make install-bin DESTDIR="$pkgdir"
cp -f $srcdir/ckmvt $pkgdir/usr/bin/ckmvt
}
sha512sums="be8e3a892409ee316ee0478c7d46249ab5eefffaffbe11215f593beab2b0da5ae24392e407748a50d567eaffb9cdcd847e24f077030447fb4753470bc75b8cf4 console-keyboard-multiplexer-e304969224ba79cdac9e6715fd329a8af278cc33.tar.gz
1c56ec846de906ec63446aa07cb40d0e64c7e609e5756497aa63fef6b3b071d0f098071e42450e973b6a7bad670771b1c680e5788b987b852c471d074f909ac1 ckmvt"
@@ -0,0 +1,24 @@
#!/bin/sh
# as for right now, it seems that postmarketOS runs without any color :(
export TERM=linux
nr="$(printf "%s" "$1" | /bin/sed 's/^tty//')"; shift
case "$nr" in
*[!0-9]*)
echo "Usage: $0 vtnumber"
exit 1
;;
esac
tty="$(tty)"
if [ "$(tty)" != "/dev/tty$nr" ]
then exec /sbin/getty -n -l "$0" 38400 "tty$nr" linux
fi
# nicer font (requires terminus-font to be installed)
setfont /usr/share/consolefonts/ter-u24b.psf.gz
exec /usr/bin/console-keyboard-multiplexer -w : -l "CKM$nr" -- login
@@ -0,0 +1,5 @@
#!/bin/sh
echo -e "\n\nTo run getty with keyboard on startup, you'll need to edit /etc/inittab"
echo -e "For example, you want the keyboard on tty1, this is how the entry should be:\n"
echo -e "tty1::respawn:/usr/bin/ckmvt 1\n\n"
+28
View File
@@ -0,0 +1,28 @@
# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Danct12 <danct12@disroot.org>
pkgname=libconsolekeyboard
pkgver=1.0.0_git20191011
pkgrel=0
pkgdesc="A terminal multiplexer library"
arch="all"
url="https://github.com/Daniel-Abrecht/console-keyboard-multiplexer/tree/libconsolekeyboard"
license="LGPL-3.0-or-later"
subpackages="$pkgname-dev"
options="!check" # fails without a proper devfs
# Source
_commit="73611fa86c8a4c375102a4251cb795b30758e32b"
source="
console-keyboard-multiplexer-$_commit.tar.gz::https://github.com/Daniel-Abrecht/console-keyboard-multiplexer/archive/$_commit.tar.gz
"
builddir="$srcdir/console-keyboard-multiplexer-$_commit"
build() {
make
}
package() {
make install DESTDIR="$pkgdir"
}
sha512sums="3f2bd8aa62489068b02e4ac985a69a84ad12a59beabecca0a5a8cc0faba4250ff34e81be9d3dde8861bf9907f7137bea976e036eec286e0fe0bfdb2505e1f0ba console-keyboard-multiplexer-73611fa86c8a4c375102a4251cb795b30758e32b.tar.gz"
+35
View File
@@ -0,0 +1,35 @@
# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Danct12 <danct12@disroot.org>
pkgname=libttymultiplex
pkgver=0.0.1_git20200204
pkgrel=0
pkgdesc="A terminal multiplexer library"
arch="all"
url="https://github.com/Daniel-Abrecht/libttymultiplex"
license="MIT AND AGPL-3.0-or-later"
depends="ncurses"
makedepends="bash ncurses-dev"
subpackages="$pkgname-dev"
options="!check" # fails without a proper devfs
# Source
_commit="91dfd9c6de24314977dd537d25b82cdb994e96ec"
source="
$pkgname-$_commit.tar.gz::https://github.com/Daniel-Abrecht/$pkgname/archive/$_commit.tar.gz
"
builddir="$srcdir/$pkgname-$_commit"
build() {
make -j1 # workaround for ld issues
}
package() {
make install DESTDIR="$pkgdir"
}
check() {
make test
}
sha512sums="955c48003b5612616c40afe2f832a7a0035afd71602a161d71c34d80c886215211185f6a3e13382d235b2936f2459cda105d2c2438c1f750d63de9e7d9304143 libttymultiplex-91dfd9c6de24314977dd537d25b82cdb994e96ec.tar.gz"
+67
View File
@@ -0,0 +1,67 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen binutils-aarch64
# Based on: main/binutils
builddir="$srcdir/binutils-2.34"
pkgname=binutils-aarch64
pkgver=2.34
pkgrel=1
pkgdesc="Tools necessary to build programs for aarch64 targets"
url="https://www.gnu.org/software/binutils/"
makedepends="gettext libtool autoconf automake bison texinfo"
arch="x86_64"
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
gold-mips.patch
ld-bfd-mips.patch
"
if [ "$CHOST" != "$CTARGET" ]; then
pkgname="binutils-$CTARGET_ARCH"
subpackages=""
sonameprefix="binutils:"
fi
# secfixes:
# 2.32-r0:
# - CVE-2018-19931
# - CVE-2018-19932
# - CVE-2018-20002
# - CVE-2018-20712
# 2.28-r1:
# - CVE-2017-7614
build() {
_target="$(arch_to_hostspec aarch64)"
"$builddir"/configure \
--build="$CBUILD" \
--target=$_target \
--with-lib-path=/usr/lib \
--prefix=/usr \
--with-sysroot=/usr/$_target \
--enable-ld=default \
--enable-gold=yes \
--enable-plugins \
--enable-deterministic-archives \
--disable-multilib \
--disable-werror \
--disable-nls
make
}
package() {
make install DESTDIR="$pkgdir"
# remove man, info folders
rm -rf "$pkgdir"/usr/share
}
sha512sums="2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd binutils-2.34.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch"
@@ -0,0 +1,46 @@
This fixes static linking for our hardened toolchain
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index e8126cb..9532bfb 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
+ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
+ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
else
SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
doesn't matter which directory crtbegin.o
is in. */
- KEEP (*crtbegin.o(.ctors))
- KEEP (*crtbegin?.o(.ctors))
+ KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}}
@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
DTOR=".dtors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${DTOR_START}}
- KEEP (*crtbegin.o(.dtors))
- KEEP (*crtbegin?.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
+ KEEP (*crtbegin*.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}}
+39
View File
@@ -0,0 +1,39 @@
# DP: Fix gold on mips64 targets.
gold/
2016-08-09 Aurelien Jarno <aurelien@aurel32.net>
* configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*.
--- a/gold/configure.tgt
+++ b/gold/configure.tgt
@@ -153,6 +153,13 @@ aarch64*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips*64*el*-*-*|mips*64*le*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS_RS3_LE
+ targ_size=64
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
mips*el*-*-*|mips*le*-*-*)
targ_obj=mips
targ_machine=EM_MIPS_RS3_LE
@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips*64*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_big_endian=true
+ targ_extra_big_endian=false
+ ;;
mips*-*-*)
targ_obj=mips
targ_machine=EM_MIPS
+19
View File
@@ -0,0 +1,19 @@
--- ./ld/configure.tgt.orig
+++ ./ld/configure.tgt
@@ -541,12 +541,12 @@
;;
mips*-*-windiss) targ_emul=elf32mipswindiss
;;
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls
;;
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+mips64*-*-linux-*) targ_emul=elf64btsmip
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
targ_extra_libpath=$targ_extra_emuls
;;
mips*el-*-linux-*) targ_emul=elf32ltsmip
+67
View File
@@ -0,0 +1,67 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen binutils-armv7
# Based on: main/binutils
builddir="$srcdir/binutils-2.34"
pkgname=binutils-armv7
pkgver=2.34
pkgrel=1
pkgdesc="Tools necessary to build programs for armv7 targets"
url="https://www.gnu.org/software/binutils/"
makedepends="gettext libtool autoconf automake bison texinfo"
arch="x86_64"
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
binutils-ld-fix-static-linking.patch
gold-mips.patch
ld-bfd-mips.patch
"
if [ "$CHOST" != "$CTARGET" ]; then
pkgname="binutils-$CTARGET_ARCH"
subpackages=""
sonameprefix="binutils:"
fi
# secfixes:
# 2.32-r0:
# - CVE-2018-19931
# - CVE-2018-19932
# - CVE-2018-20002
# - CVE-2018-20712
# 2.28-r1:
# - CVE-2017-7614
build() {
_target="$(arch_to_hostspec armv7)"
"$builddir"/configure \
--build="$CBUILD" \
--target=$_target \
--with-lib-path=/usr/lib \
--prefix=/usr \
--with-sysroot=/usr/$_target \
--enable-ld=default \
--enable-gold=yes \
--enable-plugins \
--enable-deterministic-archives \
--disable-multilib \
--disable-werror \
--disable-nls
make
}
package() {
make install DESTDIR="$pkgdir"
# remove man, info folders
rm -rf "$pkgdir"/usr/share
}
sha512sums="2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd binutils-2.34.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch"
@@ -0,0 +1,46 @@
This fixes static linking for our hardened toolchain
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index e8126cb..9532bfb 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
+ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
+ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
else
SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} :
doesn't matter which directory crtbegin.o
is in. */
- KEEP (*crtbegin.o(.ctors))
- KEEP (*crtbegin?.o(.ctors))
+ KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}}
@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} :
DTOR=".dtors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${DTOR_START}}
- KEEP (*crtbegin.o(.dtors))
- KEEP (*crtbegin?.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
+ KEEP (*crtbegin*.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}}
+39
View File
@@ -0,0 +1,39 @@
# DP: Fix gold on mips64 targets.
gold/
2016-08-09 Aurelien Jarno <aurelien@aurel32.net>
* configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*.
--- a/gold/configure.tgt
+++ b/gold/configure.tgt
@@ -153,6 +153,13 @@ aarch64*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips*64*el*-*-*|mips*64*le*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS_RS3_LE
+ targ_size=64
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
mips*el*-*-*|mips*le*-*-*)
targ_obj=mips
targ_machine=EM_MIPS_RS3_LE
@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips*64*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_big_endian=true
+ targ_extra_big_endian=false
+ ;;
mips*-*-*)
targ_obj=mips
targ_machine=EM_MIPS
+19
View File
@@ -0,0 +1,19 @@
--- ./ld/configure.tgt.orig
+++ ./ld/configure.tgt
@@ -541,12 +541,12 @@
;;
mips*-*-windiss) targ_emul=elf32mipswindiss
;;
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls
;;
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+mips64*-*-linux-*) targ_emul=elf64btsmip
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
targ_extra_libpath=$targ_extra_emuls
;;
mips*el-*-linux-*) targ_emul=elf32ltsmip
+7 -9
View File
@@ -7,30 +7,28 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-aarch64
pkgver=1.36.1
pkgrel=32
pkgver=1.31.1
pkgrel=20
_arch="aarch64"
_mirror="http://dl-4.alpinelinux.org/alpine/"
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
url="http://busybox.net"
license="GPL2"
arch="x86_64"
arch="all"
options="!check !strip"
pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
source="
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/v3.12/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
"
package() {
mkdir -p "$pkgdir/usr/$_target"
cd "$pkgdir/usr/$_target"
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
rm .PKGINFO .SIGN.*
}
sha512sums="
88f07677919711bb577f60e1861f4fa555168a8703a0a3b904550e24d4045135bb0296e00464899fc6231df07db09bb11f1bc81cdf593a71a8f74dfc3333c29e busybox-static-1.36.1-r32-aarch64-edge.apk
"
sha512sums="4d95fbfa910840ba5b36a5c343b62167245999d37e7f3a5598ef1870dcfaa3a15445269651431701d7f6e020fbe21ce1b06561ade6ee20899b8692de9f649114 busybox-static-1.31.1-r20-aarch64.apk"
-36
View File
@@ -1,36 +0,0 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen busybox-static-armhf
# Stub for apkbuild-lint
if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
pkgname=busybox-static-armhf
pkgver=1.36.1
pkgrel=32
_arch="armhf"
_mirror="http://dl-4.alpinelinux.org/alpine/"
url="http://busybox.net"
license="GPL2"
arch="x86_64"
options="!check !strip"
pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
source="
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
"
package() {
mkdir -p "$pkgdir/usr/$_target"
cd "$pkgdir/usr/$_target"
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk
rm .PKGINFO .SIGN.*
}
sha512sums="
b0985e2f62df8f1d4e1b7a1206dc3e462df1e6b2a8aae662e57cc497ca3f474f37cc952de0d3bbaad6532d569bf540f17ad4eccc9cabfdc3c9f95f8feaf08049 busybox-static-1.36.1-r32-armhf-edge.apk
"
+7 -9
View File
@@ -7,30 +7,28 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-armv7
pkgver=1.36.1
pkgrel=32
pkgver=1.31.1
pkgrel=20
_arch="armv7"
_mirror="http://dl-4.alpinelinux.org/alpine/"
_mirror="http://dl-cdn.alpinelinux.org/alpine/"
url="http://busybox.net"
license="GPL2"
arch="x86_64"
arch="all"
options="!check !strip"
pkgdesc="Statically linked Busybox for $_arch"
_target="$(arch_to_hostspec $_arch)"
source="
busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk::$_mirror/edge/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
busybox-static-$pkgver-r$pkgrel-$_arch.apk::$_mirror/v3.12/main/$_arch/busybox-static-$pkgver-r$pkgrel.apk
"
package() {
mkdir -p "$pkgdir/usr/$_target"
cd "$pkgdir/usr/$_target"
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch-edge.apk
tar -xf $srcdir/busybox-static-$pkgver-r$pkgrel-$_arch.apk
rm .PKGINFO .SIGN.*
}
sha512sums="
f383286e58183232b41a0d299528734cb29b11e51112eab1fe513322a269a2cdf90a1341d7e329ed7cd58e2d158e3a80bc3a5290ef93de2b28aaf7a25b78bfd7 busybox-static-1.36.1-r32-armv7-edge.apk
"
sha512sums="170964dcd726c3bd05420d2a46663e75037f2f25391db5a63647ab9e2969e0ef1262f6f02833e7af4861ca26f997952f3c47eadf5938237eeaa1f585343ff869 busybox-static-1.31.1-r20-armv7.apk"
+2 -8
View File
@@ -4,8 +4,8 @@
# ccache, which can then cache the results.
pkgname=ccache-cross-symlinks
pkgver=3
pkgrel=0
pkgver=2
pkgrel=1
pkgdesc="Enable ccache for cross-compilers with symlinks"
url="https://ccache.samba.org/"
arch="noarch"
@@ -30,11 +30,5 @@ package() {
# /native/usr/bin/ccache)
ln -v -s ../../../bin/ccache ${_hostspec}-${_bin}
done
ln -v -s ../../../bin/ccache gcc4-${_hostspec}-gcc
ln -v -s ../../../bin/ccache gcc6-${_hostspec}-gcc
done
ln -v -s ../../../bin/ccache gcc4-gcc
ln -v -s ../../../bin/ccache gcc6-gcc
}
+12 -18
View File
@@ -1,6 +1,3 @@
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
# https://wiki.postmarketos.org/wiki/Pmbootstrap:_Cross_Compiling
#
# Wrapper for the "crossdirect" compilation method.
# pmbootstrap mounts the native chroot in the foreign arch (e.g. armhf) chroot
# as /native. This package gets installed into the native chroot, and creates
@@ -19,14 +16,14 @@
# version is implemented as simple shell wrappers.
pkgname=crossdirect
pkgver=5.1.0
pkgrel=0
pkgver=4
pkgrel=1
pkgdesc="Wrappers to launch native cross compilers in foreign chroots"
url="https://postmarketOS.org"
arch="all"
license="MIT"
options="!check"
source="cargo.sh crossdirect.c rustc.sh rust-qemu-linker.sh"
source="crossdirect.c rustc.sh rust-qemu-linker.sh"
build() {
cd "$srcdir"
@@ -43,6 +40,9 @@ build() {
-Werror \
-DHOSTSPEC="\"$_hostspec\"" \
crossdirect.c
# rustc
sed "s/@ARCH@/$_arch/g" rustc.sh >rustc-"$_arch"
done
}
@@ -51,11 +51,9 @@ package() {
_archs="x86_64 armhf armv7 aarch64"
_bins="c++ cc cpp g++ gcc clang clang++"
# Rust wrappers
# Rust: qemu-linker
install -Dm755 "$srcdir/rust-qemu-linker.sh" \
"$pkgdir/usr/lib/crossdirect/rust-qemu-linker"
install -Dm755 "$srcdir/cargo.sh" "$pkgdir/usr/lib/crossdirect/cargo.sh"
install -Dm755 "$srcdir/rustc.sh" "$pkgdir/usr/lib/crossdirect/rustc.sh"
# Iterate over architectures
for _arch in $_archs; do
@@ -75,14 +73,10 @@ package() {
ln -s "crossdirect-$_arch" "$_hostspec-$_bin"
done
ln -s ../cargo.sh cargo
ln -s ../rustc.sh rustc
# Rust: arch-specific rustc wrapper
install -Dm755 "$srcdir/rustc-$_arch" "$_bindir/rustc"
done
}
sha512sums="
0f4b48f250425dc57f63955fc8b38477d23db793bee367c3fbe03c3d2a559ba576434d07518310db4cae9d90d501af4051b80038b10fae94b980e537fc9374ad cargo.sh
500107e5aff8b34e74b54982ebcd447fc41bc8283956d506561b031a055cb30ec12698047c2604918b4b6d8560fe03db427a63dff2b83c907e8494b7f5233f29 crossdirect.c
de2aa6929bbff5db9132673e667f4525b333d062cb1f7a0597dd924de9e5c7215a9f8e2e6263b6fb5ace06f2c4b64f4ebfd0ede9b78add07c2cd08ec8613e98f rustc.sh
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh
"
sha512sums="20b963322820de038257304c1eefa85767b78e242eda7459f06d70a1cfae5540a445aa7d5587024bf4d88a4bee28120ef9f5c2d24a648e71b542b9618318deb2 crossdirect.c
6be16ba88720e628a3ecc8fa53f8e7a21d2af268b0509745d989139874d6b94b640bfcff09575eaa19073810be6ef91169c1f83e94f5cf8e6819f2670d9408de rustc.sh
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh"
-66
View File
@@ -1,66 +0,0 @@
#!/bin/sh -e
if [ -n "$CROSSDIRECT_DEBUG" ]; then
set -x
fi
native_version=$(LD_LIBRARY_PATH=/native/lib:/native/usr/lib /native/usr/bin/rustc -V)
target_version=$(/usr/bin/rustc -V)
if [ "$target_version" != "$native_version" ]; then
echo "ERROR: crossdirect: rustc version mismatch between native and build chroot. Please update your chroots and try again." >&2
exit 1
fi
triplet=$(/usr/bin/rustc -vV | sed -n 's/host: //p')
cmd=$1
shift
case "$cmd" in
build|test|run)
;;
*)
echo "WARNING: crossdirect: 'cargo $cmd $*' command not supported, running in QEMU (slow!)" >&2
export PATH="$(echo "$PATH" | sed 's,/native/usr/lib/crossdirect/[^:]*:,,')"
exec /usr/bin/cargo "$cmd" "$@"
;;
esac
target_dir=${CARGO_TARGET_DIR:-target}
target_already_specified=${CARGO_BUILD_TARGET:+1}
if [ -z "$target_specified" ]; then
for arg in "$@"; do
if [ "$arg_target_dir" = 1 ]; then
target_dir=$arg
arg_target_dir=0
fi
case "$arg" in
--target|--target=*)
target_already_specified=1
break
;;
--target-dir)
arg_target_dir=1
;;
--target-dir=*)
target_dir=${arg##--target-dir=}
;;
esac
done
fi
if [ -n "$target_already_specified" ]; then
exec /usr/bin/cargo "$cmd" "$@"
fi
/usr/bin/cargo "$cmd" --target=$triplet "$@"
# copy target/$triplet/{release,debug,...} to target/{release,debug,...}
if [ -d "$target_dir/$triplet" ]; then
for dir in "$target_dir/$triplet"/*/; do
build=$(basename "$dir")
rm -rf "$target_dir/$build"
cp -r "$target_dir/$triplet/$build" "$target_dir/$build"
done
fi
+1 -43
View File
@@ -1,34 +1,4 @@
/* Copyright 2020 Zhuowei Zhang, Oliver Smith
* SPDX-License-Identifier: GPL-3.0-or-later
*
* This program gets built to a set of wrapper executables, which launch native
* cross compilers inside foreign arch chroots. Speeds up cross compilation a
* lot, compared to using just qemu user mode emulation or using the previous
* distcc-based methods.
*
* How this program gets called:
* - pmbootstrap creates one native arch chroot and one foreign arch chroot.
* - The native chroot gets mounted as /native in the foreign chroot.
* - When calling "abuild", pmbootstrap sets PATH to:
* /native/usr/lib/crossdirect/<ARCH>:$PATH
* - That crossdirect directory contains a crossdirect-<ARCH> binary built with
* the matching HOSTSPEC (e.g. crossdirect-aarch64 binary with HOSTSPEC
* aarch64-alpine-linux-musl). This binary is symlinked to:
* - <HOSTSPEC>-c++
* - <HOSTSPEC>-cc
* - <HOSTSPEC>-clang
* - <HOSTSPEC>-clang++
* - <HOSTSPEC>-cpp
* - <HOSTSPEC>-g++
* - <HOSTSPEC>-gcc
* - c++
* - cc
* - clang
* - clang++
* - cpp
* - g++
* - gcc
*/
// HOSTSPEC is defined at compile time, see APKBUILD
#include <errno.h>
#include <libgen.h>
@@ -82,31 +52,20 @@ int main(int argc, char **argv)
}
}
// Translate "cc" to "gcc": /usr/bin/cc is a symlink to /usr/bin/gcc,
// but there is no <HOSTSPEC>-cc symlink (pmaports#732)
if (strcmp(executableName, "cc") == 0)
executableName = "gcc";
// prepend the HOSTSPEC to GCC binaries
if (isClang || startsWithHostSpec) {
snprintf(newExecutable, sizeof(newExecutable), NATIVE_BIN_DIR "/%s", executableName);
} else {
snprintf(newExecutable, sizeof(newExecutable), NATIVE_BIN_DIR "/" HOSTSPEC "-%s", executableName);
}
// prepare new arguments for GCC / clang
char **newArgsPtr = newargv;
*newArgsPtr++ = newExecutable;
if (isClang) {
// clang does not use a HOSTSPEC prefix for the cross compiler
// binary, but instead have a -target argument
*newArgsPtr++ = "-target";
*newArgsPtr++ = HOSTSPEC;
}
*newArgsPtr++ = "--sysroot=/";
// add all arguments passed to this executable to GCC / clang and set
// the last arg in newargv to NULL to mark its end
memcpy(newArgsPtr, argv + 1, sizeof(char *) * (argc - 1));
newArgsPtr += (argc - 1);
*newArgsPtr = NULL;
@@ -126,7 +85,6 @@ int main(int argc, char **argv)
}
}
// finally exec GCC / clang
if (execve(newExecutable, newargv, env) == -1) {
fprintf(stderr, "ERROR: crossdirect: failed to execute %s: %s\n", newExecutable, strerror(errno));
fprintf(stderr, "Maybe the target arch is missing in the ccache-cross-symlinks package?\n");
+41 -31
View File
@@ -1,38 +1,48 @@
#!/bin/sh -e
if [ -n "$CROSSDIRECT_DEBUG" ]; then
set -x
fi
rust_triplet() {
# Find the triplets in Alpine's rust APKBUILD or with:
# pmbootstrap chroot -barmhf --add=rust -- ls /usr/lib/rustlib
case "$1" in
x86_64)
echo "x86_64-alpine-linux-musl"
;;
armhf)
echo "armv6-alpine-linux-musleabihf"
;;
armv7)
echo "armv7-alpine-linux-musleabihf"
;;
aarch64)
echo "aarch64-alpine-linux-musl"
;;
*)
echo "ERROR: don't know the rust triple for $1!" >&2
exit 1
;;
esac
}
# return the correct host architecture when cargo requests it
if [ "$*" = "-vV" ] || [ "$*" = "-V" ]; then
exec /usr/bin/rustc "$*"
fi
arch="@ARCH@" # filled in by APKBUILD
# pmbootstrap installs sccache when building a rust program, unless --no-ccache
# is set. In that case it also sets CCACHE_DISABLE.
SCCACHE=/native/usr/bin/sccache
if ! [ -e "$SCCACHE" ] || [ -n "$CCACHE_DISABLE" ]; then
SCCACHE=""
fi
# We expect the right target to be set in the arguments if compiling for the
# target architecture. Our cargo wrapper passes the right "--target" argument
# automatically. If no target is provided, this is probably a macro or a
# build script, so it should be compiled for the native architecture.
if echo "$*" | grep -qFe "--target"; then
# Not using sccache when building for foreign architecture, as it
# doesn't cache the output with "Non-cacheable reasons: --sysroot"
LD_LIBRARY_PATH=/native/lib:/native/usr/lib \
/native/usr/bin/rustc \
if ! LD_LIBRARY_PATH=/native/lib:/native/usr/lib \
/native/usr/bin/rustc \
-Clinker=/native/usr/lib/crossdirect/rust-qemu-linker \
--target=$(rust_triplet "$arch") \
--sysroot=/usr \
"$@"
else
PATH=/native/usr/bin:/native/bin \
LD_LIBRARY_PATH=/native/lib:/native/usr/lib \
$SCCACHE \
/native/usr/bin/rustc \
-Clink-arg=-Wl,-rpath,/native/lib:/native/usr/lib \
"$@"
"$@"; then
echo "---" >&2
echo "WARNING: crossdirect: cross compiling with rustc failed, trying"\
"again with rustc + qemu" >&2
echo "---" >&2
# Usually the crossdirect approach works; however, when passing
# --extern to rustc with a dynamic library (.so), it fails with an
# error like 'can't find crate for `serde_derive`' (although the crate
# does exist). I think it fails to parse the metadata of the so file
# for some reason. We probably need to adjust rustc's
# librustc_metadata/locator.rs or something (and upstream that
# change!), but I've spent enough time on this already. Let's simply
# fall back to compiling in qemu in the very few cases where this is
# necessary.
/usr/bin/rustc "$@"
fi
@@ -1,42 +0,0 @@
From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH 01/35] posix_memalign
---
gcc/config/i386/pmm_malloc.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
index 3527283693b..c4071b64b53 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
#include <stdlib.h>
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
- may not be visible. */
+ may not be visible and we can't pollute the namespace either. */
#ifndef __cplusplus
-extern int posix_memalign (void **, size_t, size_t);
+extern int _mm_posix_memalign (void **, size_t, size_t)
#else
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
#endif
+__asm__("posix_memalign");
static __inline void *
_mm_malloc (size_t __size, size_t __alignment)
@@ -42,7 +43,7 @@ _mm_malloc (size_t __size, size_t __alignment)
return malloc (__size);
if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
__alignment = sizeof (void *);
- if (posix_memalign (&__ptr, __alignment, __size) == 0)
+ if (_mm_posix_memalign (&__ptr, __alignment, __size) == 0)
return __ptr;
else
return NULL;
--
2.41.0
@@ -1,203 +0,0 @@
From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH 02/35] gcc: poison-system-directories
Add /sw/include and /opt/include based on the original
zecke-no-host-includes.patch patch. The original patch checked for
/usr/include, /sw/include and /opt/include and then triggered a failure and
aborted.
Instead, we add the two missing items to the current scan. If the user
wants this to be a failure, they can add "-Werror=poison-system-directories".
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
---
gcc/common.opt | 4 ++++
gcc/config.in | 6 ++++++
gcc/configure | 16 ++++++++++++++++
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.cc | 2 ++
gcc/incpath.cc | 21 +++++++++++++++++++++
7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index 862c474d3c8..64c4277c991 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -711,6 +711,10 @@ Wreturn-local-addr
Common Var(warn_return_local_addr) Init(1) Warning
Warn about returning a pointer/reference to a local or temporary variable.
+Wpoison-system-directories
+Common Var(flag_poison_system_directories) Init(1) Warning
+Warn for -I and -L options using system directories if cross compiling
+
Wshadow
Common Var(warn_shadow) Warning
Warn when one variable shadows another. Same as -Wshadow=global.
diff --git a/gcc/config.in b/gcc/config.in
index 4cad077bfbe..0679fbbf4c6 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -236,6 +236,12 @@
#endif
+/* Define to warn for use of native system header directories */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
+#endif
+
+
/* Define if you want all operations on RTL (the basic data structure of the
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
diff --git a/gcc/configure b/gcc/configure
index c7b26d1927d..8c46369f73f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1026,6 +1026,7 @@ enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
+enable_poison_system_directories
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1788,6 +1789,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
+ --enable-poison-system-directories
+ warn for use of native system header directories
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31753,6 +31756,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
+# Check whether --enable-poison-system-directories was given.
+if test "${enable_poison_system_directories+set}" = set; then :
+ enableval=$enable_poison_system_directories;
+else
+ enable_poison_system_directories=no
+fi
+
+if test "x${enable_poison_system_directories}" = "xyes"; then
+
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
+
+fi
+
# Substitute configuration variables
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 09082e8ccae..5504bf6eb01 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7292,6 +7292,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
+AC_ARG_ENABLE([poison-system-directories],
+ AS_HELP_STRING([--enable-poison-system-directories],
+ [warn for use of native system header directories]),,
+ [enable_poison_system_directories=no])
+if test "x${enable_poison_system_directories}" = "xyes"; then
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
+ [1],
+ [Define to warn for use of native system header directories])
+fi
+
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index af0e5933fdb..b6731a4673c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -384,6 +384,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded
-Wparentheses -Wno-pedantic-ms-format
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast
+-Wno-poison-system-directories
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls
-Wrestrict -Wno-return-local-addr -Wreturn-type
-Wno-scalar-storage-order -Wsequence-point
@@ -8426,6 +8427,14 @@ made up of data only and thus requires no special treatment. But, for
most targets, it is made up of code and thus requires the stack to be
made executable in order for the program to work properly.
+@opindex Wno-poison-system-directories
+@item -Wno-poison-system-directories
+Do not warn for @option{-I} or @option{-L} options using system
+directories such as @file{/usr/include} when cross compiling. This
+option is intended for use in chroot environments when such
+directories contain the correct headers and libraries for the target
+system rather than the host.
+
@opindex Wfloat-equal
@opindex Wno-float-equal
@item -Wfloat-equal
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 16bb07f2cdc..33b56e721d2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1177,6 +1187,8 @@ proper position among the other output files. */
"-z now " \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
+ %{Wno-poison-system-directories:--no-poison-system-directories} \
+ %{Werror=poison-system-directories:--error-poison-system-directories} \
%{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
index 4d44321183f..0f3f071b44c 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
@@ -26,6 +26,7 @@
#include "intl.h"
#include "incpath.h"
#include "cppdefault.h"
+#include "diagnostic-core.h"
/* Microsoft Windows does not natively support inodes.
VMS has non-numeric inodes. */
@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
}
fprintf (stderr, _("End of search list.\n"));
}
+
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
+ if (flag_poison_system_directories)
+ {
+ struct cpp_dir *p;
+
+ for (p = heads[INC_QUOTE]; p; p = p->next)
+ {
+ if ((!strncmp (p->name, "/usr/include", 12))
+ || (!strncmp (p->name, "/usr/local/include", 18))
+ || (!strncmp (p->name, "/usr/X11R6/include", 18))
+ || (!strncmp (p->name, "/sw/include", 11))
+ || (!strncmp (p->name, "/opt/include", 12)))
+ warning (OPT_Wpoison_system_directories,
+ "include location \"%s\" is unsafe for "
+ "cross-compilation",
+ p->name);
+ }
+ }
+#endif
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.41.0
@@ -0,0 +1,42 @@
From 65eb86f3e110998d30489df009d44b4bc1043adc Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH 02/12] posix_memalign
---
gcc/config/i386/pmm_malloc.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
index ffbb7f82cf5..b0b890d2403 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
#include <stdlib.h>
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
- may not be visible. */
+ may not be visible and we can't pollute the namespace either. */
#ifndef __cplusplus
-extern int posix_memalign (void **, size_t, size_t);
+extern int _mm_posix_memalign (void **, size_t, size_t)
#else
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
#endif
+__asm__("posix_memalign");
static __inline void *
_mm_malloc (size_t __size, size_t __alignment)
@@ -42,7 +43,7 @@ _mm_malloc (size_t __size, size_t __alignment)
return malloc (__size);
if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
__alignment = sizeof (void *);
- if (posix_memalign (&__ptr, __alignment, __size) == 0)
+ if (_mm_posix_memalign (&__ptr, __alignment, __size) == 0)
return __ptr;
else
return NULL;
--
2.17.1
@@ -0,0 +1,194 @@
From 48c670d2678e0323d88eb72205e039f393cabe05 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH 03/39] gcc: poison-system-directories
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Inappropriate [distribution: codesourcery]
---
gcc/common.opt | 4 ++++
gcc/config.in | 6 ++++++
gcc/configure | 16 ++++++++++++++++
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.c | 2 ++
gcc/incpath.c | 19 +++++++++++++++++++
7 files changed, 66 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index d6ef85928f3..7b29efe3882 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -679,6 +679,10 @@ Wreturn-local-addr
Common Var(warn_return_local_addr) Init(1) Warning
Warn about returning a pointer/reference to a local or temporary variable.
+Wpoison-system-directories
+Common Var(flag_poison_system_directories) Init(1) Warning
+Warn for -I and -L options using system directories if cross compiling
+
Wshadow
Common Var(warn_shadow) Warning
Warn when one variable shadows another. Same as -Wshadow=global.
diff --git a/gcc/config.in b/gcc/config.in
index 5bccb408016..1c784a8276b 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -194,6 +194,12 @@
#endif
+/* Define to warn for use of native system header directories */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
+#endif
+
+
/* Define if you want all operations on RTL (the basic data structure of the
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
diff --git a/gcc/configure b/gcc/configure
index 5c345ce0fd7..cafd05fd150 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -953,6 +953,7 @@ with_system_zlib
enable_maintainer_mode
enable_link_mutex
enable_version_specific_runtime_libs
+enable_poison_system_directories
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1696,6 +1697,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
+ --enable-poison-system-directories
+ warn for use of native system header directories
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -29715,6 +29718,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
+# Check whether --enable-poison-system-directories was given.
+if test "${enable_poison_system_directories+set}" = set; then :
+ enableval=$enable_poison_system_directories;
+else
+ enable_poison_system_directories=no
+fi
+
+if test "x${enable_poison_system_directories}" = "xyes"; then
+
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
+
+fi
+
# Substitute configuration variables
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 65dbf1f2f80..dd5b38195ce 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6341,6 +6341,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
+AC_ARG_ENABLE([poison-system-directories],
+ AS_HELP_STRING([--enable-poison-system-directories],
+ [warn for use of native system header directories]),,
+ [enable_poison_system_directories=no])
+if test "x${enable_poison_system_directories}" = "xyes"; then
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
+ [1],
+ [Define to warn for use of native system header directories])
+fi
+
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 255149fcfb8..cb71b60fe3c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -303,6 +303,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wpacked-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
-Wplacement-new -Wplacement-new=@var{n} @gol
+-Wno-poison-system-directories @gol
-Wpointer-arith -Wpointer-compare -Wno-pointer-to-int-cast @gol
-Wno-pragmas -Wredundant-decls -Wrestrict -Wno-return-local-addr @gol
-Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol
@@ -5712,6 +5713,14 @@ made up of data only and thus requires no special treatment. But, for
most targets, it is made up of code and thus requires the stack to be
made executable in order for the program to work properly.
+@item -Wno-poison-system-directories
+@opindex Wno-poison-system-directories
+Do not warn for @option{-I} or @option{-L} options using system
+directories such as @file{/usr/include} when cross compiling. This
+option is intended for use in chroot environments when such
+directories contain the correct headers and libraries for the target
+system rather than the host.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a716f708259..02b3cd39fc2 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1061,6 +1060,8 @@
"-z relro -z now " \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
+ %{Wno-poison-system-directories:--no-poison-system-directories} \
+ %{Werror=poison-system-directories:--error-poison-system-directories} \
%{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
diff --git a/gcc/incpath.c b/gcc/incpath.c
index b11c6a57939..e3b7a21966f 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -26,6 +26,7 @@
#include "intl.h"
#include "incpath.h"
#include "cppdefault.h"
+#include "diagnostic-core.h"
/* Microsoft Windows does not natively support inodes.
VMS has non-numeric inodes. */
@@ -393,6 +394,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
}
fprintf (stderr, _("End of search list.\n"));
}
+
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
+ if (flag_poison_system_directories)
+ {
+ struct cpp_dir *p;
+
+ for (p = heads[INC_QUOTE]; p; p = p->next)
+ {
+ if ((!strncmp (p->name, "/usr/include", 12))
+ || (!strncmp (p->name, "/usr/local/include", 18))
+ || (!strncmp (p->name, "/usr/X11R6/include", 18))
+ || (!strncmp (p->name, "/sw/include", 11))
+ || (!strncmp (p->name, "/opt/include", 12)))
+ warning (OPT_Wpoison_system_directories,
+ "include location \"%s\" is unsafe for "
+ "cross-compilation",
+ p->name);
+ }
+ }
+#endif
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.17.0
@@ -1,44 +0,0 @@
From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH 03/35] specs: turn on -Wl,-z,now by default
Previously, we also used to turn on -z relro here, but we now build
binutils with --enable-relro, which is functionally equivalent.
Binutils does not appear to have a similar option for enabling -z
now by default.
---
gcc/doc/invoke.texi | 3 +++
gcc/gcc.cc | 1 +
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b6731a4673c..f393c7846c6 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -17961,6 +17961,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
linker. When using the GNU linker, you can also get the same effect with
@option{-Wl,-Map=output.map}.
+NOTE: In Alpine Linux, for LDFLAGS, the option
+@option{-Wl,-z,now} is used. To disable, use @option{-Wl,-z,nonow}.
+
@opindex u
@item -u @var{symbol}
Pretend the symbol @var{symbol} is undefined, to force linking of
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 33b56e721d2..f82fae23c22 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1144,6 +1144,7 @@ proper position among the other output files. */
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+ "-z now " \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.41.0
@@ -1,46 +0,0 @@
From 1b315235433701e4a974da259b8d651169ddc7ac Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
ObjC, ObjC++, if the optimization level is > 0
---
gcc/c-family/c-cppbuiltin.cc | 4 ++++
gcc/doc/invoke.texi | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 5d64625fcd7..868d69506e4 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1546,6 +1546,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ /* Fortify Source enabled by default for optimization levels > 0 */
+ if (optimize)
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
+
/* Misc. */
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index f393c7846c6..ef3c14a189e 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11868,6 +11868,12 @@ also turns on the following optimization flags:
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
+set by default, and is activated when @option{-O} is set to 2 or higher.
+This enables additional compile-time and run-time checks for several libc
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@opindex O3
@item -O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.41.0
@@ -1,272 +0,0 @@
From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:56 +0000
Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the
linker, but always link the sanitizer libraries with --no-as-needed.
---
gcc/config/aarch64/aarch64-linux.h | 1 +
gcc/config/alpha/linux-elf.h | 2 +-
gcc/config/arm/linux-elf.h | 1 +
gcc/config/gnu-user.h | 6 +++---
gcc/config/i386/gnu-user.h | 2 +-
gcc/config/i386/gnu-user64.h | 1 +
gcc/config/ia64/linux.h | 2 +-
gcc/config/mips/gnu-user.h | 1 +
gcc/config/riscv/linux.h | 1 +
gcc/config/rs6000/linux64.h | 4 ++--
gcc/config/rs6000/sysv4.h | 2 +-
gcc/config/s390/linux.h | 2 +-
gcc/config/sparc/linux.h | 2 +-
gcc/gcc.cc | 28 ++++++++++++++++++++--------
14 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 4277f03da2a..b131983a546 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
#define LINUX_TARGET_LINK_SPEC "%{h*} \
+ --as-needed \
%{static:-Bstatic} \
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index 03f783f2ad1..d946e700dda 100644
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
#define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
+#define LINK_SPEC "-m elf64alpha --as-needed %{G*} %{relax:-relax} \
%{O*:-O3} %{!O*:-O1} \
%{shared:-shared} \
%{!shared: \
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index 7b7b7cbbe14..49c050c6f2c 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
%{rdynamic:-export-dynamic} \
%{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
-X \
+ --as-needed \
%{mbig-endian:-EB} %{mlittle-endian:-EL}" \
SUBTARGET_EXTRA_LINK_SPEC
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index eda8010b133..b26b17f2f2a 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
"%{static-libasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#undef LIBHWASAN_EARLY_SPEC
#define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \
"%{static-libhwasan:%{!shared:" \
@@ -146,12 +146,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
"%{static-libtsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#undef LIBLSAN_EARLY_SPEC
#define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
"%{static-liblsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#endif
#undef TARGET_F951_OPTIONS
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index a79b739089d..e0752673dff 100644
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
{ "link_emulation", GNU_USER_LINK_EMULATION },\
{ "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --as-needed %{shared:-shared} \
%{!shared: \
%{!static: \
%{!static-pie: \
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index 3b63b99acf6..759bf0db86f 100644
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
"%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
%{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
%{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
+ --as-needed \
%{shared:-shared} \
%{!shared: \
%{!static: \
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index 5dfd428aa17..02656dad7fc 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "\
+#define LINK_SPEC " --as-needed \
%{shared:-shared} \
%{!shared: \
%{!static: \
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
index a4e5380b589..3cc61bce69f 100644
--- a/gcc/config/mips/gnu-user.h
+++ b/gcc/config/mips/gnu-user.h
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
#undef GNU_USER_TARGET_LINK_SPEC
#define GNU_USER_TARGET_LINK_SPEC "\
%{G*} %{EB} %{EL} %{mips*} %{shared} \
+ -as-needed \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 3e625e0f867..f8c2c351e5a 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
"%{mabi=ilp32:_ilp32}"
#define LINK_SPEC "\
+-as-needed \
-melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \
%{mno-relax:--no-relax} \
%{mbig-endian:-EB} \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 9e457033d11..08016bf224d 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -377,13 +377,13 @@ extern int dot_symbols;
" -m elf64ppc")
#endif
-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --as-needed %{!shared: %{!static: \
%{!static-pie: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \
%(link_os_extra_spec32)"
-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --as-needed %{!shared: %{!static: \
%{!static-pie: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index ae932fc22f0..c8ff0c6dc8e 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -780,7 +780,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --as-needed %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index 02aa1edaff8..64df5801134 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
#undef LINK_SPEC
#define LINK_SPEC \
- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \
%{shared:-shared} \
%{!shared: \
%{static:-static} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 0e33b3cac2c..c2f44546e62 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+#define LINK_SPEC "-m elf32_sparc --as-needed %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index f82fae23c22..da6417dd0d1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -754,8 +754,11 @@ proper position among the other output files. */
#ifdef LIBASAN_EARLY_SPEC
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
- "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \
+#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
+ " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " -lasan " \
+ " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -790,8 +793,11 @@ proper position among the other output files. */
#ifdef LIBTSAN_EARLY_SPEC
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
- "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
+ " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " -ltsan " \
+ " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -808,8 +814,11 @@ proper position among the other output files. */
#ifdef LIBLSAN_EARLY_SPEC
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \
- "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
+ " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " -llsan " \
+ " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -824,8 +833,11 @@ proper position among the other output files. */
#define STATIC_LIBUBSAN_LIBS \
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
-#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \
- "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
+ " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+ " -lubsan " \
+ " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.41.0
@@ -1,34 +0,0 @@
From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default.
---
gcc/c-family/c.opt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index a75038930ae..b98726f33ed 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -704,7 +704,7 @@ Warn about function calls with format strings that write past the end
of the destination region. Same as -Wformat-overflow=1.
Wformat-security
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
Warn about possible security problems with format functions.
Wformat-signedness
@@ -725,7 +725,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
Warn about printf/scanf/strftime/strfmon format string anomalies.
Wformat-overflow=
--
2.41.0
@@ -1,25 +0,0 @@
From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:48:24 +0000
Subject: [PATCH 07/35] Enable -Wtrampolines by default.
---
gcc/common.opt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/common.opt b/gcc/common.opt
index 64c4277c991..c24839d32bc 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -803,7 +803,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers.
Wtrampolines
-Common Var(warn_trampolines) Warning
+Common Var(warn_trampolines) Init(1) Warning
Warn whenever a trampoline is generated.
Wtrivial-auto-var-init
--
2.41.0
@@ -1,53 +0,0 @@
From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:49:40 +0000
Subject: [PATCH 08/35] Disable ssp on -nostdlib, -nodefaultlibs and
-ffreestanding Change the buffer size.
---
gcc/gcc.cc | 8 +++++++-
gcc/params.opt | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index da6417dd0d1..b5a6f200635 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -983,6 +983,12 @@ proper position among the other output files. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
+#ifdef ENABLE_DEFAULT_SSP
+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
+#else
+#define NO_SSP_SPEC ""
+#endif
+
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1282,7 +1288,7 @@ static const char *cc1_options =
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
- %{fsyntax-only:-o %j} %{-param*}\
+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
%{coverage:-fprofile-arcs -ftest-coverage}\
%{fprofile-arcs|fprofile-generate*|coverage:\
%{!fprofile-update=single:\
diff --git a/gcc/params.opt b/gcc/params.opt
index 823cdb2ff85..5b096899b40 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -1006,7 +1006,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
The maximum number of SSA_NAME assignments to follow in determining a value.
-param=ssp-buffer-size=
-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization
+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization
The lower bound for a buffer to be considered for stack smashing protection.
-param=stack-clash-protection-guard-size=
--
2.41.0
@@ -0,0 +1,26 @@
From b693804c8dba92fea7beee98f0aa520853a0532b Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Thu, 22 Dec 2016 11:22:28 +0000
Subject: [PATCH 08/12] s390x muslldso
---
gcc/config/s390/linux.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index 525c17c2c9f..2d4f4a0654e 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -76,6 +76,9 @@ along with GCC; see the file COPYING3. If not see
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-s390.so.1"
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-s390x.so.1"
+
#undef LINK_SPEC
#define LINK_SPEC \
"%{m31:-m elf_s390}%{m64:-m elf64_s390} \
--
2.17.1
@@ -1,54 +0,0 @@
From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:50:33 +0000
Subject: [PATCH 09/35] Ensure that msgfmt doesn't encounter problems during
gcc bootstrapping.
Solves error messages like the following:
msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6)
The libgcc_s.so used during build doesn't satisfy the needs of the
libstdc++.so that msgfmt is linked against. On the other hand, msgfmt
is used as a stand-alone application here, and what library it uses
behind the scenes is of no concern to the gcc build process.
Therefore, simply invoking it "as usual", i.e. without any special
library path, will make it work as expected here.
2011-09-19 Martin von Gagern
References:
https://bugs.gentoo.org/372377
https://bugs.gentoo.org/295480
---
libstdc++-v3/po/Makefile.am | 1 +
libstdc++-v3/po/Makefile.in | 1 +
2 files changed, 2 insertions(+)
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
index 12d34910830..61b13762b71 100644
--- a/libstdc++-v3/po/Makefile.am
+++ b/libstdc++-v3/po/Makefile.am
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN)
.po.mo:
+ env --unset=LD_LIBRARY_PATH \
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 8e93445acd2..d6ff06e5ddb 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -561,6 +561,7 @@ uninstall-am:
.po.mo:
+ env --unset=LD_LIBRARY_PATH \
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
--
2.41.0
@@ -1,28 +0,0 @@
From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:52:07 +0000
Subject: [PATCH 10/35] Don't declare asprintf if defined as a macro.
---
include/libiberty.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/libiberty.h b/include/libiberty.h
index 1d5c779fcff..19e3cb1e31c 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
/* Like sprintf but provides a pointer to malloc'd storage, which must
be freed by the caller. */
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
+#ifndef asprintf
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
#endif
+#endif
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.41.0
@@ -0,0 +1,76 @@
From 47467f3ab0fb2f2fcede81060fe8bb339d0909eb Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Wed, 28 Feb 2018 00:54:05 +0000
Subject: [PATCH 10/12] ldbl128 config
---
gcc/configure | 13 +++++++++++++
gcc/configure.ac | 16 ++++++++++++++--
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/gcc/configure b/gcc/configure
index 6121e163259..07ff8597d48 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -29309,6 +29309,15 @@ if test "${with_long_double_128+set}" = set; then :
withval=$with_long_double_128; gcc_cv_target_ldbl128="$with_long_double_128"
else
+ case "$target" in
+ s390*-*-linux-musl*)
+ gcc_cv_target_ldbl128=yes
+ ;;
+ powerpc*-*-linux-musl*)
+ gcc_cv_target_ldbl128=no
+ ;;
+ *)
+
if test $glibc_version_major -gt 2 \
|| ( test $glibc_version_major -eq 2 && test $glibc_version_minor -ge 4 ); then :
gcc_cv_target_ldbl128=yes
@@ -29320,6 +29329,10 @@ else
&& gcc_cv_target_ldbl128=yes
fi
+
+ ;;
+ esac
+
fi
;;
diff --git a/gcc/configure.ac b/gcc/configure.ac
index b066cc609e1..6c15ed898c0 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5971,13 +5971,25 @@ case "$target" in
AC_ARG_WITH(long-double-128,
[AS_HELP_STRING([--with-long-double-128],
[use 128-bit long double by default])],
- gcc_cv_target_ldbl128="$with_long_double_128",
+ gcc_cv_target_ldbl128="$with_long_double_128", [
+ case "$target" in
+ s390*-*-linux-musl*)
+ gcc_cv_target_ldbl128=yes
+ ;;
+ powerpc*-*-linux-musl*)
+ gcc_cv_target_ldbl128=no
+ ;;
+ *)]
[GCC_GLIBC_VERSION_GTE_IFELSE([2], [4], [gcc_cv_target_ldbl128=yes], [
[gcc_cv_target_ldbl128=no
grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \
$target_header_dir/bits/wordsize.h > /dev/null 2>&1 \
&& gcc_cv_target_ldbl128=yes
- ]])])
+ ]])]
+ [
+ ;;
+ esac
+ ])
;;
esac
if test x$gcc_cv_target_ldbl128 = xyes; then
--
2.17.1
@@ -1,24 +0,0 @@
From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:00 +0000
Subject: [PATCH 11/35] libiberty: copy PIC objects during build process
---
libiberty/Makefile.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 72608f3e4a7..58356884728 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
+ cp $(TARGETLIB) ../ ; \
cd ..; \
else true; fi
--
2.41.0
-57
View File
@@ -1,57 +0,0 @@
From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 24 Oct 2015 20:09:53 +0000
Subject: [PATCH 12/35] libgcc_s
---
gcc/config/i386/i386-expand.cc | 4 ++--
libgcc/config/i386/cpuinfo.c | 6 +++---
libgcc/config/i386/t-linux | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 0d817fc3f3b..2e99db00db9 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -12691,10 +12691,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
- /* Make it call __cpu_indicator_init in libgcc. */
+ /* Make it call __cpu_indicator_init in libgcc.a. */
tree call_expr, fndecl, type;
type = build_function_type_list (integer_type_node, NULL_TREE);
- fndecl = build_fn_decl ("__cpu_indicator_init", type);
+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
call_expr = build_call_expr (fndecl, 0);
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
}
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 50b6d8248a2..724ced402a1 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
__cpu_features2);
}
-#if defined SHARED && defined USE_ELF_SYMVER
-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
+#ifndef SHARED
+int __cpu_indicator_init_local (void)
+ __attribute__ ((weak, alias ("__cpu_indicator_init")));
#endif
diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
index 8506a635790..564296f788e 100644
--- a/libgcc/config/i386/t-linux
+++ b/libgcc/config/i386/t-linux
@@ -3,5 +3,5 @@
# t-slibgcc-elf-ver and t-linux
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS)
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
--
2.41.0
+107
View File
@@ -0,0 +1,107 @@
From a4aa319f7c19e564dced3daeb7222c9315af936c Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 18 Aug 2018 23:58:45 +0000
Subject: [PATCH 12/12] static-pie
in gcc-8 -static means static non-pie, even if -pie or -static-pie
are specified, -static-pie can be used to build static pie.
in musl toolchains -static -pie always meant static pie, so this
patch fixes the link specs accordingly, the new -static-pie is just
an alias to -static -pie.
---
gcc/common.opt | 4 ++--
gcc/config/gnu-user.h | 12 +++++-------
gcc/config/rs6000/sysv4.h | 11 +++++------
gcc/gcc.c | 6 +++---
4 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/gcc/common.opt b/gcc/common.opt
index b52ef0b38c8..0ce5857e01d 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3197,11 +3197,11 @@ Driver
no-pie
Driver RejectNegative Negative(shared)
-Don't create a dynamically linked position independent executable.
+Don't create a position independent executable.
pie
Driver RejectNegative Negative(no-pie)
-Create a dynamically linked position independent executable.
+Create a position independent executable.
static-pie
Driver RejectNegative Negative(pie)
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 8620de3e42d..235328a2642 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -51,13 +51,12 @@
#define GNU_USER_TARGET_STARTFILE_SPEC \
"%{shared:; \
pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \
- static:crt1.o%s; \
- static-pie:rcrt1.o%s; \
+ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \
" PIE_SPEC ":Scrt1.o%s; \
:crt1.o%s} " \
GNU_USER_TARGET_CRTI " \
- %{static:crtbeginT.o%s; \
- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \
+ %{shared|" PIE_SPEC ":crtbeginS.o%s; \
+ static:crtbeginT.o%s; \
:crtbegin.o%s} \
%{fvtable-verify=none:%s; \
fvtable-verify=preinit:vtv_start_preinit.o%s; \
@@ -76,8 +75,7 @@
"%{fvtable-verify=none:%s; \
fvtable-verify=preinit:vtv_end_preinit.o%s; \
fvtable-verify=std:vtv_end.o%s} \
- %{static:crtend.o%s; \
- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
+ %{shared|" PIE_SPEC ":crtendS.o%s; \
:crtend.o%s} " \
GNU_USER_TARGET_CRTN " " \
CRTOFFLOADEND
@@ -133,7 +131,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
#if defined(HAVE_LD_EH_FRAME_HDR)
-#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
+#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} "
#endif
#undef LINK_GCC_C_SEQUENCE_SPEC
diff --git a/gcc/gcc.c b/gcc/gcc.c
index eb1610ba8b0..87560afb03c 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -900,7 +900,7 @@ proper position among the other output files. */
#define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC
#define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;"
#else
-#define PIE_SPEC "pie"
+#define PIE_SPEC "pie|static-pie"
#define FPIE1_SPEC "fpie"
#define NO_FPIE1_SPEC FPIE1_SPEC ":;"
#define FPIE2_SPEC "fPIE"
@@ -924,12 +924,12 @@ proper position among the other output files. */
#ifndef LINK_PIE_SPEC
#ifdef HAVE_LD_PIE
#ifndef LD_PIE_SPEC
-#define LD_PIE_SPEC "-pie"
+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic}"
#endif
#else
#define LD_PIE_SPEC ""
#endif
-#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
+#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
#endif
#ifndef LINK_BUILDID_SPEC
--
2.17.1
-85
View File
@@ -1,85 +0,0 @@
From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 7 Nov 2015 02:08:05 +0000
Subject: [PATCH 13/35] nopie
---
gcc/configure | 27 +++++++++++++++++++++++++++
gcc/configure.ac | 13 +++++++++++++
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index 23da7d55d..f38732bb2 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -34534,6 +34534,29 @@ rm -f core conftest.err conftest.$ac_objext \
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5
$as_echo "$gcc_cv_no_pie" >&6; }
+# Check if -nopie works.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5
+$as_echo_n "checking for -nopie option... " >&6; }
+if ${gcc_cv_nopie+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -nopie"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int main(void) {return 0;}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gcc_cv_nopie=yes
+else
+ gcc_cv_nopie=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$saved_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5
+$as_echo "$gcc_cv_nopie" >&6; }
if test x$enable_host_shared = xyes; then
PICFLAG=-fPIC
@@ -34551,6 +34574,8 @@ if test x$enable_host_pie = xyes; then
LD_PICFLAG=-pie
elif test x$gcc_cv_no_pie = xyes; then
LD_PICFLAG=-no-pie
+elif test x$gcc_cv_nopie = xyes; then
+ LD_PICFLAG=-nopie
else
LD_PICFLAG=
fi
diff --git a/gcc/configure.ac b/gcc/configure.ac
index d7cf0b92c..db2e2c802 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7781,6 +7781,15 @@ AC_CACHE_CHECK([for -no-pie option],
[gcc_cv_no_pie=yes],
[gcc_cv_no_pie=no])
LDFLAGS="$saved_LDFLAGS"])
+# Check if -nopie works.
+AC_CACHE_CHECK([for -nopie option],
+ [gcc_cv_nopie],
+ [saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -nopie"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])],
+ [gcc_cv_nopie=yes],
+ [gcc_cv_nopie=no])
+ LDFLAGS="$saved_LDFLAGS"])
if test x$enable_host_shared = xyes; then
PICFLAG=-fPIC
@@ -7798,6 +7807,8 @@ if test x$enable_host_pie = xyes; then
LD_PICFLAG=-pie
elif test x$gcc_cv_no_pie = xyes; then
LD_PICFLAG=-no-pie
+elif test x$gcc_cv_nopie = xyes; then
+ LD_PICFLAG=-nopie
else
LD_PICFLAG=
fi
--
2.41.0
Loaded 100 of 6422 files, more files were not shown because too many files have changed in this diff. Show more