Compare commits

..
162 Commits
Author SHA1 Message Date
Alexey Minnekhanov 865019f98d cross/busybox-static-*: upgrade to 1.34.1-r6 2022-07-07 11:46:12 +03:00
Luca Weiss d489a67288 main/postmarketos-ui-sxmo-de-sway: depend on postmarketos-upgrade-gtk3 (MR 3198) 2022-06-27 07:52:24 +02:00
Luca Weiss 0b768ba3e1 main/postmarketos-ui-sxmo-de-dwm: depend on postmarketos-upgrade-gtk3 (MR 3198) 2022-06-27 07:52:24 +02:00
Luca Weiss 0bc135b737 main/postmarketos-ui-plasma-mobile: depend on postmarketos-upgrade-gtk3 (MR 3198) 2022-06-27 07:52:24 +02:00
Luca Weiss 13c96c4608 main/postmarketos-ui-phosh: depend on postmarketos-upgrade-gtk3 (MR 3198) 2022-06-27 07:52:23 +02:00
Bart Ribbers 97f41f3859 main/postmarketos-upgrade-gtk3: new aport (MR 3198) 2022-06-27 07:52:18 +02:00
Luca Weiss 3512cc3749 main/linux-postmarketos-rockchip: fix waydroid kconfig check (MR 3252)
Recently pmbootstrap mandates also vndbinder being part of
CONFIG_ANDROID_BINDER_DEVICES. Adjust the config so it matches.

[ci:skip-build]: already built successful in CI
2022-06-24 10:06:32 +02:00
Oliver Smith 2ac9f6c444 main/postmarketos-release-upgrade: upgrade to 1.2.1 (MR 3237)
(cherry picked from commit f7b5c3bed2)
2022-06-15 13:15:53 +02:00
Oliver Smith 733bda8af3 main/postmarketos-release-upgrade: upgrade to 1.2.0 (MR 3232)
Most importantly, this fixes upgrading to edge.

Related: https://gitlab.com/postmarketOS/postmarketos-release-upgrade/-/tags/1.2.0
(cherry picked from commit 01e348b3a5)
2022-06-14 10:20:46 +02:00
Oliver Smith 2a0d32970c main/postmarketos-release-upgrade: upgrade to 1.1.2 (MR 3227)
(cherry picked from commit b3a26d80b7)
2022-06-12 14:10:28 +02:00
Oliver Smith 64299d6c32 main/postmarketos-release-upgrade: new aport (MR 3197)
[ci:skip-build]: already built successfully in CI

(cherry picked from commit 8c4e11ab5b)
2022-06-07 09:48:20 +02:00
Martijn Braam 5e70101c75 main/postmarketos-base: bump to v21.12.5 (MR 3132)
[ci:skip-build]: already built successfully in CI
2022-05-15 19:20:03 +02:00
Martijn Braam 6317d99f9f main/postmarketos-tweaks: upgrade to 0.12.0 (MR 3129) (MR 3132)
[ci:skip-build]: already built successfully in CI
2022-05-15 14:08:37 +02:00
Antoni Aloy Torrens 03cb8c537a community/linux-samsung-espresso3g: Fix WiFi reboot issue (MR 3130) (MR 3132)
- Patch from Robert Nelson and Hansem Ro.

- Based on the work of Hansem Ro,
  who owns another device, the First Generation Kindle Fire,
  which has similar specifications as the Samsung Galaxy Tab 2 7.0.
2022-05-15 14:08:32 +02:00
Yassine Oudjana b311110ae6 xiaomi-scorpio: change device tree name (MR 3126) (MR 3132)
The device tree in the kernel is now named msm8996pro-xiaomi-scorpio.dts.
[ci:skip-build]: already built successfully in CI
2022-05-13 23:11:18 +02:00
Yassine Oudjana e68f911757 community/linux-postmarketos-qcom-msm8996: upgrade to 5.17.6 (MR 3126) (MR 3132)
- Add support for Xiaomi Mi 5s Plus (xiaomi-natrium)
- Update charger driver
- Fix race condition in qcom-ngd-ctrl probe
2022-05-13 23:10:09 +02:00
Alexander Martinz b1620dd736 community/linux-postmarketos-qcom-sdm845: upgrade to 5.17.5 (MR 3118) (MR 3132)
For a merge list, please see the merge commits:
  - 5.17.1 - (https://gitlab.com/sdm845-mainline/linux/-/commit/6151d07534a46eee9ddfbbaedd756a4752e9e6c2)
  - 5.17.2 - (https://gitlab.com/sdm845-mainline/linux/-/commit/c8e2541a5370c981ad8f6949761f7be3848ea863)
  - 5.17.3 - (https://gitlab.com/sdm845-mainline/linux/-/commit/f7006752c1317055acf3a56a4fa8fb5f189c2eb4)
  - 5.17.4 - (https://gitlab.com/sdm845-mainline/linux/-/commit/ee8fb89013f6772493eb7be5a9d361dbcd69b179)
  - 5.17.5 - (https://gitlab.com/sdm845-mainline/linux/-/commit/b33c0511c507e34750d3cb6c1ca3f91e0f0249bc)

Change-Id: Ic1ec5571bd981aa6c24c619aac24ecd2a941d604
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
[ci:skip-build]: already built successfully in CI
2022-05-13 23:09:32 +02:00
Anjandev Momi 6ed9582957 temp/superd: backport for sxmo 1.9.0 (MR 3102)
sxmo 1.9.0 will not be packaged in pmOS stable but we want superd in pmOS stable
so we can support users using the latest git head on pmOS stable.

[ci:skip-build]: already built successfully in CI
2022-05-06 08:54:48 +02:00
Alexey Min 6724df91cf main/postmarketos-base: fix error after upstream changes (MR 2970) (MR 3094)
Fixes error: postmarketos-base-18-r0: trying to overwrite etc/fstab owned by alpine-baselayout-data-3.2.0-r20.

caused by https://gitlab.alpinelinux.org/alpine/aports/-/commit/9ecba8a514827daf64521008306fb137b498ebf5

NOTE by ollieparanoid: cherry-picked from
432627c921 (master branch) by Dylan to fix
upgrading from v21.12 to the next release. Thanks!
2022-04-26 09:42:16 +02:00
Martijn Braam 017cebbf13 main/postmarketos-base: bump to v21.12.4 (MR 3070)
[ci:ignore-count] [ci:skip-build]
2022-04-17 23:49:55 +02:00
Joel Selvaraj 4aaa125a6b community/linux-postmarketos-qcom-sdm845: upgrade to 5.17.0 (MR 2982) (MR 3070) 2022-04-14 14:24:21 +02:00
Joel Selvaraj 67da3b37be community/soc-qcom-sdm845: update ucm conf and add q6voiced for call audio support (MR 2982) (MR 3070)
Also, moving the modemmanager.conf file from the main package to the
nonfree-firmware subpackage as Modem Manager is going to work
only if the nonfree-firmwares are present.
2022-04-14 14:24:21 +02:00
Joel Selvaraj 55abb4944e community/device-xiaomi-beryllium: add q6voiced conf and fix dependency (MR 2982) (MR 3070)
The soc-qcom-sdm845-nonfree-firmware dependency is now moved from
firmware-xiaomi-beryllium package to the device package.
This will make the firmware package to only depend on firmware files.
2022-04-14 14:24:20 +02:00
Joel Selvaraj 177d39daa9 community/device-oneplus-enchilada: add q6voiced conf and fix dependency (MR 2982) (MR 3070)
The soc-qcom-sdm845-nonfree-firmware dependency is now moved from
firmware-oneplus-sdm845 package to the device package.
This will make the firmware package to only depend on firmware  files.
2022-04-14 14:24:19 +02:00
Joel Selvaraj 2fc34fb266 community/device-oneplus-fajita: fix dependency (MR 2982) (MR 3070)
The soc-qcom-sdm845-nonfree-firmware dependency is now moved from
firmware-oneplus-sdm845 package to the device package.
This will make the firmware package to only depend on firmware  files.
2022-04-14 14:24:18 +02:00
Joel Selvaraj 7fa696223d community/firmware-oneplus-sdm845: remove soc-qcom-sdm845-nonfree-firmware dependency (MR 2982) (MR 3070)
The soc-qcom-sdm845-nonfree-firmware dependency is now moved from
firmware-oneplus-sdm845 package to the device package.
This will make the firmware package to only depend on firmware  files.
Also, pmb:cross-native is added to the package options so CI testcases
doesn't fail.
2022-04-14 14:24:18 +02:00
Sicelo A. Mhlongo 4a8b8c252e linux-nokia-n900: update kernel to LTS 5.15.31 (MR 3032) (MR 3070)
[ci:skip-build] Already built successfuly on CI in MR
2022-04-12 19:00:30 +02:00
Martijn Braam 8bd151c7d4 community/samsung-espresso3g: backport from edge (MR 3070)
Backport the samsung-espresso3g related packages from
edge for the stable service pack
2022-04-12 19:00:30 +02:00
Dylan Van Assche e6ed74041c linux-odroid-hc2: upgrade to 5.16.14 (MR 3006) (MR 3070)
[ci:skip-build]: already built successfully in CI
2022-04-12 19:00:29 +02:00
Martijn Braam 606c55ed3c device/pine64-pinephone: increase lima timeout (MR 3070)
The lima timeout is increased to 2000ms to prevent an issue
where the screen starts flickering between 2 frames when the
CPU load is high.

For details see https://gitlab.com/postmarketOS/pmaports/-/issues/805
2022-04-12 19:00:23 +02:00
Martijn Braam 9c9c991d76 main/powersupply: upgrade to 0.6.0 (MR 3025) (MR 3070) 2022-04-12 18:55:02 +02:00
Martijn Braam dc4a225992 main/postmarketos-tweaks: upgrade to 0.11.0 (MR 3024) (MR 3070) 2022-04-11 16:28:39 +02:00
Oliver Smith 9f89fa86b3 cross/busybox-static-*: upgrade to 1.34.1-r5 2022-04-10 14:37:16 +02:00
Oliver Smith 00da43910d Revert "temp/squeekboard: backport upgrade to 1.16.0 (MR 2967)"
Fails to build, revert it to unblock publishing the rest of the service
pack. Details in:
https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2110

This reverts commit 9540fe060d.
2022-03-14 08:38:59 +01:00
Alexander Martinz 5a8eca20c6 linux-postmarketos-qcom-sdm845: upgrade to 5.16.12 (MR 2986) (MR 2967)
For a merge list, please see the merge commits:
  - 5.16.6  - (https://gitlab.com/sdm845-mainline/linux/-/commit/521f32a4e0920b3ef3bc29fd0a6811dbe8c6f21a)
  - 5.16.7  - (https://gitlab.com/sdm845-mainline/linux/-/commit/36f968514b328e4dae65ca4503707643f691b3e8)
  - 5.16.8  - (https://gitlab.com/sdm845-mainline/linux/-/commit/3023f6e3b7d4c1e4d10efc603fbe0d6e333a39f4)
  - 5.16.9  - (https://gitlab.com/sdm845-mainline/linux/-/commit/a87b941715f881a715add95260cff3699063073c)
  - 5.16.10 - (https://gitlab.com/sdm845-mainline/linux/-/commit/eb85bcb0a34a8620fe0b3f2bb04d3ed4fa64d31f)
  - 5.16.11 - (https://gitlab.com/sdm845-mainline/linux/-/commit/73291a1c42e0696daf0ccd8c5e89481579d4fad7)
  - 5.16.12 - (https://gitlab.com/sdm845-mainline/linux/-/commit/77c0e13ec39469a2e3057e1c1853f425626b50e4)

Change-Id: I806a2c57793e7815d24b57cf46621b9ec5d10f3b
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

(cherry picked from commit 5ec32e252e)

[ci:skip-build]: CI will not be able to complete building this
[ci:skip-vercheck]: did not change the version of APKBUILDs on purpose
when fixing the checksum change for the CVE patches (see first patch in
this merge request)
2022-03-13 17:08:02 +01:00
Alexander Martinz 1ba0383f39 linux-postmarketos-qcom-sdm845: upgrade to 5.16.5 (MR 2899) (MR 2967)
For a merge list, please see the merge commits:
  - 5.16.3 - (https://gitlab.com/sdm845-mainline/linux/-/commit/98fb3b41210d7de922ece6651ea89231e3aed163)
  - 5.16.4 - (https://gitlab.com/sdm845-mainline/linux/-/commit/2962c41f9da16a931f39fc78678fd63bedc62a51)
  - 5.16.5 - (https://gitlab.com/sdm845-mainline/linux/-/commit/9ee391628fb83b8c419ce5d4fe7ef47fddf30be0)

Change-Id: If5ba0303b6a9a636ec1f303739804a9fa9c37e2a
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

[ci:skip-build] Already built successfuly on CI in MR

(cherry picked from commit fac272225b)
2022-03-13 17:04:59 +01:00
Alexander Martinz 6a1527e8c5 linux-postmarketos-qcom-sdm845: upgrade to 5.16.2 (MR 2877) (MR 2967)
Merge list:

5fd3e07fd10e Linux 5.16.2
a498f4a42b81 ALSA: hda/realtek: Re-order quirk entries for Lenovo
21ad9041b615 ALSA: hda/realtek: Add quirk for Legion Y9000X 2020
5053b09e0e90 ALSA: hda/tegra: Fix Tegra194 HDA reset failure
ea3fcb111c87 ALSA: hda: ALC287: Add Lenovo IdeaPad Slim 9i 14ITL5 speaker quirk
73990b61c549 ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Master after reboot from Windows
2ac0c35159be ALSA: hda/realtek: Use ALC285_FIXUP_HP_GPIO_LED on another HP laptop
08968ce43f9d ALSA: hda/realtek: Add speaker fixup for some Yoga 15ITL5 devices
7faa2fb7bcd1 perf annotate: Avoid TUI crash when navigating in the annotation of recursive functions
1f21b193707e firmware: qemu_fw_cfg: fix kobject leak in probe error path
fd8a2f12de64 firmware: qemu_fw_cfg: fix NULL-pointer deref on duplicate entries
261f47d05859 firmware: qemu_fw_cfg: fix sysfs information leak
105ee59fc79e rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled
230d1fa69ff8 media: uvcvideo: fix division by zero at stream start
c923276ddd49 video: vga16fb: Only probe for EGA and VGA 16 color graphic cards
0b1a05b219fe 9p: fix enodata when reading growing file
4947e1735a87 9p: only copy valid iattrs in 9P2000.L setattr implementation
cda396e5ce51 NFSD: Fix zero-length NFSv3 WRITEs
f3f2900c93e2 remoteproc: qcom: pas: Add missing power-domain "mxc" for CDSP
07f5f305ed81 KVM: s390: Clarify SIGP orders versus STOP/RESTART
60af2066bc5d KVM: x86: don't print when fail to read/write pv eoi memory
ec985a8dfbe9 KVM: x86: Register Processor Trace interrupt hook iff PT enabled in guest
51d24f081b90 KVM: x86: Register perf callbacks after calling vendor's hardware_setup()
68fe61050dc2 perf: Protect perf_guest_cbs with RCU
8b1530a3772a vfs: fs_context: fix up param length parsing in legacy_parse_param
af8ad4718278 remoteproc: qcom: pil_info: Don't memcpy_toio more than is provided
931b93ac1fce orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc()
16a1622c3424 drm/amd/display: explicitly set is_dsc_supported to false before use
3bddfeab42ab devtmpfs regression fix: reconfigure on each mount

Change-Id: I3238c7c90d5723ca09df84a825dc4ad156dc92f9
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

[ci:skip-build] Already built well once on CI in MR

(cherry picked from commit 2ed6d379fc)
2022-03-13 17:04:59 +01:00
Alexander Martinz 4cc66cb8d6 linux-postmarketos-qcom-sdm845: upgrade to 5.16.1 (MR 2858) (MR 2967)
Ran `pmbootstrap kconfig edit linux-postmarketos-qcom-sdm845` to
regenerate the defconfig.

Change-Id: Ie4b9e6e4a790d37a1a1d8f479e7e10dfd3ef9db0
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

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

(cherry picked from commit dc66d0cbfd)
2022-03-13 17:04:59 +01:00
Alexander Martinz 61b976d56b linux-postmarketos-qcom-sdm845: enable visionox rm69299 (MR 2738) (MR 2967)
SHIFT6mq (axolotl) requires this panel driver.
Config is already merged upstream:
  - https://gitlab.com/sdm845-mainline/linux/-/commit/9ed86f14d0718d81a55708abe5355fd2a8a09b8d

Change-Id: I7d0286084df53b1a160702e8928f4691153b64f4
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>

[ci:skip-build] Already built on CI in MR

(cherry picked from commit a9122b9cef)
2022-03-13 17:04:59 +01:00
elagost 33a490eb03 device-pine64-pinephone: add kb151 to initrd (MR 2966) (MR 2967)
(cherry picked from commit 4db07ad794)
2022-03-13 17:04:58 +01:00
Yassine Oudjana 973b7f226a community/linux-postmarketos-qcom-msm8996: upgrade to 5.16.12 (MR 2979) (MR 2967)
- Add support for the rear camera on xiaomi-scorpio
- Improve charging from SDPs
- Add extcon support on oneplus-oneplus3(t)
- Add container and zram kconfig checks to APKBUILD

[ci:skip-build] Already built successfuly on CI in MR

(cherry picked from commit 79be2d5074)
2022-03-13 17:04:58 +01:00
elagost 23dc6762da linux-postmarketos-allwinner: set kb151 as module (MR 2966) (MR 2967)
backported to 5.15.13 from:
(cherry picked from commit 297ff6bf57)
2022-03-13 17:04:58 +01:00
Clayton Craft 79bfaf0ae7 postmarketos-ui-phosh: enable waked by default (MR 2963) (MR 2967)
This will make resuming on alarm work out of the box. Not sure how this
was missed previously...?

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

(cherry picked from commit 164e9f010d)
2022-03-13 17:04:58 +01:00
Sicelo A. Mhlongo f86dd50c5d linux-nokia-n900: update to latest stable kernel (MR 2964) (MR 2967)
- update to kernel 5.15.25 stable
- add TUN as module, fixes pma#1435
- drop fully-upstreamed patches (lp55xx)
- add iio support for lis302dl (will send upstream)
- update N900 dts for lis302dl over iio (will send upstream)
- assign higher priority to patches from kernel.org (resolves pmb#2107)

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

(cherry picked from commit 18046f68f2)
2022-03-13 17:04:58 +01:00
Clayton Craft 4638d70d96 temp/dino: upgrade to latest in upstream feature/handy branch (MR 2930) (MR 2967)
[ci:skip-build]: already built successfully in CI

(cherry picked from commit b0971223a3)
2022-03-13 17:04:58 +01:00
Clayton Craft 0bb28a2a07 temp/mmsd-tng: remove aport (MR 2967)
A newer version is in the Alpine 3.15 stable branch
2022-03-13 17:04:58 +01:00
Clayton Craft 1ad9f95c5a temp/portfolio: backport upgrade to 0.9.3 (MR 2967) 2022-03-13 17:04:58 +01:00
Clayton Craft 7d9d0153b0 main/postmarketos-ui-phosh: add support for automounting disks (MR 2905) (MR 2967)
This installs/starts udiskie, a udisk2 helper, that facilitates
auto-mounting of removable drives.

Note support for umounting is broken in the current Portfolio release,
so disks have to be umounted manually:

    udiskie-umount /run/media/<user>/*

I decided to add this to the `depends` and not `pmb_recommends`, because
I felt like 1) this is a feature that folks would expect to work, 2) by
having it in depends, it'll 'fix' existing installs where mounting
removable disks automatically is not implemented

(cherry picked from commit 5979bd6813)
2022-03-13 17:04:58 +01:00
Pablo Correa Gómez 91cdd0fbaa main/postmarketos-ui-phosh: add default handlers for tel and sms (MR 2932) (MR 2967)
Closes #929

(cherry picked from commit 5eed24ebad)
2022-03-13 17:04:57 +01:00
Clayton Craft 9540fe060d temp/squeekboard: backport upgrade to 1.16.0 (MR 2967) 2022-03-13 17:04:57 +01:00
Clayton Craft 7da7c1409e main/postmarketos-base: set os-release to SP3 (MR 2967) 2022-03-13 17:04:57 +01:00
Oliver Smith 3961141cba linux-*: put CVE patches into pmaports repository (MR 2967)
The checksums of the patches on git.kernel.org have changed. Put the
patches inside this git repository instead of downloading it from
git.kernel.org.
2022-03-13 17:04:50 +01:00
Clayton Craft 292d8caf96 linux-*: add patch for CVE-2022-0847 (MR 2990)
the following kernels were excluded:

- linux-asus-me176c, since dirtypipe is only >=5.8 and that kernel is 5.4
- linux-nokia-n900: 5.15.25 is already patched
- linux-postmarketos-qcom-msm8996: 5.16.12 is already patched
- linux-postmarketos-qcom-sdm845: 5.16.12 is already patched

* note not all of these kernels are at the versions above, but they will
  be in the service pack 3 releas

  [ci:skip-build] too many kernels for CI to build before timing out
2022-03-09 14:20:08 -08:00
Clayton Craft 78c3fa5e0e main/linux-*: drop kernels not used by any devices in 21.12 (MR 2990) 2022-03-09 13:31:47 -08:00
Minecrell a96b4e098d {main,cross}: restore gcc4/gcc6 for v21.12 stable branch (MR 2942)
Compilers are a big pain to build, and right now everyone who wants to
test the stable branch on some unsupported downstream devices has to
build gcc4/6 themselves locally, wasting lots of precious energy. :)

Having these (cross-)compilers available in the postmarketOS repo for
stable releases can be also useful for other projects. For example,
for lk2nd I would like to do some basic compile testing with gcc4
(since this is what Qualcomm used). The gcc4 from postmarketOS is
pretty much the most easily available gcc4-armv7 for Alpine Linux. :)

This should not have any disadvantage for devices using stable, there
will just be additional packages available in the binary repository.

This commit simply reverts parts of b78a0ca7 ("remove packages not
supported in v21.12").

[ci:skip-build]: already built locally, will probably take too long
[ci:skip-vercheck]: let's keep the existing pkgrel for those
2022-02-27 18:24:22 +01:00
Anjandev Momi 57a8cef9e2 temp/sxmo-utils: upgrade to 1.8.2 (MR 2943)
[ci:skip-build] already built successfully in CI
2022-02-17 11:29:05 -08:00
Clayton Craft a095646449 postmarketos-base: add sysctl config to disable rp_filter on ipv4 (MR 2943)
MMS support (via mmsd-tng) involves sending/receiving network
requests/responses over the wwan interface. If it's ipv4-only and the
device is connected to some other ipv4 network on another iface (like
wifi), this can cause the rp_filter to reject responses on wwan iface
because it incorrectly thinks they are martian packets.

This does theoretically disable some "security" feature in the kernel,
but it's worth noting that:

1) rp_filter isn't implemented at all in the kernel for ipv6

2) other distros (mobian, pureos at least) are also disabling rp_filter

3) this seems to be a relatively common problem with folks using mms on
   pmOS, since many carriers' data networks are ipv4-only

also see:
https://gitlab.com/kop316/mmsd/-/merge_requests/55/diffs?commit_id=b22c253fb939ff1eb949ea4e628706e6a28c851a

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

(cherry picked from commit caec14561d)
2022-02-16 12:16:45 -08:00
Anjandev Momi 0d566ce9e6 temp/wlroots: copy to sxmo-wlroots to override the fork in stable (MR 2927)
sxmo-wlroots was installed from aports 3.15 when pmOS v21.12 was released.
As such, apk always looks for a package named sxmo-wlroots to satisfy
the wlroots dependancy while sxmo-wlroots is in 3.15.

This patch copies the contents of the latest required wlroots into
sxmo-wlroots so that users dont have to deal with outdated library
on the latest service pack 2. Moreover, apk wont complain about
sxmo-wlroots doesnt exist resulting in broken installs and manual
intervention.

[ci:skip-vercheck]
2022-02-11 23:45:42 -08:00
Clayton Craft 6a8841e398 temp/phosh: backport upgrade to 0.15.0-r1
[ci:ignore-count]
[ci:skip-vercheck]
2022-02-10 17:01:20 -08:00
Clayton Craft 4e89402406 temp/mmsd-tng: backport upgrade to 1.8 2022-02-10 17:01:19 -08:00
Clayton Craft 0ddfc2077d temp/chatty: backport upgrade to 0.6.1
backported from Alpine edge

[ci:ignore-count]
2022-02-09 11:45:46 -08:00
Anjandev Momi 1bd0fa467c sxmo: upgrade to 1.8.2 (MR 2912)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 9b595f3815)
2022-02-09 11:45:46 -08:00
Anjandev Momi 9898705fc8 temp/clickclack: backport upgrade to 0.2 2022-02-09 11:45:45 -08:00
Anjandev Momi ad20f67825 temp/wayout: backport upgrade to 0.1.2 2022-02-09 11:45:45 -08:00
Anjandev Momi 26ddea8821 temp/sxmo-dmenu: backport upgrade to 5.0.13 2022-02-09 11:45:44 -08:00
Anjandev Momi dfb8a2d84c temp/sxmo-utils: backport upgrade to 1.8.1 2022-02-09 11:45:44 -08:00
Anjandev Momi 8ddc4328c8 temp/wlroots: backport from alpine edge to support sxmo-sway 2022-02-09 11:45:43 -08:00
Anjandev Momi d463aba185 temp/wayland-protocol: backport from alpine edge to support sxmo-sway 2022-02-09 11:45:43 -08:00
Anjandev Momi 0c3400c1d1 temp/wayland: backport from alpine edge to support sxmo-sway 2022-02-09 11:45:42 -08:00
Anjandev Momi f2b76ae1b1 temp/sxmo-sway: backport from alpine edge 2022-02-09 11:45:42 -08:00
Jakob Hauser 232c85d05f samsung-serranove: add udev rule for modem (MR 2800)
Due to a regression in ModemManager 1.18.2, a special case to reduce
facility lock query was implemented in ModemManager. Versions up to
1.18.6 need to be patched (separate merge request, possibly in Alpine
Linux). For more details, see pmaports issue #1274.

This udev rule makes use of this special case for device
samsung-serranove.

(cherry picked from commit 9abe7e28b2)
2022-02-09 11:45:41 -08:00
Oliver Smith 1045728f90 main/postmarketos-ui-phosh: add !pipewire-pulse (MR 2890)
Prevent apk from pulling in pipewire-pulse instead of pulseaudio, as
this leads to various audio issues with Phosh in postmarketOS (volume
buttons not working, no sound in various applications).

Pipewire will be a great replacement for pulseaudio, but let's rather
enable it intentionally for Phosh once we fixed everything that's
currently breaking with it. Without this patch it may get installed when
installing or upgrading other packages (not entirely sure how it gets
triggered yet, but I have seen it myself multiple times and we've gotten
reports about it).

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

(cherry picked from commit b70a36190b)
2022-02-09 11:45:41 -08:00
Dylan Van Assche 0186690579 main/postmarketos-ui-phosh: ask for SIM unlock (MR 2896)
Show a prompt at startup to unlock the SIM if it is locked.

(cherry picked from commit 284391cd9f)
2022-02-09 11:45:40 -08:00
Newbyte 3686c42324 main/postmarketos-ui-phosh: remove notice about numeric passwords (MR 2883)
Phosh supports arbitrary passwords as of release 0.15.0.

(cherry picked from commit ca6579f545)
2022-02-09 11:45:39 -08:00
Pablo Correa Gómez 71d721043b main/postmarketos-ui-phosh: disable gnome-software auto updates (MR 2653)
The `download-updates` keyword is not a good naming, but it does
not only download, but also tries to install the updates

(cherry picked from commit c3a61c0b9e)
2022-02-09 11:45:39 -08:00
Oliver Smith 6275cdf21b main/postmarketos-ondev: upgrade to 0.7.4 (MR 2891)
Allow non-numeric passwords for Phosh too (now that it's implemented
there).

[ci:skip-build] Already built successfuly on CI in MR

(cherry picked from commit 142a15c464)
2022-02-09 11:45:38 -08:00
Clayton Craft f583c06350 temp/phosh: backport upgrade 0.15.0 from Alpine edge
New features/bug fixes for the stable branch
2022-02-09 11:45:38 -08:00
Clayton Craft 60892ad1ea temp/phoc: backport upgrade to 0.10.0 from Alpine edge
Required for phosh 0.15.0
2022-02-09 11:45:37 -08:00
Clayton Craft a1b96c7c43 temp/chatty: backport upgrade 0.6.0 from Alpine edge
This new release fixes a few issues for SMS, and adds support for MMS
2022-02-09 11:45:37 -08:00
Clayton Craft 2a70c74460 main/postmarketos-base: set os-release to SP2
(cherry picked from commit 4e1f741af8f40ca60c3f4168121720c35ecd4e25)
2022-02-09 11:45:36 -08:00
Oliver Smith 86f6dac53b cross/busybox-static-*: upgrade to 1.34.1-r4 2022-02-05 11:37:32 +01:00
Anjandev Momi 30ea5af0d7 temp/wvkbd: backport upgrade to 0.7 (support sxmo 1.7.1) (MR 2862) 2022-01-19 02:42:47 -05:00
Anjandev Momi d9b96e0eff temp/sxmo-utils: backport upgrade to 1.7.1 (MR 2862) 2022-01-18 22:11:28 -05:00
Anjandev Momi 4bcc439f83 temp/sxmo-dmenu: backport upgrade to 5.0.12 (support sxmo 1.7.1) (MR 2862) 2022-01-18 22:11:01 -05:00
Anjandev Momi 397b1bce85 temp/svkbd: backport upgrade to 0.4.1 (support sxmo 1.7.1) (MR 2862) 2022-01-18 22:07:53 -05:00
Anjandev Momi dd677d21bd temp/sxmo-swayidle: remove (MR 2862) 2022-01-18 22:01:39 -05:00
Stacy Harper f0c3e657ab main/postmarketos-ui-sxmo-de-sway: rely on upstream swayidle (MR 2859) 2022-01-18 17:50:32 +01:00
Stacy Harper 59b6abf4e8 temp/swayidle: fork from alpine aports (MR 2859) 2022-01-18 17:50:32 +01:00
Martijn Braam db8391a655 main/postmarketos-base: adjust for v21.12.1 (MR 2845)
[ci:skip-vercheck]
[ci:ignore-count]
[ci:skip-build]
2022-01-16 22:58:22 +01:00
Martijn Braam 3dd9a7cc8c main/linux-postmarketos-allwinner: upgrade to 5.15.13 (MR 2845)
Adds a newer stable release of the kernel with additional config for the
PinePhone keyboard
2022-01-16 22:00:11 +01:00
Sicelo A. Mhlongo d64f66441d temp/i3blocks: backport i3blocks from testing (MR 2845)
i3blocks is required for i3wm on N900. Since it is not in Alpine stable
release, backport it. Alpine maintainer has been contacted to promote it to
community
2022-01-15 13:24:31 +01:00
Sicelo A. Mhlongo 8796e198d7 linux-nokia-n900: workaround for modem regression (MR 2852) (MR 2845)
This is a cherry pick of Leste commit 2c7e4a1ac8ec1f908927793e893566aac3dcb9df,
to revert mainline commit f959dcd6ddfd29235030e8026471ac1b022ad2b0, which breaks
N900 modem. This is a temporary workaround until a proper fix is found.
2022-01-15 13:24:31 +01:00
Martijn Braam 3482b09b46 device-nokia-n900: reintroduce in stable (MR 2845) 2022-01-14 15:32:57 +01:00
Pablo Correa Gómez e76c5d0677 temp/gnome-control-center: enable printer panel (MR 2795) (MR 2845)
The bug that made the cups client in the panel crash is now
fixed and the panel is finally usable
2022-01-14 15:32:56 +01:00
Martijn Braam aab5b1b74d temp/sxmo-swayidle: backport from alpine (MR 2845) 2022-01-14 15:32:55 +01:00
Anjandev Momi 77f33d2318 main/sxmo-common: upgrade to 1.7.1, add vvmd dependency (MR 2830) (MR 2845) 2022-01-14 15:32:54 +01:00
Maarten van Gompel 1c303d77b7 main/postmarketos-ui-sxmo-de-dwm: upgrade to 1.7.0 (MR 2827) (MR 2845) 2022-01-14 15:32:54 +01:00
Maarten van Gompel 99fa6b12a7 main/postmarketos-ui-sxmo-de-sway: upgrade to 1.7.0 (MR 2827) (MR 2845) 2022-01-14 15:32:53 +01:00
Maarten van Gompel a354374d48 main/sxmo-common: upgrade to 1.7.0 (MR 2827) (MR 2845) 2022-01-14 15:32:52 +01:00
Martijn Braam 8258f947eb temp/gnss-share: backport from alpine (MR 2845) 2022-01-14 15:32:51 +01:00
Clayton Craft 33c89091e9 purism-librem5: replace gpsd with gnss-share (MR 2736) (MR 2845)
gnss-share is a location provider I wrote for the librem 5's GPS module,
and can be used directly from geoclue. It allows saving and loading
A-GPS data (manual steps, for now) to facilitate faster fixes.

I'm not completely happy with having to use sed to patch geoclue's conf,
but:

1) I really only need to change 1 line

2) there's a non-zero chance geoclue's conf will be changed in aports if
   new permissions are required for things later

So carrying the config in the device package and using
"replaces=geoclue" (like the postmarketos-* stuff) didn't seem like a
maintainable solution long term since the geoclue conf might gain needed
fixes/features that might make a copy in the device package outdated...
2022-01-13 16:54:51 +01:00
Jakob Hauser e637569763 main/postmarketos-ui-mate: add pulseaudio (MR 2820)
To make sound work out of the box. And being able to choose audio
output when connected via bluetooth.

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

(cherry picked from commit 7e9cb6a305)
2022-01-07 12:26:30 +01:00
Clayton Craft c78ba7bcfe temp/gnome-clocks: remove fork (MR 2811)
Alpine aports 3.15 has a newer version of gnome-clocks AND is has the
backgrounding patch... so this fork should have been removed once those
were added upstream in aports but it was missed.

[ci:skip-build] already built successfully in CI
2022-01-02 20:02:28 -08:00
Oliver Smith 104bd52d99 main/postmarketos-tweaks: upgrade to 0.9.0 (MR 2801)
(cherry picked from commit 734aa53e49)
2021-12-29 13:26:35 +01:00
Caleb Connolly ea1b695f4c temp/hkdm: upgrade to 0.1.7 (MR 2787)
Fix zombie processes being created on every command run.

[ci:skip-build] already built successfully in CI (except aarch64, it
times out, but builds OK locally)
2021-12-27 20:20:04 -08:00
Maarten van Gompel 302fbe4417 main/postmarketos-ui-sxmo-de-{dwm|sway}: upgrade to 1.6.1 (MR 2794)
[ci:skip-build] already built successfully in CI
2021-12-27 16:02:49 -08:00
Caleb Connolly 891df96df3 linux-postmarketos-qcom-sdm845: upgrade to 5.16-rc5 (MR 2776)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 28f2b00a14)
2021-12-19 19:06:25 -08:00
Caleb Connolly 01c310d222 temp/hkdm: work around weird cargo fetch bug (MR 2770)
Vendor all the deps, they have been included in hkdm so that cargo can
build offline and not try and run git...

[ci:skip-build] aarch64 times out in CI, but other archs build OK and it
builds locally with pmb
2021-12-19 15:13:53 -08:00
Dylan Van Assche 2d6ed707e4 linux-odroid-hc2: upgrade to 5.15.7 (MR 2774)
And add patches for CVE-2021-39685

[ci:skip-build] Already built on CI in MR

(cherry picked from commit d5c96ecc4c)
2021-12-20 00:09:37 +03:00
Antoni Aloy Torrens b761152430 main/postmarketos-base-ui: add Xwrapper script for X11 (MR 2773)
Xorg needs an Xwrapper.config script with the line 'needs_root_rights=yes' to get tinydm + sxmo to work

(cherry picked from commit bd178b8db3)
2021-12-19 21:56:13 +03:00
Yassine Oudjana 143506cdc4 main/linux-postmarketos-qcom-msm8996: upgrade to 5.15.10 (MR 2771)
[ci:skip-build] Already built on CI in MR

(cherry picked from commit d7bd728c05)
2021-12-18 15:26:27 +03:00
Bart Ribbers 46576a7f28 main/linux-postmarketos-rockchip: add patches for CVE-2021-39685 (MR 2765)
[ci:skip-build] Already built on CI in MR

(cherry picked from commit 8a43a51b94)
2021-12-17 20:54:34 +03:00
Bart Ribbers c3d7583ef9 main/linux-postmarketos-allwinner: add patches for CVE-2021-39685 (MR 2764)
[ci:skip-build] Already built on CI in MR

(cherry picked from commit 1e047e8977)
2021-12-17 20:54:25 +03:00
Minecrell a4358266e3 main/linux-postmarketos-qcom-msm8916: add patches for CVE-2021-39685 (MR 2757)
NOTE: Should be likely backported without the kernel config changes
      since Alpine 3.15 still has the older gcc version.

[ci:skip-build] Already built successfully on CI

(cherry picked from commit c1a8c0a631)
2021-12-17 16:15:06 +01:00
Alexey Min dfcd843108 main/linux-postmarketos-qcom-msm8974: upgrade to 5.15.9 (MR 2746)
Simple upgrade with few generic kernel features enabled
 * IWD support
 * F2FS
 * NTFS3_FS
 * USB mass storage support
 * disable MTD and build more things as modules to reduce
   kernel size to compensate some new built-in options,
   as kernel doesn't boot otherwise.

No new things for pmOS's devices (yet). Should work same as before.

v5.15.9 contains latest CVE fixes.

Also mark myself as maintainer.

(cherry picked from commit a6b343c833)
(cherry picked from commit 83d8199ee8)

(.config regenrated using gcc-10)

[ci:skip-build] Builds locally
2021-12-17 06:44:08 +03:00
Caleb Connolly 44bf58ca79 phosh,plasma-mobile,sxmo-de-dwm,sxmo-de-sway install ttyescape by default (MR 2754)
[ci:skip-build] already built successfully in CI

(cherry picked from commit fe708f8bc3)
2021-12-16 17:14:05 -08:00
Caleb Connolly ed316f2ec6 main/ttyescape: upgrade to hkdm/buffyboard (MR 2713)
This upgrades ttyescape to use buffyboard, a new fbkeyboard replacement
by @Cherrypicker. It adds a lot of missing keys and uses the same layout
as Phosh's Squeekboard, so should feel much more like home for Phosh
users.

This also switches to the new HKDM daemon for hotkey handling, replacing
triggerhappy.

[ci:skip-build] already passed

(cherry picked from commit 029cf83cf1)
2021-12-16 17:14:05 -08:00
Caleb Connolly 3465259c52 main/triggerhappy: drop 2021-12-16 17:14:05 -08:00
Caleb Connolly 6ebebfeacc temp/buffyboard: fork from alpine aports
Forked from alpine
2021-12-16 17:14:04 -08:00
Caleb Connolly 5db451a732 temp/hkdm: fork from alpine aports
Forked from alpine for 21.12
2021-12-16 17:14:04 -08:00
Oliver Smith 351a5682a5 main/postmarketos-ui-phosh: firefox improvements (MR 2741)
Display the app icon properly, instead of the "unknown" icon, in the
activity view. Phosh attempts to open a .desktop file with the name of
the gtk app-id, but the app-id is "firefox" and the file is named
org.mozilla.firefox.desktop (see related commit, where it was renamed
for a good reason). The way Phosh is doing the name lookup doesn't
always work for other apps too, phosh_get_desktop_app_info_for_app_id()
has workarounds e.g. for gnome-control-center hardcoded. As workaround,
add a .desktop file that makes the icon show up properly, but is not
displayed anywhere else (NoDisplay=true).

Replace epiphany with FF in the default favorite applications in phosh
(top 4 displayed at the top). We already install FF instead of epiphany
and so the 4th place is currently empty.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/commit/2d291a4afc2c71e25c8fd9fff188eff436b80580
(cherry picked from commit 51fce1f111)
2021-12-16 17:14:04 -08:00
Minecrell d9246162b0 community/linux-asus-me176c: upgrade to 5.4.165 (MR 2756)
Should fix CVE-2021-39685

[ci:skip-build] Already built on CI in MR

(cherry picked from commit 717130ccfe)
2021-12-16 17:04:31 -08:00
Clayton Craft b56caef806 linux-purism-librem5: backport fixes for CVE-2021-39685 (MR 2761)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 20a0fee217)
2021-12-16 15:41:00 -08:00
Clayton Craft e0c5363a43 main/sxmo-common: don't disable polkit service in post-{install,upgrade} (MR 2755)
rc-update fails if this service is not in the default runlevel,which is
the case if it's a brand new installation, or would be the case later on
upgrading this package again after the service was already removed from
the runlevel.

The issue that c47c62e3 set out to solve isn't fatal, if polkit fails to
start by openrc then users can manually remove it from the runlevel.

partially reverts c47c62e3

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

(cherry picked from commit a3611e3797)
2021-12-15 20:42:23 -08:00
Caleb Connolly a99ce58cfd linux-postmarketos-qcom-sdm845: upgrade to 5.16-rc4 (MR 2690)
Finally a new upgrade! This brings along some minor driver changes and
improvements, more stuff slowly landing upstream.

We also get a few new splats during boot, these are inevitable at this
point due to fw_devlink changes and large reworking of the drm/msm code,
they are caused by the common clock framework not knowing that some
clocks are left enabled by the bootloader, it panics when they aren't in
a state it expects. They are harmless as far as I know.

[ci:skip-build]

(cherry picked from commit 4ed5c1fe13)
2021-12-15 19:25:56 -08:00
Anjandev Momi 864d2d128d sxmo: Dont add polkit to default run level (MR 2750)
it's started by dbus

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

(cherry picked from commit c47c62e31f)
2021-12-15 17:23:08 -08:00
Oliver Smith 80184e1873 main/mobile-config-firefox: upgrade to 3.0.0 (MR 2740)
Related: https://gitlab.com/postmarketOS/mobile-config-firefox/-/tags/3.0.0
(cherry picked from commit 2a83c33cb9)
2021-12-15 16:22:21 -08:00
Clayton Craft 47fb01b5d5 main/msm-firmware-loader: fix shellcheck failure (MR 2752)
A recent(?) update in shellcheck made this fail, possibly because the
test in shellcheck was fixed(?) or ???

The failure this fixes is:

Test with shellcheck: ./main/msm-firmware-loader/msm-firmware-loader.sh
In msm-firmware-loader.sh line 49:
	if [ -z "${FW_PARTITIONS##*$PARTNAME*}" ] && [ -n "$PARTNAME" ]
                                   ^-------^ SC2295 (info): Expansions inside ${..} need to be quoted separately, otherwise they match as patterns.

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

(cherry picked from commit 16472c5b2c)
2021-12-15 16:19:46 -08:00
Bobby The Builder f677d9013a main/linux-postmarketos-allwinner: upgrade to 5.15.3 (MR 2701)
[ci:skip-build]: already built successfully in CI

(cherry picked from commit ba23cc03b0)
2021-12-12 13:29:17 -08:00
Clayton Craft b0c61184ad temp/megapixels-purism: new aport (MR 2659)
This packages the megapixels fork that purism has supporting the librem
5.

The `provides="megapixels"` is there so that apk doesn't try to install
both megapixels and this package side-by-side. If the user explicitly
installs megapixels-purism, apk will remove megapixels first. The
original megapixels is still preferred by apk by default.

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

(cherry picked from commit f6f97c5469)
2021-12-12 17:49:33 +01:00
Clayton Craft 40802ad95a pine64-pinephone: configure shorter default suspend time (MR 2728)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 1ef69646d0)
2021-12-10 11:10:12 -08:00
Clayton Craft 198fb563c9 temp/gnome-control-center: add patch for additional suspend time options (MR 2728)
[ci:skip-build] already built successfully in CI

(cherry picked from commit 00056d48f4)
2021-12-10 11:09:57 -08:00
Clayton Craft 62bf533ab0 ci: disable x86 and armhf
These are not supported in the release
2021-12-10 10:51:38 -08:00
Minecrell 8268991d95 modem/msm-modem: uim-selection: Allow configuring wait time for SIM (MR 2695)
Unfortunately it looks like some modem firmwares (or SIM cards?) need
more time until the SIM card shows up in the modem. This means that the
SIM card might not get configured, making it look like it was not
detected at all. On the other hand, having the previous long wait loop
affects _all devices_ when there is really no SIM inserted.

The proper solution would be to make it possible to configure SIM cards
once they show up (probably in ModemManager). Until then, try to make it
possible to workaround this by introducing a configurable delay to wait
for the SIM card. It is set to minimal "1 seconds" by default but could
be increased by the user if needed to give the modem enough time to detect
the SIM card.

This reverts commit 683b543a3b ("msm-modem-uim-selection: Don't wait
for SIM (MR 2470)" but with a new configuration mechanism and a default
of 1 second only.

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

(cherry picked from commit f563e0ddcf)
2021-12-10 10:33:12 -08:00
Bart Ribbers 5d002b77e9 main/postmarketos-ui-plasma-mobile: switch to modemmanager (MR 2730)
Upstream has switched from ofono to modemmanager since Plasma 5.23 and
Plasma Mobile Gear 21.12. Since the latter has just been released it's
now time to switch our images too.

The modemmanager service will be enabled to start on default and for
existing installations the .post-upgrade script will disable and stop
the existing ofono service and enable and start modemmanager instead.
2021-12-08 11:26:50 +01:00
Nikita Travkin f29c8d42a3 wileyfox-crackling: Add udev rule for proximity sensor (MR 2700)
iio-sensor-proxy wants to know when to report "near" status. Add an udev
rule defining that value as a workaround untl it can be passed from
the DT.

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

(cherry picked from commit 8df6c1c0f7)
2021-12-05 22:45:15 -08:00
Clayton Craft 81db456f12 main/postmarketos-ui-bigscreen: drop package
Depends on things in edge/testing. PureTryOut said to drop it from the
release.
2021-12-05 22:25:09 -08:00
Clayton Craft cc00ba9aef device/community/firmware-pine64-rockpro64: move from testing (MR 2727)
Devices that depend on this are in community.

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

(cherry picked from commit 69634b878e)
2021-12-05 21:32:00 -08:00
Clayton Craft 4f9e9ec8ca device/community/firmware-odroid-hc2: move from testing (MR 2726)
I suspect this was missed when the Odroid HC2 device was moved to
community.

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

(cherry picked from commit bbec68b244)
2021-12-05 21:24:44 -08:00
Yassine Oudjana add178efb3 main/linux-postmarketos-qcom-msm8996: upgrade to 5.15.6 (MR 2720)
[ci:skip-build] already built successfully in CI

(cherry picked from commit a59b385db3)
2021-12-05 21:21:36 -08:00
Yassine Oudjana 7cb0151270 xiaomi-scorpio: flash the kernel automatically (MR 2721)
Enable automatic kernel flashing on update.

(cherry picked from commit f3e6d4f227)
2021-12-05 22:11:18 +01:00
Yassine Oudjana 3aca1f5d9a xiaomi-scorpio: add DRM to the initramfs (MR 2721)
Add DRM modules and GPU firmware to the initramfs.

(cherry picked from commit 1a52b9c78f)
2021-12-05 22:11:11 +01:00
Jakob Hauser 2bf084173d samsung-a3|a5|klte|serranove: remap left touch key (MR 2718)
Remapping the left key of tm2-touchkey to KEY_MENU.

The KEY_APPSELECT, which is set by the device tree, is not available in
the postmarketOS UIs. In X11 UIs this is due to keycode limitation to
8 bit. In Wayland UIs the keycodes don't have this limitation but xkb
keycodes higher 255 are not processed correctly by several software
packages. It still makes sense to keep KEY_APPSELECT in the device tree
because this is the correct mapping intended by the manufacturers when
running the kernel on Android.

(cherry picked from commit c655f5cc9c)
2021-12-05 21:55:14 +01:00
Dylan Van Assche 1e3ee0b978 linux-odroid-hc2: upgrade to 5.15.5 (MR 2724)
Tested on my ODROID HC2 running edge

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

(cherry picked from commit 415ff553f0)
2021-12-05 21:35:05 +01:00
Oliver Smith 472a00fbf5 main/mobile-config-firefox: upgrade to 3.0.0_rc1 (MR 2723)
(cherry picked from commit 60a917222a)
2021-12-05 13:58:52 +01:00
Anjandev Momi fdc3843a05 sxmo-common: update bluetooth for new pipewire/wireplumber (MR 2717)
(cherry picked from commit 11ce9f240c)
2021-12-05 12:45:27 +01:00
Oliver Smith 01d03a0ab3 main/postmarketos-ondev: upgrade to 0.7.3 (MR 2712)
Increase boot size from 128 MiB to 256 MiB.

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

(cherry picked from commit 07bbd8c0c8)
2021-12-01 15:50:32 -08:00
Oliver Smith 6f928a7413 main/mesa-pvr-classic: drop
Fails to build, remove for now as it's the last remaining package
before the initial build of v21.12 is complete. We may not need it in
v21.12, depending on if we drop the N900 there or not.

Related: https://builds.sr.ht/~postmarketos/job/639197#task-pmbootstrap_build-735
2021-12-01 23:03:34 +01:00
Oliver Smith 8d0a5f3905 main/mkbootimg-osm0sis: fix upstream source
[ci:skip-vercheck]

(cherry picked from commit 6bba554f93)
2021-11-27 19:05:59 +01:00
Oliver Smith 609798716a temp/gnome-software-plugin-apk: fix upstream source
This will be upgraded soon, however let's let this broken URL not block
the initial v21.12 bring up for now. Again, same checksum as the
previous tarball.

For edge we'll probably remove this package and instead Alpine's version
instead. [ci:skip-vercheck]

(cherry picked from commit c39fa96886)
2021-11-27 19:05:48 +01:00
bo41 bbe9832681 ci: remove unused args argument from pmb.parse.apkbuild (MR 2711)
(cherry picked from commit 03c989ed54)
2021-11-27 16:30:01 +01:00
Oliver Smith 3e5a9efba0 main/fbkeyboard: fix upstream source url
again, same checksum, I verified that it builds.
[ci:skip-vercheck]

Related: https://builds.sr.ht/~postmarketos/job/636813#task-pmbootstrap_build-502
(cherry picked from commit f68ebfe7b8)
2021-11-27 13:44:40 +01:00
Oliver Smith 0ec99e4dc4 main/crust: fix upstream source url
Source URL has moved. This is the same version, the checksum of the
tarball is the same. I've verified, that this builds.
[ci:skip-vercheck]

Related: https://builds.sr.ht/~postmarketos/job/636792#task-pmbootstrap_build-343
(cherry picked from commit a38bef1be5)
2021-11-27 13:33:51 +01:00
Oliver Smith a6f4230d32 temp/wayout: fork from alpine edge
Needed for postmarketos-ui-sxmo-de-sway.
2021-11-27 11:25:24 +01:00
Oliver Smith 89608de640 anbox: drop
anbox-image doesn't build because the f-droid version packaged leads to
a 404. But we have waydroid now, which works better than anbox. So let's
drop it. I'll make a MR to drop it from edge too, this patch is for
fixing bpo being stuck while building v21.12.
2021-11-27 11:25:24 +01:00
Oliver Smith da79d8c770 main/postmarketos-ui-lxqt: drop
Depends on lxqt-desktop, which is not available in Alpine 3.15. If you
do need this on pmOS stable, make a MR to bring it back.
2021-11-27 11:25:24 +01:00
Oliver Smith 5a16d01c08 main/ofonoctl, pmos-ui-shelli: drop
Depends on py3-tabulate which is not available in Alpine 3.15. Looks
like nobody is using this in pmOS stable anyway, so let's drop it.

If you do use it, feel free to make a MR to bring it back.
2021-11-27 11:25:24 +01:00
Oliver Smith 7fc91af647 cross/busybox-static-*: upgrade to 1.34.1-r3 2021-11-27 11:25:19 +01:00
Oliver Smith 9c10427166 nokia-n900, samsung-espresso3g: remove
Not supported in v21.12, as discussed in issue pmaports 1276.
2021-11-26 01:27:44 +01:00
Oliver Smith b78a0ca78f remove packages not supported in v21.12
* device/testing, device/unmaintained
* cross/*-armhf, cross/*-x86
* gcc4 and gcc6
* postmarketos-ui-asteroid
2021-11-26 01:25:21 +01:00
Oliver Smith 8dafd0f8a4 main/postmarketos-base: adjust to v21.12 2021-11-26 01:23:57 +01:00
Oliver Smith 9c818a5841 === Branch v21.12 from master ===
Related: https://wiki.postmarketos.org/wiki/Create_release_branch
2021-11-26 01:05:30 +01:00
8638 changed files with 137346 additions and 2688156 deletions

No files matched your search

-12
View File
@@ -1,12 +0,0 @@
#!/bin/sh -e
# Description: run apkbuild-lint on modified APKBUILDs
# Options: with-dot-git
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk add atools git python3
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
.ci/lib/apkbuild_linting.py
+31
View File
@@ -0,0 +1,31 @@
#!/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)
-106
View File
@@ -1,106 +0,0 @@
#!/bin/sh -e
if [ "$(id -u)" = 0 ]; then
set -x
apk add git openssh-keygen grep curl
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/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"
# The username for the bot associated with the access token
# e.g. project_226_bot_bfa19b84bf7f559c8ff7438a01fd29b9
git config --global user.email "$PMAPORTS_TOKEN_BOT@noreply.gitlab.postmarketos.org"
# 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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/refs/tags/ | grep -oE "<a href='.*'>(.*)</a>.*\.tar\.gz</a>" | awk -F'[<>]' '{print $3}' > /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
sed -i -e "s/^pkgrel=.*/pkgrel=0/" 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.postmarketos.org/postmarketOS/pmaports-autoupdate-test.git
git remote add gitlab https://pmos-ci:"$PMAPORTS_PUSH_TOKEN"@gitlab.postmarketos.org/postmarketOS/pmaports.git
git fetch gitlab
git checkout --track gitlab/main
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
-20
View File
@@ -1,20 +0,0 @@
#!/bin/sh -e
# Copyright 2025 Pablo Correa Gomez
# SPDX-License-Identifier: GPL-3.0-or-later
# Description: create documentation with antora
# Options: with-dot-git
# Artifacts: build/site
# https://postmarketos.org/pmb-ci
# Install dependencies
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add py3-pip make git
apk add dint --allow-untrusted --repository=https://mirror.postmarketos.org/postmarketos/main
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
cd docs/
make venv
make
-141
View File
@@ -1,141 +0,0 @@
image: registry.alpinelinux.org/img/alpine:3.24
stages:
- build
- hardware tests
variables:
CI_TRON_TEMPLATE_PROJECT: &ci-tron-template-project postmarketOS/ci-common
CI_TRON_JOB_TEMPLATE_PROJECT_URL: $CI_SERVER_URL/$CI_TRON_TEMPLATE_PROJECT
CI_TRON_JOB_TEMPLATE_COMMIT: &ci-tron-template-commit 1c70e34b7a610cda1d7f048f6b50ca9c10f52995
include:
- project: *ci-tron-template-project
ref: *ci-tron-template-commit
file: '/ci-tron/common.yml'
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
.build:
# Create jobs, but do not run them unless this is
# overriden in jobs that extend it
stage: build
interruptible: true
before_script:
# upgrade is mostly needed for "qemu" runners that run edge based on a VM
# The other build jobs run natively in docker on latest alpine stable and
# those should always have whatever we need
- apk upgrade -U
- .ci/lib/gitlab_prepare_ci.sh
after_script:
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
- mkdir -p keys
- cp /home/pmos/.local/var/pmbootstrap/config_apk_keys/pmos@local*.pub keys/ || true
- .ci/lib/move_logs.sh $CI_PROJECT_DIR
artifacts:
expire_in: 1 week
paths:
- packages/
- keys/
timeout: 10 h
build:
extends: .build
parallel:
matrix:
{% for arch in archs %}
- ARCH: {{ arch }}
TAG: {{ archtag[arch] }}
{% endfor %}
{% if archs|length == 0 %}
- ARCH: placeholder
TAG: shared
{% endif %}
tags:
- $TAG
script:
# Needed because gitlab fails if no jobs are ran:
# - https://gitlab.com/gitlab-org/gitlab/-/issues/368248
{% if archs|length == 0 %}
- 'true'
{% else %}
- .ci/build-$ARCH.sh
{% endif %}
# Hardware testing
# Define here all the gitlab-ci snippets that could be common between the
# different packages
# Extends from this job if the target device needs a kernel and initramfs to
# boot. This will not work if your device uses boot images.
.device-boot-flow-separate-artifacts:
variables:
CI_TRON_KERNEL__URL: "glartifact://${CI_TRON__PMB_BUILD_JOB}/${CI_TRON__PMB_EXPORT_PATH}/vmlinuz"
CI_TRON_INITRAMFS__INITRAMFS__URL: "glartifact://${CI_TRON__PMB_BUILD_JOB}/${CI_TRON__PMB_EXPORT_PATH}/initramfs"
# Extends from this job if the target device boots using fastboot and boot images
.device-boot-flow-fastboot-image:
variables:
CI_TRON_FASTBOOT__BOOT_IMAGE__URL: "glartifact://${CI_TRON__PMB_BUILD_JOB}/${CI_TRON__PMB_EXPORT_PATH}/boot.img"
# Include all the devices that need and can to be tested
{% for device in devices_under_test %}
prepare-{{ device.name }}:
stage: hardware tests
extends:
.pmos-ci-tron-build-boot-artifacts
{%- if device.has_kernel_variants %}
# Build all the boot artifacts for all the supported kernel variants in
# different jobs, but hide them behind a single job name so as not to pollute
# the pipeline.
parallel:
matrix:
- KERNEL_VARIANT:
{%- for kernel in device.kernel_variants %}
- {{ kernel }}
{%- endfor %}
{%- endif %}
needs:
- job: "build"
parallel:
matrix:
- ARCH: "{{ device.arch }}"
TAG: "{{ archtag[device.arch] }}"
variables:
DEVICE_NAME: {{ device.name }}
# NOTE: All the packages that may influence testing should have an
# `install-if postmarketos-mkinitfs-hook-ci`, so no need to add them here
INSTALL_PACKAGES: {{ device.pkgname }} {% if device.has_kernel_variants %}{{ device.pkgname }}-kernel-${KERNEL_VARIANT} {% endif %}postmarketos-mkinitfs-hook-ci
.test-{{ device.name }}:
stage: hardware tests
{%- if device.has_kernel_variants %}
# Test all the kernels in different jobs, but hide them behind a single
# job name so as not to pollute the pipeline.
parallel:
matrix:
- KERNEL_VARIANT:
{%- for kernel in device.kernel_variants %}
- {{ kernel }}
{%- endfor %}
{%- endif %}
dependencies: []
needs:
- job: 'prepare-{{ device.name }}'
artifacts: false
{%- if device.has_kernel_variants %}
parallel:
matrix:
- KERNEL_VARIANT: $[[ matrix.KERNEL_VARIANT ]]
{%- endif %}
variables:
CI_TRON__PMB_BUILD_JOB: "prepare-{{ device.name }}{% if device.has_kernel_variants %}: [$KERNEL_VARIANT]{% endif %}"
# Include the gitlab ci yml fragment, as found in
# `device/$category/device-$devicename/gitlab-ci.yml.j2` which defines the jobs
{{ device.gitlab_ci_fragment }}
{% endfor %}
-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
Executable
+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 ".ci/build_changed_aports.py $JOB_ARCH"
+83
View File
@@ -0,0 +1,83 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
# Same dir
import common
# pmbootstrap
import testcases.add_pmbootstrap_to_import_path
import pmb.parse
import pmb.parse._apkbuild
import pmb.helpers.pmaports
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))
def verify_checksums(packages, arch):
# Only do this with one build-{arch} job
arch_verify = "x86_64"
if arch != arch_verify:
print(f"NOTE: doing checksum verification in build-{arch_verify} job,"
" 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))
if __name__ == "__main__":
# Architecture to build for (as in build-{arch})
if len(sys.argv) != 2:
print("usage: build_changed_aports.py ARCH")
sys.exit(1)
arch = sys.argv[1]
# Get and print modified packages
common.add_upstream_git_remote()
packages = common.get_changed_packages()
# Package count sanity check
common.get_changed_packages_sanity_check(len(packages))
# [ci:skip-build]: verify checksums and stop
verify_only = common.commit_message_has_string("[ci:skip-build]")
if verify_only:
print("WARNING: not building changed packages ([ci:skip-build])!")
print("verifying checksums: " + ", ".join(packages))
verify_checksums(packages, arch)
sys.exit(0)
# Prepare "args" to use pmbootstrap code
sys.argv = ["pmbootstrap", "chroot"]
args = pmb.parse.arguments()
# 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(args, package)
apkbuild = pmb.parse._apkbuild.apkbuild(f"{apkbuild_path}/APKBUILD")
if not pmb.helpers.pmaports.check_arches(apkbuild["arch"], arch):
print(f"{package}: not enabled for {arch}, skipping")
packages.remove(package)
# No packages: skip build
if len(packages) == 0:
print(f"no packages changed, which can be built for {arch}")
sys.exit(0)
# Build packages
print(f"building in strict mode for {arch}: {', '.join(packages)}")
build_strict(packages, arch)
-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 running pmbootstrap.
# 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.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
fi
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
.ci/lib/check_changed_versions.py
-29
View File
@@ -1,29 +0,0 @@
#!/bin/sh -e
# Description: Ensure that we're not depending on a too new pmbootstrap version.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add coreutils curl jq
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
pmbootstrap_min_age_days="30"
pmbootstrap_min_version_field="$(grep pmbootstrap_min_version= pmaports.cfg)"
pmbootstrap_min_version="${pmbootstrap_min_version_field#*=}"
tag_date=$(curl -s "https://gitlab.postmarketos.org/api/v4/projects/postmarketOS%2Fpmbootstrap/repository/tags/$pmbootstrap_min_version" \
| jq -r ".created_at")
tag_age_timestamp=$(date -d "$tag_date" +"%s")
acceptable_age_timestamp=$(date -d "$pmbootstrap_min_age_days days ago" +"%s")
echo "NOTE: pmbootstrap versions must be at least $pmbootstrap_min_age_days days old to be the minimum required version"
if [ "$tag_age_timestamp" -ge "$acceptable_age_timestamp" ]; then
echo "ERROR: pmbootstrap version '$pmbootstrap_min_version' is too new!"
exit 1
else
echo "PASS: pmbootstrap version '$pmbootstrap_min_version' is acceptable"
exit 0
fi
+156
View File
@@ -0,0 +1,156 @@
#!/usr/bin/env python3
# Copyright 2021 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(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)
+130
View File
@@ -0,0 +1,130 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import argparse
import glob
import os
import sys
import urllib.request
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)
def get_wiki_devices_html(path):
""":param path: to a local file with the saved content of the devices wiki
page or None to download a fresh copy
:returns: HTML of the page, split into booting and not booting:
{"booting": "<!DOCTYPE HTML>\n<html..."
"not_booting": "Not booting</span></h2>\n<p>These..."}"""
content = ""
if path:
# Read file
with open(path, encoding="utf-8") as handle:
content = handle.read()
else:
# Download wiki page
url = "http://wiki.postmarketos.org/wiki/Devices"
content = urllib.request.urlopen(url).read().decode("utf-8")
# Split into booting and not booting
split = content.split("<span class=\"mw-headline\" id=\"Non-booting_devices\">")
if len(split) != 2:
print("*** Failed to parse wiki page")
sys.exit(2)
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
table).
:returns: True when the device is in the appropriate section."""
if device in html["booting"]:
return True
if device in html["not_booting"]:
if is_booting:
print(device + ": still in 'not booting' section (if this is a"
" merge request, your device should be in the 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
def main():
# Parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("--booting", help="devices must be in the upper table,"
" being in the 'not booting' table below is not"
" enough (all devices in pmaports master and stable"
" branches and should be in the upper table)",
action="store_true")
parser.add_argument("--path", help="instead of downloading the devices"
" page from the wiki, use a local HTML file",
default=None)
args = parser.parse_args()
# 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):
error = True
# Ask to adjust the wiki
if error:
print("*** Wiki check failed!")
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("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'")
print("")
print("Please take the time to do these steps. It will make your")
print("precious porting efforts visible for others, and allow them")
print("not only to use what you have created, but also to build upon")
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.")
return 1
else:
print("*** Wiki check successful!")
return 0
sys.exit(main())
Executable
+192
View File
@@ -0,0 +1,192 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Various functions used in CI scripts
import configparser
import os
import subprocess
import sys
cache = {}
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__) + "/.."))
cache["pmaports_dir"] = ret
return ret
def run_git(parameters, check=True, stderr=None):
""" Run git in the pmaports dir and return the output """
cmd = ["git", "-C", get_pmaports_dir()] + parameters
try:
return subprocess.check_output(cmd, stderr=stderr).decode()
except subprocess.CalledProcessError:
if check:
raise
return None
def add_upstream_git_remote():
""" Add a remote pointing to postmarketOS/pmaports. """
run_git(["remote", "add", "upstream",
"https://gitlab.com/postmarketOS/pmaports.git"], False)
run_git(["fetch", "-q", "upstream"])
def commit_message_has_string(needle):
return needle in run_git(["show", "-s", "--format=full", "HEAD"])
def run_pmbootstrap(parameters, output_return=False):
""" Run pmbootstrap with the pmaports dir as --aports """
cmd = ["pmbootstrap", "--aports", get_pmaports_dir()] + parameters
stdout = subprocess.PIPE if output_return else None
result = subprocess.run(cmd, stdout=stdout, universal_newlines=True)
result.check_returncode()
if output_return:
return result.stdout
def get_upstream_branch():
""" Use pmaports.cfg from current branch (e.g. "v20.05_fix-ci") and
channels.cfg from master to retrieve the upstream branch.
:returns: branch name, e.g. "v20.05" """
global cache
if "upstream_branch" in cache:
return cache["upstream_branch"]
# Get channel (e.g. "stable") from pmaports.cfg
# https://postmarketos.org/pmaports.cfg
pmaports_dir = get_pmaports_dir()
pmaports_cfg = configparser.ConfigParser()
pmaports_cfg.read(f"{pmaports_dir}/pmaports.cfg")
channel = pmaports_cfg["pmaports"]["channel"]
# Get branch_pmaports (e.g. "v20.05") from channels.cfg
# https://postmarketos.org/channels.cfg
channels_cfg_str = run_git(["show", "upstream/master:channels.cfg"])
channels_cfg = configparser.ConfigParser()
channels_cfg.read_string(channels_cfg_str)
assert channel in channels_cfg, \
f"Channel '{channel}' from pmaports.cfg in your branch is unknown." \
" This appears to be an old branch, consider recreating your change" \
" on top of master."
ret = channels_cfg[channel]["branch_pmaports"]
cache["upstream_branch"] = ret
return ret
def get_changed_files(removed=True):
""" Get all changed files and print them, as well as the branch and the
commit that was used for the diff.
:param removed: also return removed files (default: True)
:returns: set of changed files
"""
branch_upstream = f"upstream/{get_upstream_branch()}"
commit_head = run_git(["rev-parse", "HEAD"])[:-1]
commit_upstream = run_git(["rev-parse", branch_upstream])[:-1]
print("commit HEAD: " + commit_head)
print(f"commit {branch_upstream}: f{commit_upstream}")
# Check if we are HEAD on the upstream branch
if commit_head == commit_upstream:
# then compare with previous commit
commit = "HEAD~1"
else:
# otherwise compare with latest common ancestor
commit = run_git(["merge-base", branch_upstream, "HEAD"])[:-1]
print("comparing HEAD with: " + commit)
# Changed files
ret = set()
print("changed file(s):")
for file in run_git(["diff", "--name-only", commit, "HEAD"]).splitlines():
message = " " + file
if not os.path.exists(file):
message += " (deleted)"
if removed:
ret.add(file)
else:
ret.add(file)
print(message)
return ret
def get_changed_packages_sanity_check(count):
for mark in ["[ci:ignore-count]", "[ci:skip-build]"]:
if commit_message_has_string(mark):
print("NOTE: package count sanity check skipped (" + mark + ").")
return
if count <= 10:
return
branch = get_upstream_branch()
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)
def get_changed_packages():
ret = set()
for file in get_changed_files():
dirname, filename = os.path.split(file)
# Skip files:
# * in the root dir of pmaports (e.g. README.md)
# * path with a dot (e.g. .ci/, device/.shared-patches/)
if not dirname or file.startswith(".") or "/." in file:
continue
if filename != "APKBUILD":
# Walk up directories until we (eventually) find the package
# the file belongs to (could be in a subdirectory of a package)
while dirname and not os.path.exists(os.path.join(dirname, "APKBUILD")):
dirname = os.path.dirname(dirname)
# Unable to find APKBUILD the file belong to
if not dirname:
# ... maybe the package was deleted entirely?
if not os.path.exists(file):
continue
# Weird, file does not belong to any package?
# Here we just warn, there is an extra check
# to make sure that files are organized properly.
print(f"WARNING: Changed file {file} does not belong to any package")
continue
elif not os.path.exists(file):
continue # APKBUILD was deleted
ret.add(os.path.basename(dirname))
return ret
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh -e
# Description: Validate and lint deviceinfo files
# Options: with-dot-git
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk add git python3
apk add dint --allow-untrusted --repository=https://mirror.postmarketos.org/postmarketos/main
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
.ci/lib/deviceinfo_linting.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
-185
View File
@@ -1,185 +0,0 @@
#!/bin/sh -e
# shellcheck shell=busybox
# 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 git 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.postmarketos.org/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
if grep -qEr '^deviceinfo_kernel_cmdline.*[\"\s]console=null' -- device/; then
echo "ERROR: Do not use console=null in the kernel command line."
echo "Use these params to quiet console on boot: quiet loglevel=2"
echo "For more information, see: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/2989"
exit_code=1
fi
# Disallow installation of files to /etc/modules-load.d and /etc/modprobe.d
if grep -qr '/etc/modules-load.d' --exclude-dir='device-samsung-golden-downstream' -- *; then
echo "ERROR: Please replace '/etc/modules-load.d' with '/usr/lib/modules-load.d' in the following files:"
grep --color=always -r '/etc/modules-load.d' --exclude-dir='device-samsung-golden-downstream' -- *
exit_code=1
fi
# n900 is excluded because the string is in a comment linking to a repo.
# No other non-archived devices should be excluded.
if grep -qr '/etc/modprobe.d' --exclude-dir='archived' \
--exclude-dir='device-nokia-n900' -- *; then
echo "ERROR: Please replace '/etc/modprobe.d' with '/usr/lib/modprobe.d' in the following files:"
grep --color=always -r '/etc/modprobe.d' --exclude-dir='device-nokia-n900' \
--exclude-dir='archived' -- *
exit_code=1
fi
# Disallow maintainer comments.
if grep -qr '# Maintainer:' -- *; then
echo 'ERROR: Please use maintainer variables of the form maintainer="..." instead of maintainer comments of the form # Maintainer: ...'
grep --color=always -r '# Maintainer:' -- *
exit_code=1
fi
if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
# Find all moved or new kernel APKBUILDs in main, community or testing
MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES=$(git show --pretty="" --name-only --diff-filter=AR "$CI_MERGE_REQUEST_DIFF_BASE_SHA"..HEAD | grep "device/\(main\|community\|testing\)/linux-.*/APKBUILD" || true)
if [ -n "$MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES" ]; then
if [ -n "$(grep -L LLVM=1 $MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES || true)" ]; then
echo "ERROR: An added or moved close-to-mainline kernel package is not being built with LLVM."
echo "See https://postmarketos.org/edge/2025/11/11/kernels-llvm/ for more details"
grep --color=always -L LLVM=1 $MOVED_OR_NEW_MAINLINE_KERNEL_PACKAGES
exit_code=1
fi
fi
# Find all moved, added, or generally modified kernel APKBUILDs
MODIFIED_KERNEL_PACKAGES=$(git show --pretty="" --name-only --diff-filter=AMR "$CI_MERGE_REQUEST_DIFF_BASE_SHA"..HEAD | grep "device/\(main\|community\|testing\|downstream\)/linux-.*/APKBUILD" || true)
if [ -n "$MODIFIED_KERNEL_PACKAGES" ]; then
# Disallow installing kernel modules outside /usr/
_bad_module_path_packages=""
for package in $MODIFIED_KERNEL_PACKAGES; do
# Check for INSTALL_MOD_PATH being set
if grep -qr 'INSTALL_MOD_PATH="$pkgdir"' "$package"; then
# Check if INSTALL_MOD_PATH is set to install to usr
if ! grep -qr 'INSTALL_MOD_PATH="$pkgdir"/usr' "$package"; then
# If INSTALL_MOD_PATH doesn't include usr, add package to list and
# setup failure
_bad_module_path_packages="$_bad_module_path_packages $package"
_module_error=1
fi
fi
done
# Fail with error and pretty print bad packages for logging
if [ -n "$_module_error" ]; then
echo "ERROR: Please set INSTALL_MOD_PATH to '\"\$pkgdir\"/usr'."
for package in $_bad_module_path_packages; do
printf "$package\n"
done
exit_code=1
fi
fi
# Disallow adding packages without a maintainer set
NEW_APKBUILDS=$(git show --pretty="" --name-only --diff-filter=A "$CI_MERGE_REQUEST_DIFF_BASE_SHA"..HEAD | grep APKBUILD || true)
if [ -n "$NEW_APKBUILDS" ]; then
if [ -n "$(grep -L '^maintainer="[^"]\+"$' $NEW_APKBUILDS || true)" ]; then
echo "ERROR: A new package does not have a maintainer set."
grep --color=always -L '^maintainer="[^"]\+"$' $NEW_APKBUILDS
exit_code=1
fi
fi
# Get latest commit message in MR
case "$CI_COMMIT_DESCRIPTION" in
*"[ci:skip-grep]"*)
echo "WARNING: not checking packages with grep"
echo " ([ci:skip-grep])!"
exit_code=0
;;
esac
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.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
export PYTHONUNBUFFERED=1
.ci/lib/kconfig.py
-80
View File
@@ -1,80 +0,0 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-or-later
import common
import os
import sys
import subprocess
import tomllib
custom_valid_options = [
"!pmb:crossdirect",
"!pmb:kconfigcheck",
"pmb:cross-native",
"pmb:cross-native2",
"pmb:drm",
"pmb:generic-kernel",
"pmb:strict",
"pmb:systemd",
"pmb:systemd-never",
]
def get_kconfigcheck_categories() -> list [str]:
with open("kconfigcheck.toml", "rb") as kconfigcheck_config:
kconfigcheck_data = tomllib.load(kconfigcheck_config)
kconfigcheck_categories = []
for category_name in kconfigcheck_data:
if category_name == "aliases":
for alias_name in kconfigcheck_data["aliases"]:
kconfigcheck_categories.append(f"pmb:kconfigcheck-{alias_name}")
else:
kconfigcheck_categories.append(category_name)
return [item.replace("category:", "pmb:kconfigcheck-") for item in kconfigcheck_categories]
if __name__ == "__main__":
if common.commit_message_has_string("[ci:skip-apkbuild-lint]"):
print("WARNING: not linting deviceinfo files ([ci:skip-apkbuild-lint])")
exit(0)
kconfigcheck_categories = get_kconfigcheck_categories()
custom_valid_options += kconfigcheck_categories
os.environ["CUSTOM_VALID_OPTIONS"] = " ".join(custom_valid_options)
apkbuilds = {file for file in common.get_changed_files()
if os.path.basename(file) == "APKBUILD"}
if len(apkbuilds) < 1:
print("No APKBUILDs to lint")
sys.exit(0)
apkbuilds_filtered = []
for apkbuild in apkbuilds:
if apkbuild.startswith("temp/") or apkbuild.startswith("cross/"):
print(f"NOTE: Skipping linting of {apkbuild}")
continue
apkbuilds_filtered.append(apkbuild)
if len(apkbuilds_filtered) < 1:
print("No APKBUILDs to lint")
sys.exit(0)
print("Running apkbuild-lint...")
print("")
ret = 0
for apkbuild in apkbuilds_filtered:
try:
cmd = ["apkbuild-lint", apkbuild]
subprocess.run(cmd, text=True, check=True)
except subprocess.CalledProcessError as exception:
ret = exception.returncode
print("")
if ret == 0:
print("Success")
sys.exit(ret)
-105
View File
@@ -1,105 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
import os
import pathlib
# Same dir
import common
# pmbootstrap
import pmb.core
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"])
# We set the timeout to 1 hour because linking the Linux kernel with
# ThinLTO on our aarch64 runners takes slightly over 30 minutes
common.run_pmbootstrap(["--details-to-stdout", "--no-ccache",
"--timeout", "3600",
"build",
"--strict", "--force",
"--arch", arch, ] + list(packages))
if __name__ == "__main__":
# Architecture to build for (as in build-{arch})
if len(sys.argv) != 2:
print("usage: build_changed_aports.py ARCH")
sys.exit(1)
arch = sys.argv[1]
# Get and print modified packages
packages = common.get_changed_packages(skip_archived=True)
# Load context
sys.argv = ["pmbootstrap.py", "chroot"]
args = pmb.parse.arguments()
context = get_context()
# Get set of all buildable packages for the enabled repos, for skipping unbuildable
# aports later. We might be given a changed aport from e.g. extra-repos/systemd when
# that repo is not enabled
buildable_pkgs = set()
for path in pmb.core.pkgrepo.pkgrepo_iter_package_dirs():
buildable_pkgs.add(os.path.basename(path))
# To store a list of packages from extra-repos/systemd for special handling later:
systemd_pkgs = list()
# Filter out packages that either:
# 1. can't be built for given arch
# 2. are not found in enabled repos
# (Iterate over copy of packages, because we modify it in this loop)
for package in packages.copy():
if package not in buildable_pkgs:
print(f"{package}: not in any available repos, skipping")
packages.remove(package)
# FIXME: this should probably be more generic, if other repos are added later?
# This just tosses the package into the list of packages to try building later w/ systemd enabled, and assumes it'll be found there.
systemd_pkgs.append(package)
continue
apkbuild_path = pmb.helpers.pmaports.find(package)
apkbuild = pmb.parse._apkbuild.apkbuild(pathlib.Path(apkbuild_path, "APKBUILD"))
if not pmb.helpers.pmaports.check_arches(apkbuild["arch"], arch):
print(f"{package}: not enabled for {arch}, skipping")
packages.remove(package)
# No packages: skip build
if len(packages) == 0:
print(f"no packages changed, which can be built for {arch}")
sys.exit(0)
build_strict(packages, arch)
# Build packages in extra-repos/systemd
# FIXME: this should probably be more generic, if other repos are added later?
if systemd_pkgs:
common.run_pmbootstrap(["config", "systemd", "always"])
# To fix the ERROR: Chroot 'native' is for the 'edge' channel, but you are on the
# 'systemd-edge' channel. Run 'pmbootstrap zap' to delete your chroots and try again.
# To do this automatically, run 'pmbootstrap config auto_zap_misconfigured_chroots yes'.
common.run_pmbootstrap(["config", "auto_zap_misconfigured_chroots", "yes"])
# filter out packages that can't be built for arch
# (Iterate over copy of `systemd_pkgs`, because we modify it in this loop)
for package in systemd_pkgs.copy():
apkbuild_path = pmb.helpers.pmaports.find(package, True, True, with_extra_repos="enabled")
apkbuild = pmb.parse._apkbuild.apkbuild(pathlib.Path(apkbuild_path, "APKBUILD"))
if not pmb.helpers.pmaports.check_arches(apkbuild["arch"], arch):
print(f"(extra-repos/systemd) {package}: not enabled for {arch}, skipping")
systemd_pkgs.remove(package)
# No packages: skip build
if len(systemd_pkgs) == 0:
print(f"no packages changed, which can be built for {arch}")
sys.exit(0)
build_strict(systemd_pkgs, arch)
-20
View File
@@ -1,20 +0,0 @@
#!/bin/sh -e
# Description: build modified packages for this architecture
# Options: native slow
# Use 'native' because it requires running pmbootstrap.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/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"
-196
View File
@@ -1,196 +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 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/main: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.
common.run_git(["remote", "add", "upstream",
"https://gitlab.postmarketos.org/postmarketOS/pmaports.git"], False)
common.run_git(["fetch", "-q", "upstream"])
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"
# Exclude linux-next from pkgrel checks, as it is updated automatically.
#
# Without this, .ci/commits.sh complains about the following:
# ERROR: Modified package(s) don't have an increased version or a new
# package has a nonzero pkgrel!
if "linux-next" in packages:
packages.remove("linux-next")
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://docs.postmarketos.org/pmaports/main/packaging-guidelines.html#package-versioning-pkgver-pkgrel")
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)
# Check that pkgrel was reset to 0 when pkgver was changed
if head_parsed["pkgver"] != upstream_parsed["pkgver"] and head_parsed["pkgrel"] != "0":
print(f" - {package}: pkgrel should be 0 when pkgver changes."
"See: https://docs.postmarketos.org/pmaports/main/packaging-guidelines.html#package-versioning-pkgver-pkgrel")
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
packages = common.get_changed_packages()
if len(packages) == 0:
print("no aports changed in this branch")
exit(0)
print(f"Changed packages: {packages}")
# 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)
-147
View File
@@ -1,147 +0,0 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
from pathlib import Path
import argparse
import sys
import urllib.request
# Same dir
import common
def get_devices() -> list[str]:
""":returns: list of all devices"""
ret = []
pmaports = Path(__file__).resolve().parents[2]
for path in pmaports.glob("device/*/device-*/"):
device = path.name.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)
def get_wiki_devices_html(path: Path | None) -> dict[str, str]:
""":param path: to a local file with the saved content of the devices wiki
page or None to download a fresh copy
:returns: HTML of the page, split into booting and not booting:
{"booting": "<!DOCTYPE HTML>\n<html..."
"not_booting": "Not booting</span></h2>\n<p>These..."}"""
content = ""
if path:
# Read file
with open(path, encoding="utf-8") as handle:
content = handle.read()
else:
# Download wiki page
url = "https://wiki.postmarketos.org/wiki/Devices"
with urllib.request.urlopen(url) as f:
content = f.read().decode("utf-8")
# Split into booting and not booting
split = content.split("<span class=\"mw-headline\" id=\"Non-booting_devices\">")
if len(split) != 2:
print("*** Failed to parse wiki page")
sys.exit(2)
return {"booting": split[0], "not_booting": split[1]}
def get_wiki_renamed_devices_html() -> str:
""":returns: HTML of the page"""
# Download wiki page
url = "https://wiki.postmarketos.org/wiki/Renamed_Devices"
with urllib.request.urlopen(url) as f:
res: bytes = f.read()
return res.decode("utf-8")
def check_device(device: str, html: dict[str, str], is_booting: bool) -> bool:
""":param is_booting: require the device to be in the booting section, not
just anywhere in the page (i.e. in the not booting
table).
:returns: True when the device is in the appropriate section."""
if device in html["booting"]:
return True
if device in html["not_booting"]:
if is_booting:
print(device + ": still in 'not booting' section (if this is a"
" merge request, your device should be in the 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
def main() -> int:
# Parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("--booting", help="devices must be in the upper table,"
" being in the 'not booting' table below is not"
" enough (all devices in pmaports main and stable"
" branches and should be in the upper table)",
action="store_true")
parser.add_argument("--path", help="instead of downloading the devices"
" page from the wiki, use a local HTML file",
type=Path, default=None)
parser.add_argument("--all", help="check all devices (default: check only"
" devices changed from branch point)",
action="store_true")
args = parser.parse_args()
html = get_wiki_devices_html(args.path)
html["renamed"] = get_wiki_renamed_devices_html()
error = False
devices = []
if args.all:
devices = get_devices()
else:
devices = common.get_changed_devices(skip_archived=True)
# remove 'device-' prefix
devices = [d[7:] for d in devices]
devices = [d.removesuffix("-downstream") for d in devices]
for device in devices:
if not check_device(device, html, args.booting):
error = True
# Ask to adjust the wiki
if error:
print("*** Wiki check failed!")
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("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'")
print("")
print("Please take the time to do these steps. It will make your")
print("precious porting efforts visible for others, and allow them")
print("not only to use what you have created, but also to build upon")
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
print("*** Wiki check successful!")
return 0
sys.exit(main())
-190
View File
@@ -1,190 +0,0 @@
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
# Various functions used in CI scripts
import configparser
import os
import subprocess
from functools import cache
@cache
def get_pmaports_dir():
return os.path.realpath(os.path.join(os.path.dirname(__file__) + "/../.."))
def run_git(parameters, check=True, stderr=None):
""" Run git in the pmaports dir and return the output """
cmd = ["git", "-C", get_pmaports_dir()] + parameters
try:
return subprocess.check_output(cmd, stderr=stderr).decode()
except subprocess.CalledProcessError:
if check:
raise
return None
def commit_message_has_string(needle):
base_commit = get_base_commit()
return needle in run_git(["log", "--pretty=format:%B", f"{base_commit}..HEAD"])
def all_committed_by_merge_bot():
base_commit = get_base_commit()
commit_emails = run_git(["log", "--pretty=format:%ce", f"{base_commit}..HEAD"]).splitlines()
bot_email = os.getenv("PMOS_MERGE_BOT_EMAIL", "merge-bot@postmarketos.org")
return all(bot_email == ce for ce in commit_emails)
def run_pmbootstrap(parameters):
""" Run pmbootstrap with the pmaports dir as --aports """
cmd = ["pmbootstrap", "--aports", get_pmaports_dir()] + parameters
subprocess.run(cmd, universal_newlines=True, check=True)
@cache
def get_upstream_branch():
""" Use pmaports.cfg from current branch (e.g. "v20.05_fix-ci") and
channels.cfg from main 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
# Get channel (e.g. "stable") from pmaports.cfg
# https://postmarketos.org/pmaports.cfg
pmaports_dir = get_pmaports_dir()
pmaports_cfg = configparser.ConfigParser()
pmaports_cfg.read(f"{pmaports_dir}/pmaports.cfg")
channel = pmaports_cfg["pmaports"]["channel"]
# Get branch_pmaports (e.g. "v20.05") from channels.cfg
# https://postmarketos.org/channels.cfg
channels_cfg_str = run_git(["show", "upstream/main:channels.cfg"])
channels_cfg = configparser.ConfigParser()
channels_cfg.read_string(channels_cfg_str)
assert channel in channels_cfg, \
f"Channel '{channel}' from pmaports.cfg in your branch is unknown." \
" This appears to be an old branch, consider recreating your change" \
" on top of master."
return channels_cfg[channel]["branch_pmaports"]
@cache
def get_base_commit() -> str:
"""Get the base commit that can be compared with HEAD to get all commits in the
given branch/merge request."""
commit = os.getenv("CI_MERGE_REQUEST_DIFF_BASE_SHA")
if commit is not None:
return commit
# Add a remote pointing to postmarketOS/pmaports
run_git(["remote", "add", "upstream",
"https://gitlab.postmarketos.org/postmarketOS/pmaports.git"], False)
run_git(["fetch", "-q", "upstream"])
branch_upstream = f"upstream/{get_upstream_branch()}"
commit_head = run_git(["rev-parse", "HEAD"])[:-1]
commit_upstream = run_git(["rev-parse", branch_upstream])[:-1]
print("commit HEAD: " + commit_head)
print(f"commit {branch_upstream}: {commit_upstream}")
# Check if we are HEAD on the upstream branch
if commit_head == commit_upstream:
# then compare with previous commit
commit = "HEAD~1"
else:
# otherwise compare with latest common ancestor
commit = run_git(["merge-base", branch_upstream, "HEAD"])[:-1]
print("comparing HEAD with: " + commit)
return commit
def get_changed_files(removed=False):
""" Get all changed files and print them, as well as the branch and the
commit that was used for the diff.
:param removed: also return removed files (default: True)
:returns: set of changed files
"""
commit = get_base_commit()
# Changed files
ret = set()
print("changed file(s):")
for file in run_git(["diff", "--name-only", commit, "HEAD"]).splitlines():
message = " " + file
if not os.path.exists(file):
message += " (deleted)"
if removed:
ret.add(file)
else:
ret.add(file)
print(message)
return ret
def get_changed_packages(skip_archived: bool = False):
ret = set()
for file in get_changed_files(removed=True):
dirname, filename = os.path.split(file)
# Skip files:
# * in the root dir of pmaports (e.g. README.md)
# * path with a dot (e.g. .ci/, device/.shared-patches/)
# * documentation
if (
not dirname
or file.startswith(".")
or "/." in file
or skip_archived and dirname.startswith("device/archived")
or dirname == "docs"
):
continue
if filename != "APKBUILD":
# Walk up directories until we (eventually) find the package
# the file belongs to (could be in a subdirectory of a package)
while dirname and not os.path.exists(os.path.join(dirname, "APKBUILD")):
dirname = os.path.dirname(dirname)
# Unable to find APKBUILD the file belong to
if not dirname:
# ... maybe the package was deleted entirely?
if not os.path.exists(file):
continue
# Weird, file does not belong to any package?
# Here we just warn, there is an extra check
# to make sure that files are organized properly.
print(f"WARNING: Changed file {file} does not belong to any package")
continue
elif not os.path.exists(file):
continue # APKBUILD was deleted
ret.add(os.path.basename(dirname))
return ret
def get_changed_kernels(skip_archived: bool = False):
ret = []
for pkgname in get_changed_packages(skip_archived):
if pkgname.startswith("linux-"):
ret += [pkgname]
return ret
def get_changed_devices(skip_archived: bool = False):
ret = []
for pkgname in get_changed_packages(skip_archived):
if pkgname.startswith("device-"):
ret += [pkgname]
return ret
-28
View File
@@ -1,28 +0,0 @@
#!/usr/bin/env python3
# Copyright 2025 Stefan Hansson
# SPDX-License-Identifier: GPL-3.0-or-later
import common
import glob
import os.path
import subprocess
import sys
if __name__ == "__main__":
if common.commit_message_has_string("[ci:skip-dint]"):
print("WARNING: not linting deviceinfo files ([ci:skip-dint])")
exit(0)
if "deviceinfo_schema.toml" in common.get_changed_files():
print("deviceinfo_schema.toml changed -> checking all deviceinfo files")
pmaports_dir = common.get_pmaports_dir()
deviceinfo_files = set(glob.glob(pmaports_dir + "/device/*/*/deviceinfo"))
else:
# only lint deviceinfo files in the devices repo
deviceinfo_files = {file for file in common.get_changed_files()
if os.path.basename(file) == "deviceinfo" and file.startswith("device/")}
try:
subprocess.run(["dint", "check", *deviceinfo_files], text=True, check=True)
except subprocess.CalledProcessError as exception:
sys.exit(exception.returncode)
-223
View File
@@ -1,223 +0,0 @@
#!/usr/bin/env python3
# Copyright 2025 Pablo Correa Gomez
# SPDX-License-Identifier: GPL-3.0-or-later
import argparse
from functools import cached_property
from pathlib import Path
from typing import Self
import sys
import traceback
from jinja2 import Template
import pmb.parse
from pmb.parse.deviceinfo import Deviceinfo
from pmb.types import Apkbuild
import pmb.helpers.devices
import pmb.helpers.logging
import pmb.helpers.package
from pmb.core.arch import Arch
# Same dir
import common
class Device:
def __init__(self, codename: str):
self.codename = codename
self.full_path = pmb.helpers.devices.find_path(codename)
def __repr__(self):
return f"Device({self.codename})"
@property
def name(self):
return self.full_path.name.removeprefix("device-")
@cached_property
def gitlab_ci_fragment(self) -> str | None:
fragment_path = self.full_path / "gitlab-ci.yml.j2"
try:
fragment_tmpl = fragment_path.read_text()
except Exception:
return None
return Template(fragment_tmpl).render(device=self)
@cached_property
def pmaports_path(self) -> Path:
# Find the root of pmaports
pmaports_root = self.full_path.parent
while (not (pmaports_root / "pmaports.cfg").exists() and
pmaports_root != pmaports_root.root):
pmaports_root = pmaports_root.parent
assert pmaports_root != pmaports_root.root
return self.full_path.relative_to(pmaports_root)
@cached_property
def apkbuild(self) -> Apkbuild:
return pmb.parse.apkbuild(self.full_path)
@property
def pkgname(self) -> str:
return self.apkbuild['pkgname']
@property
def arch(self) -> Arch:
return Arch(self.apkbuild['arch'][0])
@property
def testing_dependencies(self) -> set[str]:
# TODO: Source this from the APKBUILD
return {"postmarketos-mkinitfs-hook-ci"}
@cached_property
def package_dependencies(self) -> set[str]:
# HACK: Work around a bug in depends_recurse which prevents listing all the dependencies
# Bug: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2623
return {"postmarketos-initramfs"}
# return pmb.helpers.package.depends_recurse(pkgname=self.pkgname,
# arch=self.arch)
@cached_property
def dependencies(self) -> set[str]:
return self.package_dependencies | self.testing_dependencies
@cached_property
def kernel_variants(self) -> list[str]:
kernels = []
subpackage_prefix = f"device-{self.codename}-kernel-"
for subpkgname in self.apkbuild.get('subpackages', []):
if not subpkgname.startswith(subpackage_prefix):
continue
kernel_name = subpkgname.removeprefix(subpackage_prefix)
# Ignore `none` kernels as they are not bootable
if kernel_name != "none":
kernels.append(kernel_name)
return kernels
@cached_property
def deviceinfo(self) -> dict[str, Deviceinfo] | Deviceinfo:
# NOTE: deviceinfo files that have different values per kernel are
# currently unsupported due to a gitlab-ci issue which prevents us
# from having a per-kernel list of variables that would be selected
# using `.extends`:
# https://gitlab.com/gitlab-org/gitlab/-/issues/299423
return Deviceinfo(self.full_path / "deviceinfo", None)
@property
def has_kernel_variants(self):
return len(self.kernel_variants) > 0
@classmethod
def supported_devices(cls) -> dict[Path, Self]:
# NOTE: Not sure I like relying on pmboostrap just to avoid listing
# devices ourselves, but since we need it to parse the APKBUILD, then
# let's avoid duplicating the logic?
supported_devices = {}
for vendor in pmb.helpers.devices.list_vendors():
for device in pmb.helpers.devices.list_codenames(vendor):
try:
dev = cls(device.codename)
# Ignore devices that do not have a gitlab ci fragment,
# since adding that fragment is how we mark them as DUTs
if not dev.gitlab_ci_fragment:
continue
supported_devices[dev.pmaports_path] = dev
except Exception:
traceback.print_exc()
return supported_devices
class ArchTagSet(set):
def update(self, iterable):
supported_arches = Arch.supported_binary()
# This ignores things like !armv7, that could be a follow-up optimization
if 'noarch' in iterable or 'all' in iterable:
iterable = [arch for arch in supported_arches]
super().update([Arch(arch) for arch in iterable if Arch(arch) in supported_arches])
if __name__ == "__main__":
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument("--template", default=".ci/build-jobs.yaml.j2", help="Jinja2 input template")
parser.add_argument("--output", default=".ci/build-jobs.yaml", help="output pipeline")
args = parser.parse_args()
# pmb logging has to be initialized for later pmb commands to work, setting
# to /dev/null since we don't care about the output. Later this could
# be changed to a file and added as a CI artifact if we need to debug
# something.
pmb.logging.init(Path("/dev/null"), False)
# Load context
sys.argv = ["pmbootstrap.py", "chroot"]
_ = pmb.parse.arguments()
# Get the list of supported devices
supported_devices = Device.supported_devices()
print(f"Supported devices: {[d for d in supported_devices.values()]}")
archs = ArchTagSet()
devices_under_test = set()
packages_modified = set()
# Get and print modified packages
for file in common.get_changed_files():
path = Path(file)
# Check if the modified's file parent folder is one of a supported dev
if device := supported_devices.get(path.parent):
devices_under_test.add(device)
if path.name != "APKBUILD":
continue
apkbuild = pmb.parse.apkbuild(path)
packages_modified.add(apkbuild['pkgname'])
archs.update(apkbuild["arch"])
# Add all the devices found in CI that depend on the package that got
# modified
for device in supported_devices.values():
if apkbuild['pkgname'] in device.dependencies:
devices_under_test.add(device)
skip = False
if common.commit_message_has_string("[ci:skip-build]"):
print("User requested skipping build, skipping build")
skip = True
if common.all_committed_by_merge_bot():
print("All commits in branch committed by merge bot, skipping build")
skip = True
if skip:
archs = ArchTagSet()
devices_under_test = set()
print(f"Architectures to build: {archs}")
print(f"Devices under test: {devices_under_test}")
with open(args.template) as f:
rendered = Template(f.read()).render(
archs=archs,
devices_under_test=devices_under_test,
packages_modified=packages_modified,
archtag={
Arch.x86_64: "shared",
Arch.x86: "shared",
Arch.aarch64: "aarch64",
Arch.armv7: "armv7",
Arch.armhf: "armhf",
Arch.riscv64: "qemu",
Arch.ppc64le: "ppc64le",
Arch.loongarch64: "loongarch64",
},
)
with open(args.output, "w") as fw:
fw.write(rendered)
-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
-96
View File
@@ -1,96 +0,0 @@
#!/usr/bin/env python3
# Copyright 2024 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
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__":
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(skip_archived=True)
print(f"Changed kernels: {pkgnames}")
if len(pkgnames) == 0:
print("No kernels changed in this branch")
exit(0)
elif common.commit_message_has_string("[ci:skip-kconfigcheck]"):
print("WARNING: not checking kernel configs ([ci:skip-kconfigcheck])")
exit(0)
last_failed = check_kconfig(pkgnames)
if last_failed:
show_error(last_failed)
exit(1)
-283
View File
@@ -1,283 +0,0 @@
#!/bin/sh
# Unit testing framework for shell scripts
# Invoke with the path to a tests/ subdir of a package and the
# package name as arguments. Or source it with the following
# variables set:
# * results_dir - second argument to the test script
set -e
# Colors :D
RED="\e[31m"
GREEN="\e[32m"
YELLOW="\e[33m"
BLUE="\e[34m"
BOLDBLUE="\e[1;34m"
RESET="\e[0m"
testlib_path="$(realpath "$0")"
_test_assert_failed=""
_test_testn=1
_test_passedn=0
_test_failedn=0
_test_current_test=""
_test_statefile="$(mktemp)"
_test_original_pwd=""
_test_temp_root=""
# Set by each test
results_dir="${results_dir:-}"
test_log() {
# ash supports echo -e
# shellcheck disable=SC3037
echo -e "$*" >&2
}
test_info() {
# shellcheck disable=SC3037
echo -e "${BLUE}$*${RESET}" >&2
}
test_debug() {
# shellcheck disable=SC3037
echo -e "${YELLOW}$*${RESET}" >&2
}
create_test_root() {
_test_original_pwd="$(pwd)"
_test_temp_root="$(mktemp -d)"
cd "$_test_temp_root"
}
cleanup_test_root() {
if [ -n "$_test_original_pwd" ]; then
cd "$_test_original_pwd"
fi
if [ -n "$_test_temp_root" ] && [ -d "$_test_temp_root" ]; then
rm -rf "$_test_temp_root"
fi
_test_original_pwd=""
_test_temp_root=""
}
assert_strequal() {
# $1: first string
# $2: second string
if [ -z "$1" ] || [ -z "$2" ]; then
test_log "ERROR: assert_equal: not enough arguments given"
exit 1
fi
if [ "$1" != "$2" ]; then
_test_assert_failed="$1 != $2"
test_log " ❌ $_test_assert_failed"
return
fi
test_log " ✅ $1 == $2"
}
assert_equal() {
# $1: name of variable
# $2: value to compare
if [ -z "$1" ] || [ -z "$2" ]; then
test_log "ERROR: assert_equal: not enough arguments given"
exit 1
fi
val="$(eval echo "\$$1")"
if [ "$val" != "$2" ]; then
_test_assert_failed="\$$1 != $2 (got $val)"
test_log " ❌ $_test_assert_failed"
return
fi
test_log " ✅ \$$1 == $2"
}
assert_unset() {
if [ -z "$1" ]; then
test_log "ERROR: assert_unset: not enough arguments given"
exit 1
fi
val="$(eval echo \$"$1")"
if [ -n "$val" ]; then
_test_assert_failed="\$$1 should be unset (has value '$val')"
test_log " ❌ $_test_assert_failed"
return
fi
test_log " ✅ \$$1 is unset"
}
assert_exists() {
# $1: filename to test
if [ -z "$1" ]; then
test_log "ERROR: assert_exists: not enough arguments given"
exit 1
fi
if ! [ -e "$1" ]; then
_test_assert_failed="\$$1 should exist but does not"
test_log " ❌ $_test_assert_failed"
return
fi
test_log " ✅ \$$1 exists"
}
assert_not_exists() {
if [ -z "$1" ]; then
test_log "ERROR: assert_not_exists: not enough arguments given"
exit 1
fi
if [ -e "$1" ]; then
_test_assert_failed="\$$1 should NOT exist but does"
test_log " ❌ $_test_assert_failed"
return
fi
test_log " ✅ \$$1 does not exist"
}
assert_contains() {
# $1: string to search in
# $2: substring to find
if [ -z "$1" ] || [ -z "$2" ]; then
test_log "ERROR: assert_contains: not enough arguments given"
exit 1
fi
case "$1" in
*"$2"*)
test_log " ✅ '$2' found in '$1'"
;;
*)
_test_assert_failed="'$2' not found in '$1'"
test_log " ❌ $_test_assert_failed"
return
;;
esac
}
assert_not_contains() {
# $1: string to search in
# $2: substring that should not be found
if [ -z "$1" ] || [ -z "$2" ]; then
test_log "ERROR: assert_not_contains: not enough arguments given"
exit 1
fi
case "$1" in
*"$2"*)
_test_assert_failed="'$2' found in '$1' but should not be"
test_log " ❌ $_test_assert_failed"
return
;;
*)
test_log " ✅ '$2' not found in '$1'"
;;
esac
}
# Log some expression and evaluate it
logeval() {
eval "$*"
test_log "${YELLOW}+ $*${RESET}"
}
# Start a test. Shell scripts involved in the test should be sourced AFTER calling this function!
start_test() {
if [ -n "$_test_current_test" ]; then
test_log "ERROR: multiple calls to start_test without calling end_test first!"
test_log "Current test: $_test_current_test"
exit 1
fi
test_log "==> Test $_test_testn: $1"
_test_current_test="$1"
set > "$_test_statefile"
}
# End a test and reset the environment.
end_test() {
local msg
local save_assert_failed
# Restore environment
save_assert_failed="$_test_assert_failed"
# Splitting is intentional
# shellcheck disable=SC2046
unset $(set | grep "='" | cut -d= -f1 | grep -vE "(PATH|IFS|TERM|LANG|HOME|PWD|SHELL|USER|save_assert_failed|_test_statefile)" )
# shellcheck disable=SC1090
. "$_test_statefile"
_test_assert_failed="$save_assert_failed"
if [ -n "$_test_assert_failed" ]; then
msg="${RED}Failed! ❌ ${_test_assert_failed}${RESET}"
echo "Test $_test_testn: $_test_assert_failed" >> "$results_dir/failed"
_test_failedn=$((_test_failedn+1))
echo "$_test_failedn" > "$results_dir/failedn"
unset _test_assert_failed
else
msg="${GREEN}Passed!${RESET}"
_test_passedn=$((_test_passedn+1))
echo "$_test_passedn" > "$results_dir/passedn"
fi
test_log "<== Test $_test_testn: $msg $_test_current_test\n"
_test_testn=$((_test_testn+1))
_test_current_test=""
}
# Call at the end of each testsuite shell script
end_testsuite() {
if [ -n "$_test_current_test" ]; then
test_log "${RED}ERROR: end_testsuite called without calling end_test first!${RESET}"
test_log "${RED}Current test: $_test_current_test${RESET}"
exit 1
fi
if [ -f "$results_dir/failed" ]; then
exit 1
fi
exit 0
}
run_tests() {
local failed test_results_base
local test name total passedn failedn t_passed t_failed
test_results_base="$(mktemp -d)"
test_log "Running tests for $2"
# FIXME: yeah this isn't quite the best way to iterate the files
# shellcheck disable=SC2010
for name in $(ls "$1" | grep "\.sh$"); do
test="$1/$name"
mkdir "$test_results_base/$name"
echo 0 > "$test_results_base/$name/passedn"
echo 0 > "$test_results_base/$name/failedn"
test_log
test_log "${BOLDBLUE}# Test suite ${name}${RESET}"
$test "$testlib_path" "$test_results_base/$name" || failed="$failed $name"
t_passed=$(cat "$test_results_base/$name/passedn")
t_failed=$(cat "$test_results_base/$name/failedn")
passedn=$((passedn+t_passed))
failedn=$((failedn+t_failed))
total=$((total+t_passed+t_failed))
done
if [ -n "$failed" ]; then
test_log
test_log "Some tests failed:"
for test in $failed; do
test_log "❌ $test"
test_log " ${RED}$(cat "$test_results_base/$test/failed")${RESET}"
done
fi
if [ $passedn -lt $total ]; then
test_log "[${RED}$passedn/$total tests passed${RESET}]"
else
test_log "[${GREEN}$passedn/$total tests passed!${RESET}]"
fi
test_log
if [ -n "$failed" ]; then exit 1; else exit 0; fi
}
# FIXME: probably not the best way to determine if this was sourced
if [ $# -gt 0 ]; then
run_tests "$1" "$2"
fi
-91
View File
@@ -1,91 +0,0 @@
#!/usr/bin/env python3
# Copyright 2025 Pablo Correa Gomez
# SPDX-License-Identifier: GPL-3.0-or-later
import os
import sys
# Same dir
import common
# pmbootstrap
import pmb.core
from pmb.core.context import get_context
def verify_checksums(packages):
if len(packages) == 0:
print("no packages changed, not doing any checksums verification")
return
print("verifying checksums: " + ", ".join(packages))
common.run_pmbootstrap(["build_init"])
common.run_pmbootstrap(["--details-to-stdout", "checksum", "--verify"] +
list(packages))
if __name__ == "__main__":
# Get and print modified packages
packages = common.get_changed_packages()
# Load context
sys.argv = ["pmbootstrap.py", "chroot"]
args = pmb.parse.arguments()
context = get_context()
# Get set of all buildable packages for the enabled repos, for skipping unbuildable
# aports later. We might be given a changed aport from e.g. extra-repos/systemd when
# that repo is not enabled
buildable_pkgs = set()
archived = set()
for path in pmb.core.pkgrepo.pkgrepo_iter_package_dirs():
# Store archived packages for matching later
if os.path.split(os.path.split(path)[0])[1] == 'archived':
archived.add(os.path.basename(path))
continue
buildable_pkgs.add(os.path.basename(path))
# To store a list of packages from extra-repos/systemd for special handling
# later:
systemd_pkgs = list()
# Filter out packages are not found in enabled repos or are in archived
# (Iterate over copy of packages, because we modify it in this loop)
for package in packages.copy():
if package not in buildable_pkgs:
# Specifically handle archived since it could include packages
# who's sources are dead
if package in archived:
print(f"{package}: archived, skipping")
packages.remove(package)
continue
print(f"{package}: not in current repo, skipping")
packages.remove(package)
# FIXME: this should probably be more generic, if other repos are added
# later?
# This just tosses the package into the list of packages to try
# building later w/ systemd enabled, and assumes it'll be found
# there.
print(f"{package}: adding to list of packages to check in systemd repo")
systemd_pkgs.append(package)
continue
# No packages: skip build
if len(packages) == 0:
print("no packages to check for the current repo")
else:
verify_checksums(packages)
# FIXME: this should probably be more generic, if other repos are added later?
if systemd_pkgs:
common.run_pmbootstrap(["config", "systemd", "always"])
# To fix the ERROR: Chroot 'native' is for the 'edge' channel, but you are on the
# 'systemd-edge' channel. Run 'pmbootstrap zap' to delete your chroots and try again.
# To do this automatically, run 'pmbootstrap config auto_zap_misconfigured_chroots yes'.
common.run_pmbootstrap(["config", "auto_zap_misconfigured_chroots", "yes"])
# No packages: skip build
if len(systemd_pkgs) == 0:
print("no packages to check for the systemd repo")
else:
verify_checksums(systemd_pkgs)
+1 -1
View File
@@ -3,7 +3,7 @@
# 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
-16
View File
@@ -1,16 +0,0 @@
#!/bin/sh -e
# Description: static type checking for python scripts
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add py3-argcomplete py3-pip py3-pytest
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
pip install --break-system-packages --no-warn-script-location mypy
# Need to change directory for pyproject.toml to be picked up.
cd .ci
python -m mypy .
-2
View File
@@ -1,2 +0,0 @@
[tool.mypy]
disable_error_code = ["import-not-found"]
-32
View File
@@ -1,32 +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 running pmbootstrap.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/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
# Needed to import "common"
export PYTHONPATH="$PYTHONPATH:.ci/lib"
# Run testcases
pytest -vv --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 $(find .ci -name '*.py')
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh -e
# Copyright 2021 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/.ci/testcases" "$@"
+23 -26
View File
@@ -1,35 +1,33 @@
#!/bin/sh -e
# Copyright 2023 Oliver Smith
# Copyright 2021 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)"
set -e
DIR="$(cd "$(dirname "$0")" && pwd -P)"
cd "$DIR/.."
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add shellcheck
exec su "${TESTUSER:-build}" -c "sh -e $0"
# 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/mdss-fb-init-hack/mdss-fb-init-hack.sh
./main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-dns-filter.sh
./main/postmarketos-duranium/rootfs-usr-bin-duranium-set-channel
./main/postmarketos-duranium/rootfs-usr-libexec-duranium-first-boot
./main/postmarketos-duranium/rootfs-usr-libexec-duranium-usb-gadget-setup
./main/postmarketos-base/rootfs-usr-lib-firmwareload.sh
./main/postmarketos-installkernel/installkernel-pmos
./main/postmarketos-initramfs/init.sh
./main/postmarketos-initramfs/init_functions.sh
./main/postmarketos-mkinitfs-hook-netboot/netboot.sh
./main/postmarketos-ui-os-installer/rootfs-usr-bin-pmos_setup.sh
./main/postmarketos-usb-moded/rootfs-usr-lib-systemd-system-generators-umtprd-config-generator
./main/postmarketos-mkinitfs/init.sh
./main/postmarketos-mkinitfs/init_functions.sh
./main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh
./main/postmarketos-update-kernel/update-kernel.sh
./main/swclock-offset/swclock-offset-boot.sh
./main/swclock-offset/swclock-offset-shutdown.sh
./main/ttyescape/*.sh
./main/ttyescape/*.post-install
./main/unl0kr/unlock.sh
./device/community/soc-qcom/call_audio_idle_suspend_workaround.sh
./device/testing/device-apple-mac-aarch64/*.sh
./extra-repos/systemd/postmarketos-base-systemd/rootfs-usr-libexec-systemd-apk-trigger
./main/msm-firmware-loader/*.sh
./main/msm-firmware-loader/*.post-install
$(find . -path './main/postmarketos-ui-*/*.sh')
$(find . -path './main/postmarketos-ui-*/*.pre-install')
@@ -41,13 +39,12 @@ sh_files="
$(find . -name '*.trigger')
$(find . -path './main/devicepkg-dev/*.sh')
$(find . -path './main/postmarketos-mvcfg/*.sh')
$(find . -path './.ci/**.sh')
$(find . -path '**/tests/*.sh')
$(find . -path '.ci/*.sh')
"
for file in $sh_files; do
echo "Test with shellcheck: $file"
cd "$DIR/$(dirname "$file")"
shellcheck -S warning -e SC1008 -e SC3043 -x "$(basename "$file")"
cd "$DIR/../$(dirname "$file")"
shellcheck -e SC1008 -x "$(basename "$file")"
done
+41
View File
@@ -0,0 +1,41 @@
#!/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 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()))
+12 -19
View File
@@ -2,31 +2,24 @@
# 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
import pytest
import sys
import os
@pytest.fixture(scope="session", autouse=True)
@pytest.fixture
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.ccache = False
args.log = None
pmaports = os.path.realpath(f"{os.path.dirname(__file__)}/../..")
sys.argv = ["pmbootstrap",
"--aports", pmaports,
"--log", "$WORK/log_testsuite_pmaports.txt"
"chroot"]
args = pmb.parse.arguments()
init_args(args)
# Initialize logging
pmb.helpers.logging.init(args)
request.addfinalizer(pmb.helpers.logging.logfd.close)
return args
+60 -50
View File
@@ -1,126 +1,136 @@
#!/usr/bin/env python3
# Copyright 2024 Oliver Smith
# 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
import pmb.parse._apkbuild
from pmb.core.pkgrepo import pkgrepo_default_path, pkgrepo_iglob
from pmb.core.arch import Arch
# 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). """
# 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 == "mesa-dri-gallium":
raise RuntimeError(f"{path}: mesa-dri-gallium shouldn't be in"
" depends anymore (see pmaports!3478)")
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_device():
def test_aports_device(args):
"""
Various tests performed on the /device/*/device-* aports.
"""
for path in pkgrepo_iglob("device/*/device-*/APKBUILD"):
for path in glob.iglob(args.aports + "/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(f"Missing 'postmarketos-base' in depends of {path}")
if "postmarketos-base" not in apkbuild["depends"]:
raise RuntimeError("Missing 'postmarketos-base' in depends of " +
path)
# Depends: Must not have specific packages
# 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(device)
if Arch.from_str("".join(apkbuild["arch"])) != deviceinfo.arch:
raise RuntimeError("wrong architecture, please change to arch=\""
f"{deviceinfo.arch}\": {path}")
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(f"!archcheck missing in options= line: {path}")
raise RuntimeError("!archcheck missing in options= line: " + path)
if deviceinfo["flash_kernel_on_update"] == "true" \
and "postmarketos-update-kernel" not in apkbuild["depends"]:
raise RuntimeError(
"Deviceinfo indicates this device supports automatic kernel"
" flashing on update, but doesn't depend on"
" 'postmarketos-update-kernel'. Please add the missing"
" dependency.")
def test_aports_device_kernel():
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
"""
aports = pkgrepo_default_path()
# Iterate over device aports
for path in aports.glob("device/*/device-*/APKBUILD"):
for path in glob.glob(args.aports + "/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)
kernels_subpackages = pmb.parse._apkbuild.kernels(args, device)
# Parse kernels from depends
kernels_depends = []
for depend in apkbuild["depends"]:
if not depend.startswith("linux-") or depend.startswith("linux-firmware-"):
if not depend.startswith("linux-"):
continue
kernels_depends.append(depend)
# Kernel in subpackages *and* depends
if kernels_subpackages:
raise RuntimeError(f"Kernel package '{depend}' needs to"
raise RuntimeError("Kernel package '" + depend + "' needs to"
" be removed when using kernel" +
f" subpackages: {path}")
" 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}")
" 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}")
" <https://postmarketos.org/devicepkg>): " +
path)
# @pytest.mark.xfail # Not all aports have been updated yet
def test_aports_maintained():
def test_aports_maintained(args):
"""
Ensure that aports in /device/{main,community} have "Maintainer:" and
"Co-Maintainer:" (only required for main) listed in their APKBUILDs.
"""
for path in pkgrepo_iglob("device/main/*/APKBUILD"):
if 'firmware-' in path.parent.name:
for path in glob.iglob(f"{args.aports}/device/main/*/APKBUILD"):
if '/firmware-' in path:
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"
for path in pkgrepo_iglob("device/community/*/APKBUILD"):
if 'firmware-' in path.parent.name:
for path in glob.iglob(f"{args.aports}/device/community/*/APKBUILD"):
if '/firmware-' in path:
continue
maintainers = pmb.parse._apkbuild.maintainers(path)
assert maintainers, f"{path} in community needs at least 1 Maintainer"
def test_aports_archived():
def test_aports_unmaintained(args):
"""
Ensure that aports in /device/archived have an "Archived:" comment
that describes why the aport is archived.
Ensure that aports in /device/unmaintained have an "Unmaintained:" comment
that describes why the aport is unmaintained.
"""
for path in pkgrepo_iglob("device/archived/*/APKBUILD"):
archived = pmb.parse._apkbuild.archived(path)
assert archived, f"{path} should have an Archived: " +\
"comment that describes why the package is archived"
for path in glob.iglob(f"{args.aports}/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"
+30 -22
View File
@@ -2,49 +2,57 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import re
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_deviceinfo():
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
pattern = re.compile("^deviceinfo_[a-zA-Z0-9_]*=\".*\"(\\s*# .*)?$")
for folder in glob.glob(args.aports + "/device/*/device-*"):
device = folder[len(args.aports):].split("-", 1)[1]
for folder in pkgrepo_iglob("device/*/device-*"):
device = folder.name.split("-", 1)[1]
f = open(folder / "deviceinfo")
f = open(folder[len(args.aports):][1:] + "/deviceinfo")
lines = f.read().split("\n")
f.close()
try:
# variable can not be empty
for line in lines:
# Skip empty lines and comments
if not line or line.startswith("# "):
continue
# 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/malformed"
f" inline comment? {line}")
if '=""' in line:
raise RuntimeError("Please remove the empty variable: " + line)
# Successful deviceinfo parsing / obsolete options
info = pmb.parse.deviceinfo(device)
info = pmb.parse.deviceinfo(args, device)
deviceinfo_obsolete(info)
# deviceinfo_name must start with manufacturer
name = info.name
manufacturer = info.manufacturer
name = info["name"]
manufacturer = info["manufacturer"]
if not name.startswith(manufacturer) and \
not name.startswith("Google") and \
not name.startswith("Jolla"):
not name.startswith("Google"):
raise RuntimeError("Please add the manufacturer in front of"
" the deviceinfo_name, e.g.: '" +
manufacturer + " " + name + "'")
+9 -15
View File
@@ -6,12 +6,10 @@ import stat
expected_directories = [
"cross",
"device/archived",
"device/community",
"device/downstream",
"device/main",
"device/testing",
"extra-repos/systemd",
"device/unmaintained",
"main",
"modem",
"non-free",
@@ -30,9 +28,9 @@ def test_directories():
# Ensure no file in pmaports are executable.
# see https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/593.
# 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,20 +44,20 @@ def test_executable_files():
"m0755` or a variation thereof.")
# Make sure files belong to a package (below a directory with APKBUILD)
# Make sure files are either:
# - in root directory (README.md)
# - hidden (.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
# This allows matching files in subdirectories to the package directory.
package_dir = None
for dirpath, dirs, files in os.walk("."):
# Skip "hidden" directories (.ci/, device/.shared-patches/)
# Skip "hidden" directories
dirs[:] = [d for d in dirs if not d.startswith(".")]
# Ignore files in root directory (README.md)
# Ignore files in root directory
if dirpath == '.':
continue
# Ignore files under docs/
if dirpath.startswith('./docs'):
continue
# Switched to another directory?
if package_dir and not dirpath.startswith(package_dir + os.sep):
@@ -70,9 +68,5 @@ def test_files_belong_to_package():
"both contain an APKBUILD"
package_dir = dirpath
# Skip specific ".gitlab-ci.yml" files outside of usual structure
if dirpath in ["./cross"]:
files[:] = [f for f in files if f != ".gitlab-ci.yml"]
assert not files or package_dir, "Found files that do not belong to any package: " \
f"{dirpath}/{files}"
+7 -12
View File
@@ -2,33 +2,33 @@
# 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_iglob
def test_aports_firmware():
def test_aports_firmware(args):
"""
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-oneplus-sdm845", # 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-beryllium", # Depends on soc-qcom-sdm845-nonfree-firmware
"firmware-xiaomi-ferrari", # Depends on soc-qcom-msm8916
"firmware-xiaomi-willow", # Doesn't build, source link is dead (pma#1212)
"firmware-samsung-i9105p", # Depends on firmware-aosp-broadcom-wlan
]
for path in pkgrepo_iglob("**/firmware-*/APKBUILD", recursive=True):
for path in glob.iglob(f"{args.aports}/**/firmware-*/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(path)
aport_name = os.path.basename(path.parent)
aport_name = os.path.basename(os.path.dirname(path))
if aport_name not in excluded:
if "pmb:cross-native" not in apkbuild["options"]:
@@ -43,8 +43,3 @@ def test_aports_firmware():
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!")
+9 -5
View File
@@ -6,14 +6,18 @@
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():
def get_categorized_packages(args):
"""
Parse all aports and categorize them.
@@ -24,7 +28,7 @@ def get_categorized_packages():
"""
ret = {}
for path in pkgrepo_iter_package_dirs():
for path in glob.glob(args.aports + "/*/*/APKBUILD"):
# Parse APKBUILD
apkbuild = pmb.parse.apkbuild(path)
url = apkbuild["url"]
@@ -105,10 +109,10 @@ def check_categories(categories):
return ret
def test_framework_versions():
def test_framework_versions(args):
"""
Make sure that packages of the same framework have the same version.
"""
categories = get_categorized_packages()
categories = get_categorized_packages(args)
if not check_categories(categories):
raise RuntimeError("Framework version check failed!")
+12 -20
View File
@@ -2,25 +2,24 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import pytest
import sys
import os
import re
import add_pmbootstrap_to_import_path
import pmb.parse
from pmb.core.pkgrepo import pkgrepo_iglob, pkgrepo_relative_path
def test_aports_kernel():
def test_aports_kernel(args):
"""
Various tests performed on the /**/linux-* aports.
"""
for path in pkgrepo_iglob("**/linux-*/APKBUILD", recursive=True):
for path in glob.iglob(f"{args.aports}/**/linux-*/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(path)
aport_name = os.path.basename(os.path.dirname(path))
if aport_name == "linux-pam-pmos":
continue # This package isn't a linux kernel!
if "pmb:cross-native" not in apkbuild["options"]:
raise RuntimeError(f"{aport_name}: \"pmb:cross-native\" missing in"
" options= line")
@@ -35,16 +34,9 @@ def test_aports_kernel():
" 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.")
# nftables support in kernels used by main and community devices
for dir in ["main", "device/main", "device/community"]:
if path.startswith(f"{args.aports}/{dir}"):
assert pmb.parse.kconfig.check(args,
aport_name.replace("linux-", ""),
force_nftables_check=True)
-89
View File
@@ -1,89 +0,0 @@
#!/usr/bin/env python3
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import logging
import re
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}"):
# Valid version strings, per the APKBUILD reference, are fine. This regex
# attempts to detect those.
pattern = r'^\d+(\.\d+)*[a-z]?(_(?:alpha|beta|pre|rc|cvs|svn|git|hg|p)\d*)*-r\d+$'
[provide_no_ver, provide_ver] = provide.split("=", 1)
if not re.match(pattern, provide_ver):
error = f"error in , provide_ver{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"
error += f"\nVERSION: {provide_no_ver}"
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")
-158
View File
@@ -1,158 +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 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 in ["APKBUILD", "gitlab-ci.yml.j2"] or os.path.isdir(file):
continue
# Skip kernel fragments in linux-* packages
if os.path.basename(rel_file_path).endswith(".config") and apkbuild["pkgname"].startswith("linux-"):
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 \
and not rel_file_path.startswith("tests/"):
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}'")
-25
View File
@@ -1,25 +0,0 @@
#!/usr/bin/env python3
# Copyright 2025 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import logging
import os
import pmb.parse
from pmb.core.context import get_context
from pathlib import Path
def test_systemd_stage0_version():
"""Ensure systemd-stage0 and systemd have the same pkgver."""
# Don't clutter output with verbose APKBUILD parsing messages
logging.getLogger().setLevel(logging.DEBUG)
config = get_context().config
pma_systemd = os.path.join(config.aports[0], "extra-repos/systemd")
sd0 = pmb.parse.apkbuild(Path(os.path.join(pma_systemd, "systemd-stage0/APKBUILD")))
sd1 = pmb.parse.apkbuild(Path(os.path.join(pma_systemd, "systemd/APKBUILD")))
assert sd0["pkgver"] == sd1["pkgver"], (
f"systemd-stage0 pkgver ({sd0['pkgver']}) doesn't match systemd pkgver ({sd1['pkgver']})!"
)
+15 -22
View File
@@ -2,36 +2,30 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
from pathlib import Path
import glob
import pytest
import sys
import os
import common
import add_pmbootstrap_to_import_path
import pmb.parse
def test_aports_ui():
def test_aports_ui(args):
"""
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 common.get_changed_files():
path = Path(path)
if path.name != "APKBUILD":
continue
if not path.parent.name.startswith("postmarketos-ui"):
continue
for arch in pmb.config.build_device_architectures:
for path in glob.iglob(args.aports + "/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):
if not pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch, False):
continue
for package in apkbuild["_pmb_recommends"]:
depend = pmb.helpers.package.get(
package, arch, must_exist=False, try_other_arches=False
)
if depend is None:
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}'")
@@ -39,9 +33,8 @@ def test_aports_ui():
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, try_other_arches=False
)
if depend is None:
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}'")
+97
View File
@@ -0,0 +1,97 @@
#!/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
import pmb.parse._apkbuild
import pmb.parse.apkindex
import pmb.helpers.repo
def parse_source_from_checksums(args, 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: list of parsed "source" files, e.g.:
["first.patch", "second.patch"]
"""
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:
_, 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}")
# Find end
if filename.endswith('"'):
ret += [filename[:-1]]
break
ret += [filename]
return ret
def test_aports_unreferenced_files(args):
"""
Raise an error if an unreferenced file is found
"""
for apkbuild_path in glob.iglob(args.aports + "/**/APKBUILD", recursive=True):
apkbuild = pmb.parse.apkbuild(apkbuild_path)
sources_chk = parse_source_from_checksums(args, apkbuild_path)
# Collect install files from subpackages
subpackage_installs = []
if apkbuild["subpackages"]:
for subpackage in apkbuild["subpackages"].values():
if not subpackage:
continue
try:
subpackage_installs += subpackage["install"]
except KeyError:
continue
# Collect trigger files
trigger_sources = []
if apkbuild["triggers"]:
for trigger in apkbuild["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}")
-19
View File
@@ -1,19 +0,0 @@
#!/bin/sh -e
# Description: run unit-tests for packages
# https://postmarketos.org/pmb-ci
#
# This script only exists to allow running unit-tests locally.
# In actual CI the package tests/ subdir has it's own YAML
# fine defining a job which calls testlib for that package.
# This way we can run all the package unit-tests locally but
# have them be individual jobs in GitLab.
if [ "$(id -u)" = 0 ]; then
set -x
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
find . -type d -name "tests" | while read -r testdir; do
pkg="$(basename "$(dirname "$testdir")")"
.ci/lib/testlib.sh "$testdir" "$pkg"
done
-16
View File
@@ -1,16 +0,0 @@
#!/bin/sh -e
# Description: verify checksums of modified packages
# Options: native
# Use 'native' because it requires running pmbootstrap.
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
export PYTHONUNBUFFERED=1
.ci/lib/verify_checksums.py
-17
View File
@@ -1,17 +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 \
git \
python3
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
# shellcheck disable=SC2068
.ci/lib/check_devices_in_wiki.py --booting $@
-4
View File
@@ -1,4 +0,0 @@
{
"SpacesAftertabs": true,
"Exclude": ["temp"]
}
+1 -13
View File
@@ -7,20 +7,8 @@
# Top-most EditorConfig file.
root = true
[{**.{ini,sh,rules,nft},**/APKBUILD,CODEOWNERS}]
[**/APKBUILD]
indent_style = tab
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[**.md]
# No indent_size since space size has meaning in markdown
indent_style = space
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
# Forked from Alpine
[extra-repos/systemd/networkmanager/networkmanager.rules]
indent_style = space
indent_size = 4
-107
View File
@@ -1,107 +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
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="$2"
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
}
cleanup() {
[ -f "$_staged" ] && rm "$_staged"
}
trap cleanup EXIT
for apkbuild in $(changed_files '**/APKBUILD'); do
_staged="$(mktemp)"
git show ":$apkbuild" >"$_staged"
check_local_sources "$_staged" "${apkbuild%/*}"
cleanup
done
trap - EXIT
-72
View File
@@ -1,72 +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)
prefix=""
case "$lcp" in
extra-repos/systemd/systemd/*)
prefix="systemd"
;;
extra-repos/systemd/*)
prefix="systemd/$(echo "$lcp" | cut -d/ -f3)"
;;
device/*/*)
prefix="$(echo "$lcp" | cut -d/ -f3)"
;;
docs/*.adoc)
prefix="docs/$(basename $lcp .adoc)"
;;
docs/*)
prefix="docs"
;;
device/*)
# Multiple packages touched for same device category. More
# logic could be added to detect if they all belong to same
# device.
;;
[^.]*/*)
prefix="$(echo "$lcp" | cut -d/ -f1-2)"
;;
esac
if [ -n "$prefix" ]; then
prepend_msg "$prefix: "
fi
exit 0
+3 -6
View File
@@ -20,6 +20,7 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
@@ -65,9 +66,8 @@ instance/
# Scrapy stuff:
.scrapy
# Documentation
public
docs/packaging/device-packages/deviceinfo-reference.md
# Sphinx documentation
docs/_build/
# PyBuilder
target/
@@ -119,6 +119,3 @@ ENV/
# Allow having untracked packages in aports using a custom-something directory
/custom-*/
# child pipeline
.ci/build-jobs.yaml
+96 -224
View File
@@ -3,104 +3,74 @@
# global settings
image: alpine:latest
after_script:
- .ci/lib/move_logs.sh $CI_PROJECT_DIR
- .ci/move_logs.sh $CI_PROJECT_DIR
stages:
- lint
- prepare
- build
- autoupdate
- test
- deploy
variables:
# Default of 20 is pretty small, sometimes MRs have >20 commits in them. 100
# seems like a reasonable balance. If this is too low, git merge-base (from ci/
# common.py) can fail
GIT_DEPTH: 100
# So that anything that runs install_pmbootstrap and tries to import pmb module
# can find it.
PYTHONPATH: "/tmp/pmbootstrap"
# This defines the rules for when a pipeline should run.
workflow:
rules:
# Run for merge requests
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Some things have to run in the default branch
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Run scheduled pipeline for autoupdate or manually triggered pipeline
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"
# Some packages have their own yaml files defining tests. All of these should contain
# only jobs which extend the .package-test job!
include: "**/.gitlab-ci.yml"
# 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:
- v21.12
- merge_requests
- tags
# device documentation
wiki:
stage: lint
rules:
- if: &mr_rule $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- .ci/**/*
- .ci/build-jobs.yaml.j2
- .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
- .ci/check_devices_in_wiki.py --booting
# testcases linting
ruff:
testcases-linting:
stage: lint
rules:
- if: *mr_rule
changes:
- .ci/*
- .ci/*/*
- .ci/build-jobs.yaml.j2
- .gitlab-ci.yml
<<: *only-default
only:
refs:
- merge_requests
changes:
- .ci/*
- .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
# testcases typechecking
mypy:
# shellcheck
shellcheck:
stage: lint
rules:
- if: *mr_rule
changes:
- .ci/**/*
- .gitlab-ci.yml
<<: *only-default
image: alpine:edge
before_script:
- apk -q add shellcheck
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/mypy.sh
# shellcheck and various grep checks
shellcheck-grep:
stage: lint
rules:
- if: *mr_rule
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/shellcheck.sh
- .ci/grep.sh
editor-config:
stage: lint
rules:
- if: *mr_rule
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/ec.sh
# aports checks (generic)
pytest-commits:
aports-static:
stage: lint
rules:
- if: *mr_rule
<<: *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/check-changed-versions.sh
- su pmos -c ".ci/run_testcases.sh"
- su pmos -c ".ci/check_changed_aports_versions.py"
artifacts:
when: on_failure
paths:
@@ -109,176 +79,78 @@ 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:
# alpine:latest doesn't have the most recent atools-go, which means we would
# miss some linting rules that were added upstream. Use alpine:edge instead.
image: alpine:edge
stage: lint
rules:
- if: *mr_rule
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 ".ci/apkbuild-linting.py"
only:
- merge_requests
allow_failure: true
# deviceinfo linting
dint:
stage: lint
rules:
- if: *mr_rule
changes:
- .ci/**/*
- .gitlab-ci.yml
- device/*/device-*/deviceinfo
- deviceinfo_schema.toml
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/dint.sh
allow_failure:
exit_codes:
- 2 # returned by dint on non-fatal warning
# kernel kconfig check
kernel-kconfig:
stage: lint
rules:
- if: *mr_rule
changes:
- kconfigcheck.toml
allow_failure: true
- if: *mr_rule
changes:
- device/*/linux-*/config-*
only:
refs:
- v21.12
- 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
# Verify checksums
verify-checksums:
stage: lint
rules:
- if: *mr_rule
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/verify-checksums.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:
- apk -q add python3
script:
- wget -q "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/check_mr_settings.py"
- wget -q "https://gitlab.com/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
- python3 ./check_mr_settings.py
pmbootstrap minimum version:
stage: lint
rules:
- if: *mr_rule
changes:
- .ci/check-pmbootstrap-min-version.sh
- .gitlab-ci.yml
- pmaports.cfg
script:
- .ci/lib/gitlab_prepare_ci.sh
- .ci/check-pmbootstrap-min-version.sh
# Calculate build of changed aports using a dynamic downstream pipelines:
# https://docs.gitlab.com/ci/pipelines/downstream_pipelines/#dynamic-child-pipelines
# For those to work, we need two jobs:
# * First one (this one) that generates a valid yaml file with the job yaml as
# an artifact
# * Second one (build-jobs) that has a "trigger" key with the yaml file from
# which to trigger pipelines
# To avoid reworking the whole CI file, for now we are re-using this same file
# to trigger the downstream pipeline. In that case, $CI_PIPELINE_SOURCE will
# be set to "parent_pipeline", and only the jobs that extend .build will run
generate-build-jobs:
stage: prepare
before_script:
- .ci/lib/gitlab_prepare_ci.sh
needs: []
script:
- wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh py3-jinja2
# HACK: Make the pmb library happy to use the currently-cloned pmaports repo
- mkdir -p /root/.local/var/pmbootstrap/cache_git/ && ln -s $PWD /root/.local/var/pmbootstrap/cache_git/pmaports
- .ci/lib/generate_build_jobs.py
artifacts:
paths:
- .ci/build-jobs.yaml
rules:
- if: *mr_rule
build-jobs:
stage: build
trigger:
include:
- artifact: .ci/build-jobs.yaml
job: generate-build-jobs
strategy: depend
forward:
# So that we don't have to duplicate GIT_DEPTH
pipeline_variables: true
rules:
- if: *mr_rule
build-docs:
# build changed aports
.build:
stage: build
<<: *only-default
before_script:
- adduser -D build
- wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script:
- .ci/build-docs.sh
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- .ci/build-docs.sh
- deviceinfo_schema.toml
- docs/**
deploy-docs:
stage: deploy
trigger:
project: postmarketOS/docs.postmarketos.org
strategy: depend
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_NAMESPACE == "postmarketOS"
changes:
- deviceinfo_schema.toml
- docs/**
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
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
- .ci/build.sh
- cp -r /home/pmos/.local/var/pmbootstrap/packages/ packages/ || true
artifacts:
when: on_failure
expire_in: 1 week
paths:
- log.txt
- log_testsuite_pmaports.txt
- pmbootstrap.cfg
- packages/
# Template for package test jobs defined per-package
.package-test:
stage: test
rules:
- if: *mr_rule
before_script:
- .ci/lib/gitlab_prepare_ci.sh
build-x86_64:
extends: .build
build-aarch64:
extends: .build
build-armv7:
extends: .build
@@ -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"
-67
View File
@@ -1,67 +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 (`main` branch)
* [ ] `v25.12`
* [ ] `v26.06`
* [ ] I confirm that the issue still is present after running `sudo apk upgrade -a`
### On what environment did you encounter the issue?
#### Environments
* [ ] COSMIC
* [ ] GNOME Shell on Mobile
* [ ] Phosh (*Please attach the debug information of the Mobile settings app, see [this video](https://peertube.debian.social/w/4GwDjCJNcAmp8cb7dqXz1T) or use `phosh-mobile-settings -d`*)
* [ ] Plasma Mobile
* [ ] Sxmo (Wayland/Sway) **Please post the output of `sxmo_version.sh`**
* [ ] Other: **Please fill out**
### Which init system are you using?
* [ ] OpenRC
* [ ] systemd
### 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.
-->
@@ -1,15 +0,0 @@
<!-- Use this template to kick off the discussion for a package with (presumably)
inactive maintainers and the future for the maintainership of the package.
-->
### Information
* Package name:
* Maintainers of the package:
* MR that had no maintainer response, if applicable:
If the maintainers don't reply within two weeks of opening this issue, the
package is considered orphaned and, in the case of device packages, the devices
will be moved to the archived category.
/label ~maintainership-status
@@ -1,25 +0,0 @@
<!-- Use this template to notify community kernel maintainers that their
kernels are out-of-date and start the timer for moving them to testing.
Please title the issue:
Current community kernels not meeting version requirement (yyyy-mm-dd)
-->
Hi, as per our
[device categorization requirements for the community category](https://docs.postmarketos.org/pmaports/main/device-categorization.html#community),
devices in the community category may not use a kernel version older than 6
months.
As of today (yyyy-mm-dd), the following kernels do not meet this requirement:
* kernel-pkgname: kernel-pkgver, version-release-date (maintainers: @ ...)
This issue is an attempt to notify you (the maintainers) of the situation so
that you can update the packages. As per the rules, you have two weeks to
update the packages or reply with a request for more time, up to one month
of time from the moment this issue is opened. If that time passes and the
devices still no longer meet the requirements, they will be moved to testing.
/label ~"device-category::community"
/label ~kernel
/label ~"type::policy"
-29
View File
@@ -1,29 +0,0 @@
<!--
This template is for marking a postmarketOS stable release as EOL.
Name this issue "vYY.MM EOL".
-->
When the release has reached its EOL date:
- [ ] `postmarketos-base-ui`: let it depend on
`postmarketos-release-upgrade-notification` and bump pkgrel
- [ ] ensure it builds locally with pmbootstrap
- [ ] push it to the branch
- [ ] make sure bpo built and released the updated packages
- [ ] drop the old release from
[monitoring](https://gitlab.postmarketos.org/postmarketOS/monitoring)
- [ ] drop the "oldold -> old" release check from
[postmarketos-release-upgrade](https://gitlab.postmarketos.org/postmarketOS/postmarketos-release-upgrade/)
CI
- [ ] bpo: configure images so they don't get built for the old release anymore
- [ ] bpo: configure branches so we don't try to build packages for old
branches anymore
- e.g. on startup all branches are checked for new packages, we should keep
the amount of branches that get checked minimal
- [ ] pmaports.git channels.cfg: change description:
- "Old release (unsupported)"
- [ ] Update the [Releases](https://docs.postmarketos.org/pmaports/main/releases.html) page
- Move the release from active to old
- [ ] Consider removing images for the previous releases to save disk space
(people can build their own images with pmbootstrap if needed)
@@ -1,234 +0,0 @@
<!--
This template is for creating a new postmarketOS stable release.
Name this issue "vYY.MM Infrastructure".
-->
Person in charge of the release (doesn't have to do all the work, but has to
push it forward):
<!-- Put your usename here and assign yourself to this issue -->
### 0. Preparation
- [ ] Create the gitlab milestone for the release
- [ ] Add this infrastructure issue to the milestone
- [ ] Update the
[timeline](https://docs.postmarketos.org/policies-and-processes/development/releases/current-timeline.html)
for the next release
### 1. Pre-Build phase
This phase is to get some extra time for building packages. The branch will be rebased once in the branch phase.
#### Requirements
- [ ] Alpine's main repository must be built and published
- [ ] Alpine's community repository must be built and published
<small>Without this, bpo won't be able to build packages but steps before
that can be done already.</small>
#### pmbootstrap: adjust config
- [ ] Update `pmb/config/__init__.py:apk_tools_min_version`. This should be a
trivial change, push it directly to main.
- [ ] (can be done later, at start of test phase) make a new [pmbootstrap
release](https://wiki.postmarketos.org/wiki/Pmbootstrap_release) <small>bpo
uses the main branch, so it will be fine without a release, however users
will want to try out the new release and may not run main.</small>
#### pmaports: create branch and initial changes
- [ ] `git checkout -b vYY.MM main`
- [ ] Create a `=== Branch vYY.MM from main ===` commit
- Remove channels.cfg (should only be in main)
- Adjust `pmaports.cfg`: Change `channel=edge` to `channel=vYY.MM`
- Adjust `pmaports.cfg`: Change `supported_arches` to `x86_64,aarch64,armv7`
- Delete `.ci/build-*` scripts for other arches
<small>`pmbootstrap ci` reads these</small>
- [ ] `git push`
- [ ] Ensure the branch is protected in the
[repository settings](https://gitlab.postmarketos.org/postmarketOS/pmaports/-/settings/repository)
#### pmaports: update main branch
- [ ] `git checkout main`
- [ ] Add the new branch to
[channels.cfg](https://wiki.postmarketos.org/wiki/Channels.cfg_reference):
- [Example](https://gitlab.postmarketos.org/postmarketOS/pmaports/-/commit/c43571ceaf9b8155519bc9fb760bdeccd96e7e9c)
- Check if you need to set `branch_aports=master` initially if the stable
branch does not exist yet.
- [ ] `git push`
#### pmaports: update os-release / remove packages / aportgen
- [ ] `git checkout vYY.MM`
- [ ] Update `postmarketos-base`:
- [ ] Set version info for `/usr/lib/os-release` in
`main/postmarketos-base/rootfs-usr-lib-os-release`
(`PRETTY_NAME="postmarketOS vYY.MM"`, `VERSION_ID="vYY.MM"`,
`VERSION="vYY.MM"`)
- `pmbootstrap pkgrel_bump postmarketos-base`
- `pmbootstrap config mirrors.pmaports none`
- `pmbootstrap config mirrors.systemd none`
- `pmbootstrap checksum postmarketos-base`
- `git commit -s` (`Remove packages that we don't have in stable`)
- [ ] Remove packages:
- `cross/*-armhf` and other unsupported arches in cross dir (keep `gcc-x86` and `musl-dev-x86`, `systemd-boot-x86`)
- `gcc4*` and `gcc6*` from main and cross dirs
- `device/downstream`, `device/archived`
- `extra-repos/systemd/postmarketos-repo-nightly`
- [ ] Run `pmbootstrap aportgen` for packages in cross:
- `cd cross; PMB_APK_FORCE_MISSING_REPOSITORIES=1 pmbootstrap aportgen musl-* grub-efi-x86`
- `git commit -s` (`cross: regenerate for vYY.MM`)
- [ ] `git push`
#### bpo: adjust config
- [ ] Add the branch to the
[build.postmarketos.org](https://gitlab.postmarketos.org/postmarketOS/build.postmarketos.org)
config in `bpo/config/const/__init__.py:branches` below `branches["main"]`,
so it builds with lower priority than main until it's released. Set `ignore_errors` to `True`.
- [ ] Make a merge request, wait until CI passes, merge it (or if you can directly push to main that's also fine since it's a trivial change)
- [ ] Roll it out/ask somebody who can do that
- [ ] Restart bpo, it will start building `x86_64` packages
#### Bootstrap of binary packages
- [ ] Fix all failing `x86_64` packages (Remember: patches need to go through
edge first, then get backported to the stable branch!)
- Try to get build fixes merged to edge quickly, ask for reviews in
#postmarketos-devel, and consider merging trivial fixes right after they
pass CI.
- Devices in testing and archived categories that don't build: consider
trying to fix them, or just delete them from the branch
- [ ] Wait until all packages for `x86_64` (main repository, we don't need to
wait for the systemd repository before continuing) are built and
published
- [ ] Enable arm repositories in the BPO config
- [ ] Get all packages to build without errors
#### Wallpaper poll
- [ ] Team meeting: make a short list of 4 wallpapers from [the
pool](https://gitlab.postmarketos.org/postmarketOS/artwork/-/tree/main/wallpapers/2024)
- [ ] Make a poll on the wallpapers on mastodon
([example](https://fosstodon.org/@postmarketOS/113624366198561582))
- Make sure to thank the wallpaper authors (usually dikasp) for the amazing
work on the wallpapers
- Put the names of the wallpapers on top of the wallpapers for easier voting
and as alt text
- Create a comment with poll options
#### Adjust CI
- [ ] Make sure pmaports.git CI runs through on the new branch (run
`pmbootstrap ci`). Examples of why it might fail:
- One postmarketos-ui package has a package from alpine testing in their
_pmb_recommends.
- Remove the UI if it is not used much (can bring it back on demand) or
fork the package to the new branch
- Consider fixing it in edge, so we don't run into this with the next
release
- [ ] Adjust
[upstream-compat](https://gitlab.postmarketos.org/postmarketOS/continuous-testing/upstream-compat)
to run on the new release and make sure it passes
([example](https://gitlab.postmarketos.org/postmarketOS/continuous-testing/upstream-compat/-/merge_requests/10))
#### Adjust release upgrade script
- [ ] Add the new release to `upgrade.sh` in [postmarketos-release-upgrade](https://gitlab.postmarketos.org/postmarketOS/postmarketos-release-upgrade/)
- [ ] Bump `SCRIPT_VERSION`, tag a new release
- [ ] Package it for edge (make MR), backport it to the new release, but NOT to
the old release yet (otherwise users may upgrade by accident, without
realizing that the new version is not out yet!)
- [ ] Adjust CI of postmarketos-release-upgrade to test the new release too
(`git grep` for the previous release to see what needs to be adjusted)
#### Update the wallpaper
- [ ] Set the wallpaper that won in the poll in edge, backport this change to
the stable release branch
### 2. Branch phase
#### Rebase on main
- [ ] `git checkout vYY.MM`
- [ ] `git rebase -i origin/main`
- [ ] Temporarily enable force-push for the `vYY.MM` branch
- [ ] `git push --force-with-lease`
- [ ] Disable force-push for the `vYY.MM` branch again
#### Update BPO config
- [ ] Update bpo's images config to build images for the new branch for all
devices in community and main
- [ ] bpo: configure the new branch to be not WIP anymore
- [ ] Roll-out bpo changes
#### pmb release done?
- [ ] Ensure that a pmbootstrap release been made with the apk-tools min
version change
#### aports stable branch set?
* [ ] Check if a stable branch exists in `aports` for the new release, and that
it is being used in `channels.cfg` (might still be set to `master` if it
did not exist during the Pre-Branch phase).
### 3. Test phase
- [ ] Create an issue in pmaports with a checklist of devices and UIs in main
and community (see previous issue for reference)
- Tag the testers of each device and UI
- Ask to verify that the images work as expected
- Release upgrade script: when coming from the previous release, grab it from
main: `wget https://gitlab.postmarketos.org/postmarketOS/postmarketos-release-upgrade/-/raw/main/upgrade.sh`
- [ ] Announce the new phase in the testing chat - and ask them to do the
testing within one week, as in the timeline.
- Prioritize merging fixes from maintainers (they do the heavy lifting in the
testing and fixing phase, see timetable)
- Make sure to properly cherry pick fixes from MRs to edge, if they are
intended for the upcoming release
- [ ] Add new version to the pmaports gitlab issue template (.gitlab dir)
### 4. Release phase
- [ ] Did a reasonable amount of devices get tested? (we may consider dropping
devices that were not tested)
- [ ] Make sure all fixes are in
- [ ] Make sure new images are generated *with* the fixes (unless it's a fix
for something that doesn't impact the experience much and is fine to get with
the first update after installing)
- [ ] Announce the new phase in the testing chat, together with the planned
date of blog post release (and testing)
#### Write blog post
- [ ] Write a blog post for the new release in `postmarketos.org.git`:
- Look at the previous release blog post and try to make the new one
consistent with it
- Highlight major changes since the last release
(see the release notes issue)
- Mention new devices, and total list of devices
- Count devices that have their own wiki page as separate device
- E.g. OnePlus 6, 6T are two devices (two wiki pages), but variants of
"Samsung Galaxy A3 (2015)" are one device (one wiki page)
- Don't count/list devices for which we don't build images (e.g.
qemu-amd64)
- Adjust the homepage config to point to the new release in the downloads
page
- update `config/download.py`:
- `latest_release`
- update devices and categories. only list the ones where we actually build images.
- Add some cool photos
- Submit the blog post as MR to postmarketos.org.git.
- Let the blog post MR close the current release notes issue.
- Ask for reviews.
#### Release!
- [ ] Backport the new postmarketos-release-upgrade version that allows
upgrading to the new release, to the previous release (don't do this before
the release is tested and ready! During the testing phase, we can use
postmarketos-release-upgrade from main directly: `wget
https://gitlab.postmarketos.org/postmarketOS/postmarketos-release-upgrade/-/raw/main/upgrade.sh`)
- [ ] Add the branch to pkgs.postmarketos.org
- [ ] Merge the blog post
- [ ] Edit channels.cfg, change descriptions:
- New release: "Latest release / Recommended for best stability"
- Old release: "Old release (supported until YYYY-MM-DD)" (one month from date of the release)
- [ ] Create a milestone for the next release
- [ ] Create an issue for the next release notes and attach it to that milestone
- [ ] Update the [Releases](https://docs.postmarketos.org/pmaports/main/releases.html) page
- Move the new release to the list of active releases, link to the blog post
- Update the announcement and title for the release
- Add a new upcoming release below
- [ ] Update [Template:Latest stable release](https://wiki.postmarketos.org/wiki/Template:Latest_stable_release) on the wiki with the new version
- [ ] Update "Default description template for issues" in pmaports (.gitlab dir)
- In "On what postmarketOS version did you encounter the issue?", change:
- previous release: add " (supported until YYYY-MM-DD)"
- add the new release
- [ ] Put a reminder in recurring-admin-tasks to drop support for the old release
-7
View File
@@ -1,7 +0,0 @@
Casey Connolly <casey.connolly@linaro.org> <caleb.connolly@linaro.org>
Casey Connolly <kcxt@postmarketos.org> <caleb@postmarketos.org>
Achill Gilgenast <achill@achill.org> <fossdd@pwned.life>
Aelin <aelin@postmarketos.org> <adrian@postmarketos.org>
Aelin <aelin@postmarketos.org> <adrian@travitia.xyz>
Stefan Hansson <newbyte@postmarketos.org> <newbie13xd@gmail.com>
Stefan Hansson <newbyte@postmarketos.org> <newbyte@postmarketos.org>
+19
View File
@@ -0,0 +1,19 @@
{
"subject_format": {
"pass": [
"^[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+\\)|)$"
],
"unknown": [
"^[a-z-0-9_.*{}\\/]+: [a-z-0-9*{}\\(\\)\\.,_ ][A-Za-z\\/\\-0-9*{}\\(\\)\\.,_ ]+( \\(MR \\d+\\)|)$"
]
}
}
-1
View File
@@ -1 +0,0 @@
https://postmarketos.org/funding.json
+10
View File
@@ -0,0 +1,10 @@
# https://docs.gitlab.com/ee/user/project/code_owners.html
device/*/*-pine64-pinephone/ @craftyguy @milesalan @bshah @proycon @anjandev @StacyHarper
device/*/*-purism-librem5/ @craftyguy @bshah
main/osk-sdl/ @craftyguy
main/mesa-pvr-dri-classic/ @xc-racer99
main/postmarketos-ui-plasma-mobile/ @bshah
temp/u-boot-librem5/ @craftyguy @bshah
# vim: ts=4 sw=4 et
-102
View File
@@ -1,102 +0,0 @@
# Commit Style
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](https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/COMMITSTYLE.md)
with some minor exceptions and additions.
## 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
### Changes to packages inside of the systemd directory
We also shorten the prefixes for packages in `extra-repos/systemd`.
When the `systemd` package itself gets changed, use `systemd: ` as
prefix. For example:
systemd: add triggers for reloading/restarting services
When another package inside the systemd directory gets changed, use
`systemd/$pkgname: ` as prefix. For example:
systemd/cups: restart on upgrade
### 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 -19
View File
@@ -1,25 +1,8 @@
# postmarketOS aports repository
This repository contains the APKBUILD files for postmarketOS-specific packages, along with the required patches and scripts, if any.
There are many more packages defined in the [Alpine Linux aports](https://gitlab.alpinelinux.org/alpine/aports/) on which these packages depend.
# postmarketOS aports
Helpful resources:
* [Issues](https://gitlab.postmarketos.org/postmarketOS/pmaports/-/work_items)
* [How to create a package](https://wiki.postmarketos.org/wiki/Create_a_package)
* [APKBUILD reference](https://wiki.alpinelinux.org/wiki/APKBUILD_Reference)
* [pmaports commit style](./COMMITSTYLE.md)
* [Approval rules](docs/merge-requests/approval-rules.md)
* [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)
## Git Hooks
You can find some useful git hooks in the `.githooks` directory.
To use them, run the following command after cloning this repository:
```sh
git config --local core.hooksPath .githooks
```
* [postmarketOS package search](https://pkgs.postmarketos.org/packages)
-87
View File
@@ -1,87 +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=main
branch_aports=master
mirrordir_alpine=edge
[v26.06]
description=Upcoming stable release (DO NOT USE)
branch_pmaports=v26.06
branch_aports=3.24-stable
mirrordir_alpine=v3.24
[v25.12]
description=Latest release / Recommended for best stability
branch_pmaports=v25.12
branch_aports=3.23-stable
mirrordir_alpine=v3.23
[v25.06]
description=Old release (unsupported)
branch_pmaports=v25.06
branch_aports=3.22-stable
mirrordir_alpine=v3.22
[v24.12]
description=Old release (unsupported)
branch_pmaports=v24.12
branch_aports=3.21-stable
mirrordir_alpine=v3.21
[v24.06]
description=Old release (unsupported)
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
-21
View File
@@ -1,21 +0,0 @@
cross-gcc-tests:
extends: .package-test
tags: [qemu]
before_script:
- wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/main/install_pmbootstrap.sh"
- sh ./install_pmbootstrap.sh
script:
- su pmos -c "pmbootstrap build gcc-aarch64"
- su pmos -c "pmbootstrap build --arch=aarch64 hello-world --force"
- su pmos -c "pmbootstrap build --arch=aarch64 iskey --force"
- su pmos -c "pmbootstrap build --arch=aarch64 pbsplash --force"
- su pmos -c "pmbootstrap build --arch=aarch64 gcc-x86_64"
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- cross/gcc-x86_64/APKBUILD
artifacts:
when: always
paths:
- log.txt
expire_in: 1 week
+43
View File
@@ -0,0 +1,43 @@
# This package gets installed in the native and foreign arch chroots.
# It creates files like /usr/lib/arch-bin-masquerade/armhf/gcc, which
# point in the native chroot to the armhf-cross-compiler, and in the
# armhf chroot to /usr/bin/gcc. That way compilation works fine, even
# when distcc gets the absolute path to the compiler passed (ccache does
# that).
pkgname=arch-bin-masquerade
pkgver=2
pkgrel=0
pkgdesc="Wrappers for ccache + distcc (native and foreign chroots)"
url="https://postmarketOS.org"
arch="all"
license="MIT"
options="!check !tracedeps pmb:cross-native"
package() {
# Architectures and binaries
_archs="x86_64 armhf armv7 aarch64"
_bins="c++ cc cpp g++ gcc"
# Iterate over architectures
for _arch in $_archs; do
# Create the arch-specific bin folder
_hostspec="$(arch_to_hostspec $_arch)"
_bindir="$pkgdir/usr/lib/arch-bin-masquerade/$_arch"
mkdir -p "$_bindir"
cd "$_bindir"
# Iterate over binaries and create wrappers
for _bin in $_bins; do
{
echo "#!/bin/sh"
if [ "$_arch" == "$CARCH" ]; then
echo "exec /usr/bin/${_bin} \"\$@\""
else
echo "exec /usr/bin/${_hostspec}-${_bin} \"\$@\""
fi
} > "$_bin"
chmod +x "$_bin"
done
done
}
@@ -0,0 +1,55 @@
From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Tue, 21 Sep 2021 14:53:13 +0000
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
libraries"
This revert is needed to avoid wrongly tagging objects with the incompatible
IBM long double ABI, which is not supported by musl and will result in
linking errors if used.
This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
---
bfd/elf32-tic6x.c | 3 ---
ld/ldlang.c | 10 ++++------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 5754f3cb860..3ad1d612749 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
case Tag_ABI_PIC:
case Tag_ABI_PID:
- /* Don't transfer these tags from dynamic objects. */
- if ((ibfd->flags & DYNAMIC) != 0)
- continue;
if (out_attr[i].i > in_attr[i].i)
out_attr[i].i = in_attr[i].i;
break;
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 37b64c89ee1..f13beaef9d9 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -7071,13 +7071,11 @@ lang_check (void)
bfd_printable_name (input_bfd), input_bfd,
bfd_printable_name (link_info.output_bfd));
}
-
- /* If the input bfd has no contents, it shouldn't set the
- private data of the output bfd. */
- else if (!file->flags.just_syms
- && ((input_bfd->flags & DYNAMIC) != 0
- || bfd_count_sections (input_bfd) != 0))
+ else if (bfd_count_sections (input_bfd))
{
+ /* If the input bfd has no contents, it shouldn't set the
+ private data of the output bfd. */
+
bfd_error_handler_type pfn = NULL;
/* If we aren't supposed to warn about mismatched input
--
2.33.0
+84
View File
@@ -0,0 +1,84 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen binutils-aarch64
# Based on: main/binutils
pkgname=binutils-aarch64
pkgver=2.37
pkgrel=3
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
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
binutils-mips-disable-assert.patch
bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
defang-no-split.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
subpackages=""
fi
if [ "$CHOST" != "$CTARGET" ]; then
pkgname="binutils-$CTARGET_ARCH"
subpackages=""
sonameprefix="binutils:"
fi
# secfixes:
# 2.35.2-r1:
# - CVE-2021-3487
# 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
# remove files that conflict with non-cross binutils
rm -rf "$pkgdir"/usr/lib/bfd-plugins
}
sha512sums="
5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7 binutils-2.37.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
10a0074583d2cc4598710c7e434ba7088da074b105f4f5e951fc61af7150ad62adf60a7c98f6fd13b1771f169e45a5a1ef618240c6893d3f0f3d93fd768a03c6 bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
4652f092c9376f0cb7fd6c72cb37ff7c15c1c6e3408fac79329b7f41a7925c98eb35989a9a040682130988a36401901d6d95afa44f0ce50caa85ee478db6bf03 defang-no-split.patch
"
@@ -0,0 +1,234 @@
Upstream: yes
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=28138
From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 26 Jul 2021 05:59:55 -0700
Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
Close the file descriptor if there is no archive plugin file descriptor
to avoid running out of file descriptors on thin archives with many
archive members.
bfd/
PR ld/28138
* plugin.c (bfd_plugin_close_file_descriptor): Close the file
descriptor there is no archive plugin file descriptor.
ld/
PR ld/28138
* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
native build.
PR ld/28138
* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
* testsuite/ld-plugin/pr28138.c: New file.
* testsuite/ld-plugin/pr28138-1.c: Likewise.
* testsuite/ld-plugin/pr28138-2.c: Likewise.
* testsuite/ld-plugin/pr28138-3.c: Likewise.
* testsuite/ld-plugin/pr28138-4.c: Likewise.
* testsuite/ld-plugin/pr28138-5.c: Likewise.
* testsuite/ld-plugin/pr28138-6.c: Likewise.
* testsuite/ld-plugin/pr28138-7.c: Likewise.
(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
---
bfd/plugin.c | 8 +++++++
ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++
ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++
10 files changed, 104 insertions(+)
create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
create mode 100644 ld/testsuite/ld-plugin/pr28138.c
diff --git a/bfd/plugin.c b/bfd/plugin.c
index 6cfa2b66470..3bab8febe88 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
&& !bfd_is_thin_archive (abfd->my_archive))
abfd = abfd->my_archive;
+ /* Close the file descriptor if there is no archive plugin file
+ descriptor. */
+ if (abfd->archive_plugin_fd == -1)
+ {
+ close (fd);
+ return;
+ }
+
abfd->archive_plugin_fd_open_count--;
/* Dup the archive plugin file descriptor for later use, which
will be closed by _bfd_archive_close_and_cleanup. */
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index def69e43ab3..999d911ce6a 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
}
}
+run_cc_link_tests [list \
+ [list \
+ "Build pr28138.a" \
+ "-T" "" \
+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \
+ ] \
+ [list \
+ "Build pr28138.o" \
+ "" "" \
+ {pr28138.c} {} \
+ ] \
+]
+
+set exec_output [run_host_cmd "sh" \
+ "-c \"ulimit -n 20; \
+ $CC -Btmpdir/ld -o tmpdir/pr28138 \
+ tmpdir/pr28138.o tmpdir/pr28138.a\""]
+set exec_output [prune_warnings $exec_output]
+if [string match "" $exec_output] then {
+ if { [isnative] } {
+ set exec_output [run_host_cmd "tmpdir/pr28138" ""]
+ if [string match "PASS" $exec_output] then {
+ pass "PR ld/28138"
+ } else {
+ fail "PR ld/28138"
+ }
+ } else {
+ pass "PR ld/28138"
+ }
+} else {
+ fail "PR ld/28138"
+}
+
set testname "Build liblto-11.a"
remote_file host delete "tmpdir/liblto-11.a"
set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
new file mode 100644
index 00000000000..51d119e1642
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-1.c
@@ -0,0 +1,6 @@
+extern int a0(void);
+int
+a1(void)
+{
+ return 1 + a0();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
new file mode 100644
index 00000000000..1120cd797e9
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-2.c
@@ -0,0 +1,6 @@
+extern int a1(void);
+int
+a2(void)
+{
+ return 1 + a1();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
new file mode 100644
index 00000000000..ec464947ee6
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-3.c
@@ -0,0 +1,6 @@
+extern int a2(void);
+int
+a3(void)
+{
+ return 1 + a2();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
new file mode 100644
index 00000000000..475701b2c5c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-4.c
@@ -0,0 +1,6 @@
+extern int a3(void);
+int
+a4(void)
+{
+ return 1 + a3();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
new file mode 100644
index 00000000000..e24f86c363e
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-5.c
@@ -0,0 +1,6 @@
+extern int a4(void);
+int
+a5(void)
+{
+ return 1 + a4();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
new file mode 100644
index 00000000000..b5b938bdb21
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-6.c
@@ -0,0 +1,6 @@
+extern int a5(void);
+int
+a6(void)
+{
+ return 1 + a5();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
new file mode 100644
index 00000000000..4ef75bf0f0c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-7.c
@@ -0,0 +1,6 @@
+extern int a6(void);
+int
+a7(void)
+{
+ return 1 + a6();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
new file mode 100644
index 00000000000..68252c9f382
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+extern int a7(void);
+
+int
+a0(void)
+{
+ return 0;
+}
+
+int
+main()
+{
+ if (a7() == 7)
+ {
+ printf ("PASS\n");
+ return 0;
+ }
+ return 1;
+}
--
2.27.0
@@ -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}}
@@ -0,0 +1,14 @@
diff -urN binutils-2.35.2.orig/bfd/elfxx-mips.c binutils-2.35.2/bfd/elfxx-mips.c
--- binutils-2.35.2.orig/bfd/elfxx-mips.c 2021-01-30 01:38:03.000000000 -0700
+++ binutils-2.35.2/bfd/elfxx-mips.c 2021-05-13 17:35:34.706913601 -0600
@@ -6744,8 +6744,10 @@
in the relocation. */
if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
{
+#if 0
BFD_ASSERT (htab->root.target_os == is_vxworks
|| h->global_got_area != GGA_NONE);
+#endif
indx = h->root.dynindx;
if (SGI_COMPAT (output_bfd))
defined_p = h->root.def_regular;
@@ -0,0 +1,38 @@
From 2dad02b6d46eef438cbd14d8511487b056628a38 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <siarheit@google.com>
Date: Mon, 26 Jul 2021 22:51:18 +0100
Subject: [PATCH 1/1] texi2pod.pl: add no-op --no-split option support
[PR28144]
Change 2faf902da ("generate single html manual page by default")
added use of --no-split option to makeinfo. binutils reuses
makeinfo options for texi2pod.pl wrapper. Unsupported option
led to silent manpage truncation.
The change adds no-op option support.
etc/
PR 28144
* texi2pod.pl: Handle no-op --no-split option.
(cherry picked from commit 96a7037cd8573cf065aa6b12baca68696f96d9ca)
---
etc/texi2pod.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
index 11f70d156be..dcf2b437640 100644
--- a/etc/texi2pod.pl
+++ b/etc/texi2pod.pl
@@ -59,6 +59,8 @@ while ($_ = shift) {
$flag = shift;
}
push (@ipath, $flag);
+ } elsif (/^--no-split$/) {
+ # ignore option for makeinfo compatibility
} elsif (/^-/) {
usage();
} else {
--
2.27.0
+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
@@ -0,0 +1,55 @@
From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Tue, 21 Sep 2021 14:53:13 +0000
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
libraries"
This revert is needed to avoid wrongly tagging objects with the incompatible
IBM long double ABI, which is not supported by musl and will result in
linking errors if used.
This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
---
bfd/elf32-tic6x.c | 3 ---
ld/ldlang.c | 10 ++++------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 5754f3cb860..3ad1d612749 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
case Tag_ABI_PIC:
case Tag_ABI_PID:
- /* Don't transfer these tags from dynamic objects. */
- if ((ibfd->flags & DYNAMIC) != 0)
- continue;
if (out_attr[i].i > in_attr[i].i)
out_attr[i].i = in_attr[i].i;
break;
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 37b64c89ee1..f13beaef9d9 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -7071,13 +7071,11 @@ lang_check (void)
bfd_printable_name (input_bfd), input_bfd,
bfd_printable_name (link_info.output_bfd));
}
-
- /* If the input bfd has no contents, it shouldn't set the
- private data of the output bfd. */
- else if (!file->flags.just_syms
- && ((input_bfd->flags & DYNAMIC) != 0
- || bfd_count_sections (input_bfd) != 0))
+ else if (bfd_count_sections (input_bfd))
{
+ /* If the input bfd has no contents, it shouldn't set the
+ private data of the output bfd. */
+
bfd_error_handler_type pfn = NULL;
/* If we aren't supposed to warn about mismatched input
--
2.33.0
+84
View File
@@ -0,0 +1,84 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen binutils-armv7
# Based on: main/binutils
pkgname=binutils-armv7
pkgver=2.37
pkgrel=3
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
0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
binutils-mips-disable-assert.patch
bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
defang-no-split.patch
"
builddir="$srcdir/binutils-$pkgver"
if [ "$CHOST" = "$CBUILD" ] && [ "$CBUILD" = "$CTARGET" ] && [ "$CTARGET_ARCH" != "riscv64" ]; then
subpackages=""
fi
if [ "$CHOST" != "$CTARGET" ]; then
pkgname="binutils-$CTARGET_ARCH"
subpackages=""
sonameprefix="binutils:"
fi
# secfixes:
# 2.35.2-r1:
# - CVE-2021-3487
# 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
# remove files that conflict with non-cross binutils
rm -rf "$pkgdir"/usr/lib/bfd-plugins
}
sha512sums="
5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7 binutils-2.37.tar.xz
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch
f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488ea137f03e32d62efc878d95f018f836f8cec870bc448556f gold-mips.patch
314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch
70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch
10a0074583d2cc4598710c7e434ba7088da074b105f4f5e951fc61af7150ad62adf60a7c98f6fd13b1771f169e45a5a1ef618240c6893d3f0f3d93fd768a03c6 bfd-close-file-desriptor-if-there-is-no-archive-fd.patch
4652f092c9376f0cb7fd6c72cb37ff7c15c1c6e3408fac79329b7f41a7925c98eb35989a9a040682130988a36401901d6d95afa44f0ce50caa85ee478db6bf03 defang-no-split.patch
"
@@ -0,0 +1,234 @@
Upstream: yes
URL: https://sourceware.org/bugzilla/show_bug.cgi?id=28138
From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 26 Jul 2021 05:59:55 -0700
Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
Close the file descriptor if there is no archive plugin file descriptor
to avoid running out of file descriptors on thin archives with many
archive members.
bfd/
PR ld/28138
* plugin.c (bfd_plugin_close_file_descriptor): Close the file
descriptor there is no archive plugin file descriptor.
ld/
PR ld/28138
* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
native build.
PR ld/28138
* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
* testsuite/ld-plugin/pr28138.c: New file.
* testsuite/ld-plugin/pr28138-1.c: Likewise.
* testsuite/ld-plugin/pr28138-2.c: Likewise.
* testsuite/ld-plugin/pr28138-3.c: Likewise.
* testsuite/ld-plugin/pr28138-4.c: Likewise.
* testsuite/ld-plugin/pr28138-5.c: Likewise.
* testsuite/ld-plugin/pr28138-6.c: Likewise.
* testsuite/ld-plugin/pr28138-7.c: Likewise.
(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
---
bfd/plugin.c | 8 +++++++
ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++
ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++
ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++
10 files changed, 104 insertions(+)
create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
create mode 100644 ld/testsuite/ld-plugin/pr28138.c
diff --git a/bfd/plugin.c b/bfd/plugin.c
index 6cfa2b66470..3bab8febe88 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
&& !bfd_is_thin_archive (abfd->my_archive))
abfd = abfd->my_archive;
+ /* Close the file descriptor if there is no archive plugin file
+ descriptor. */
+ if (abfd->archive_plugin_fd == -1)
+ {
+ close (fd);
+ return;
+ }
+
abfd->archive_plugin_fd_open_count--;
/* Dup the archive plugin file descriptor for later use, which
will be closed by _bfd_archive_close_and_cleanup. */
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index def69e43ab3..999d911ce6a 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
}
}
+run_cc_link_tests [list \
+ [list \
+ "Build pr28138.a" \
+ "-T" "" \
+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \
+ ] \
+ [list \
+ "Build pr28138.o" \
+ "" "" \
+ {pr28138.c} {} \
+ ] \
+]
+
+set exec_output [run_host_cmd "sh" \
+ "-c \"ulimit -n 20; \
+ $CC -Btmpdir/ld -o tmpdir/pr28138 \
+ tmpdir/pr28138.o tmpdir/pr28138.a\""]
+set exec_output [prune_warnings $exec_output]
+if [string match "" $exec_output] then {
+ if { [isnative] } {
+ set exec_output [run_host_cmd "tmpdir/pr28138" ""]
+ if [string match "PASS" $exec_output] then {
+ pass "PR ld/28138"
+ } else {
+ fail "PR ld/28138"
+ }
+ } else {
+ pass "PR ld/28138"
+ }
+} else {
+ fail "PR ld/28138"
+}
+
set testname "Build liblto-11.a"
remote_file host delete "tmpdir/liblto-11.a"
set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
new file mode 100644
index 00000000000..51d119e1642
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-1.c
@@ -0,0 +1,6 @@
+extern int a0(void);
+int
+a1(void)
+{
+ return 1 + a0();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
new file mode 100644
index 00000000000..1120cd797e9
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-2.c
@@ -0,0 +1,6 @@
+extern int a1(void);
+int
+a2(void)
+{
+ return 1 + a1();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
new file mode 100644
index 00000000000..ec464947ee6
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-3.c
@@ -0,0 +1,6 @@
+extern int a2(void);
+int
+a3(void)
+{
+ return 1 + a2();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
new file mode 100644
index 00000000000..475701b2c5c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-4.c
@@ -0,0 +1,6 @@
+extern int a3(void);
+int
+a4(void)
+{
+ return 1 + a3();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
new file mode 100644
index 00000000000..e24f86c363e
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-5.c
@@ -0,0 +1,6 @@
+extern int a4(void);
+int
+a5(void)
+{
+ return 1 + a4();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
new file mode 100644
index 00000000000..b5b938bdb21
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-6.c
@@ -0,0 +1,6 @@
+extern int a5(void);
+int
+a6(void)
+{
+ return 1 + a5();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
new file mode 100644
index 00000000000..4ef75bf0f0c
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138-7.c
@@ -0,0 +1,6 @@
+extern int a6(void);
+int
+a7(void)
+{
+ return 1 + a6();
+}
diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
new file mode 100644
index 00000000000..68252c9f382
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr28138.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+extern int a7(void);
+
+int
+a0(void)
+{
+ return 0;
+}
+
+int
+main()
+{
+ if (a7() == 7)
+ {
+ printf ("PASS\n");
+ return 0;
+ }
+ return 1;
+}
--
2.27.0
@@ -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}}
@@ -0,0 +1,14 @@
diff -urN binutils-2.35.2.orig/bfd/elfxx-mips.c binutils-2.35.2/bfd/elfxx-mips.c
--- binutils-2.35.2.orig/bfd/elfxx-mips.c 2021-01-30 01:38:03.000000000 -0700
+++ binutils-2.35.2/bfd/elfxx-mips.c 2021-05-13 17:35:34.706913601 -0600
@@ -6744,8 +6744,10 @@
in the relocation. */
if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
{
+#if 0
BFD_ASSERT (htab->root.target_os == is_vxworks
|| h->global_got_area != GGA_NONE);
+#endif
indx = h->root.dynindx;
if (SGI_COMPAT (output_bfd))
defined_p = h->root.def_regular;
@@ -0,0 +1,38 @@
From 2dad02b6d46eef438cbd14d8511487b056628a38 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <siarheit@google.com>
Date: Mon, 26 Jul 2021 22:51:18 +0100
Subject: [PATCH 1/1] texi2pod.pl: add no-op --no-split option support
[PR28144]
Change 2faf902da ("generate single html manual page by default")
added use of --no-split option to makeinfo. binutils reuses
makeinfo options for texi2pod.pl wrapper. Unsupported option
led to silent manpage truncation.
The change adds no-op option support.
etc/
PR 28144
* texi2pod.pl: Handle no-op --no-split option.
(cherry picked from commit 96a7037cd8573cf065aa6b12baca68696f96d9ca)
---
etc/texi2pod.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl
index 11f70d156be..dcf2b437640 100644
--- a/etc/texi2pod.pl
+++ b/etc/texi2pod.pl
@@ -59,6 +59,8 @@ while ($_ = shift) {
$flag = shift;
}
push (@ipath, $flag);
+ } elsif (/^--no-split$/) {
+ # ignore option for makeinfo compatibility
} elsif (/^-/) {
usage();
} else {
--
2.27.0
+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
+36
View File
@@ -0,0 +1,36 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen busybox-static-aarch64
# Stub for apkbuild-lint
if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
pkgname=busybox-static-aarch64
pkgver=1.34.1
pkgrel=6
_arch="aarch64"
_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-v3.15.apk::$_mirror/v3.15/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-v3.15.apk
rm .PKGINFO .SIGN.*
}
sha512sums="
8c9251b0d81515e29a66ab037094e0a8107e4a0a64d680fe11bdb9cd1d418d2a1e610907cc423156cd5f759f83937230d24c7f03036bff81c57dc6f9759cf89e busybox-static-1.34.1-r6-aarch64-v3.15.apk
"
+36
View File
@@ -0,0 +1,36 @@
# Automatically generated aport, do not edit!
# Generator: pmbootstrap aportgen busybox-static-armv7
# Stub for apkbuild-lint
if [ -z "$(type -t arch_to_hostspec)" ]; then
arch_to_hostspec() { :; }
fi
pkgname=busybox-static-armv7
pkgver=1.34.1
pkgrel=6
_arch="armv7"
_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-v3.15.apk::$_mirror/v3.15/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-v3.15.apk
rm .PKGINFO .SIGN.*
}
sha512sums="
8761d49220d25c1fc6bbc8a69fd22cd1fce55c9c1606327af5bdaaba994960fed188d9694141c8000829ea53bf459fc625e48e7c4d93d63259ffa48ef1e02819 busybox-static-1.34.1-r6-armv7-v3.15.apk
"
+3 -3
View File
@@ -2,10 +2,10 @@
# compiling packages in the native chroot (e.g. kernel packages), the
# cross-compiler does not get called directly, but wrapped through
# ccache, which can then cache the results.
maintainer=""
pkgname=ccache-cross-symlinks
pkgver=3
pkgrel=3
pkgrel=0
pkgdesc="Enable ccache for cross-compilers with symlinks"
url="https://ccache.samba.org/"
arch="noarch"
@@ -15,7 +15,7 @@ options="!check"
package() {
# Keep in sync with pmb.config.build_device_architectures
local _archs="armhf armv7 aarch64 x86_64 x86 riscv64 ppc64le loongarch64"
local _archs="armhf armv7 aarch64 x86_64 x86"
local _bins="c++ cc cpp g++ gcc clang clang++"
mkdir -p "$pkgdir/usr/lib/ccache/bin"
+23 -75
View File
@@ -1,5 +1,3 @@
# https://docs.postmarketos.org/pmbootstrap/cross_compiling.html
#
# 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
@@ -11,33 +9,26 @@
# -> /native/usr/bin/rustc --target=armv6-alpine-linux-musleabihf ...
#
# When building packages in the armhf chroot, PATH will get prepended with
# "/native/usr/lib/crossdirect/armhf". The end game is of course invoking
# programs such as cross compilers and archivers from the native chroot,
# running at native speed, whenever they get called from the foreign arch
# chroot. See crossdirect.c for implementation details of the C version (llvm,
# fakeroot, rpath). The rust version and redirect for archivers are implemented
# as simple shell wrappers.
maintainer="Oliver Smith <ollieparanoid@postmarketos.org>"
# "/native/usr/lib/crossdirect/armhf". The end game is of course invoking the
# cross compiler from the native chroot, running at native speed, whenever
# calling the compiler from the foreign arch chroot. See crossdirect.c for
# implementation details of the C version (llvm, fakeroot, rpath). The rust
# version is implemented as simple shell wrappers.
pkgname=crossdirect
pkgver=5.3.1
pkgrel=1
pkgdesc="Wrappers to launch native programs (e.g. cross compilers) in foreign chroots"
pkgver=4
pkgrel=3
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
exec_native.sh
rust-qemu-linker.sh
rustc.sh
"
source="crossdirect.c rustc.sh rust-qemu-linker.sh"
build() {
cd "$srcdir"
# Architectures and binaries
_archs="x86_64 armhf armv7 aarch64 loongarch64 ppc64le riscv64"
_archs="x86_64 armhf armv7 aarch64"
for _arch in $_archs; do
[ "$_arch" == "$CARCH" ] && continue
_hostspec="$(arch_to_hostspec $_arch)"
@@ -49,52 +40,20 @@ build() {
-Werror \
-DHOSTSPEC="\"$_hostspec\"" \
crossdirect.c
# rustc
sed "s/@ARCH@/$_arch/g" rustc.sh >rustc-"$_arch"
done
}
package() {
# Architectures and binaries
_archs="
aarch64
armhf
armv7
loongarch64
ppc64le
riscv64
x86_64
"
_bin_compilers="
c++
cc
clang
clang++
cpp
g++
gcc
"
_bin_archivers="
bzip2
gunzip
gzip
lzip
lzma
lzop
pigz
unlzma
unpigz
unxz
unzip
xz
"
_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"
# For archivers
install -Dm755 "$srcdir/exec_native.sh" -t "$pkgdir/usr/lib/crossdirect/"
# Iterate over architectures
for _arch in $_archs; do
@@ -109,26 +68,15 @@ package() {
cp "$srcdir/crossdirect-$_arch" "./"
# GCC: create compiler symlinks
for _bin in $_bin_compilers; do
for _bin in $_bins; do
ln -s "crossdirect-$_arch" "$_bin"
ln -s "crossdirect-$_arch" "$_hostspec-$_bin"
done
# Archivers
for _bin in $_bin_archivers; do
ln -s ../exec_native.sh "$_bin"
done
# Rust
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
b2e602b7fc95ed403d29f0d754879d5f773c39ee33e726bb10cff17b3c088406dac84f2ca6d8ad563c64370007d98af805d6ee9cd4a06fe3d4c61c0cb90c5c0c crossdirect.c
73e2b5d2d8ef7c6002b3a787d14945586991493b8d81f59e5c0beda0d3b290543e1fdc6f288da726c5dd121c0861d2a894410b7b749a537df0df5b409e102330 exec_native.sh
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh
de2aa6929bbff5db9132673e667f4525b333d062cb1f7a0597dd924de9e5c7215a9f8e2e6263b6fb5ace06f2c4b64f4ebfd0ede9b78add07c2cd08ec8613e98f rustc.sh
"
sha512sums="500107e5aff8b34e74b54982ebcd447fc41bc8283956d506561b031a055cb30ec12698047c2604918b4b6d8560fe03db427a63dff2b83c907e8494b7f5233f29 crossdirect.c
6be16ba88720e628a3ecc8fa53f8e7a21d2af268b0509745d989139874d6b94b640bfcff09575eaa19073810be6ef91169c1f83e94f5cf8e6819f2670d9408de rustc.sh
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh"
Loaded 100 of 8638 files, more files were not shown because too many files have changed in this diff. Show more