From 7c7f5c73000f1202eaf6d502e18c027d65934798 Mon Sep 17 00:00:00 2001 From: Nikita Travkin Date: Fri, 27 Aug 2021 18:08:28 +0500 Subject: [PATCH] samsung-a3*: squash to a3, use msm-firmware-loader (MR 2431) Right now we have multiple variants of A3 that are only different in secure-boot keys and as such different firmware blobs. Use msm-firmware-loader to support all A3 variants with a single device port. Because of that, drop lte suffix as there are 3g variants as well. --- .../APKBUILD | 40 +++++++----- .../deviceinfo | 6 +- .../rootston.ini | 0 .../community/device-samsung-a3lte/deviceinfo | 37 ----------- .../community/device-samsung-a3ulte/APKBUILD | 65 ------------------- .../device-samsung-a3ulte/rootston.ini | 5 -- device/community/firmware-samsung-a3/APKBUILD | 34 ++++++++++ .../community/firmware-samsung-a3lte/APKBUILD | 37 ----------- .../firmware-samsung-a3ulte/APKBUILD | 37 ----------- 9 files changed, 63 insertions(+), 198 deletions(-) rename device/community/{device-samsung-a3lte => device-samsung-a3}/APKBUILD (52%) rename device/community/{device-samsung-a3ulte => device-samsung-a3}/deviceinfo (88%) rename device/community/{device-samsung-a3lte => device-samsung-a3}/rootston.ini (100%) delete mode 100644 device/community/device-samsung-a3lte/deviceinfo delete mode 100644 device/community/device-samsung-a3ulte/APKBUILD delete mode 100644 device/community/device-samsung-a3ulte/rootston.ini create mode 100644 device/community/firmware-samsung-a3/APKBUILD delete mode 100644 device/community/firmware-samsung-a3lte/APKBUILD delete mode 100644 device/community/firmware-samsung-a3ulte/APKBUILD diff --git a/device/community/device-samsung-a3lte/APKBUILD b/device/community/device-samsung-a3/APKBUILD similarity index 52% rename from device/community/device-samsung-a3lte/APKBUILD rename to device/community/device-samsung-a3/APKBUILD index 3da008ceb..9c08f0bf8 100644 --- a/device/community/device-samsung-a3lte/APKBUILD +++ b/device/community/device-samsung-a3/APKBUILD @@ -1,10 +1,11 @@ # Reference: -# Maintainer: Nikita Travkin +# Maintainer: Mis012 +# Co-Maintainer: Nikita Travkin # Co-Maintainer: Minecrell -pkgname=device-samsung-a3lte -pkgdesc="Samsung Galaxy A3 (SM-A300F)" -pkgver=4 -pkgrel=1 +pkgname=device-samsung-a3 +pkgdesc="Samsung Galaxy A3 (2015)" +pkgver=5 +pkgrel=0 url="https://postmarketos.org" license="MIT" arch="aarch64" @@ -16,10 +17,14 @@ subpackages=" $pkgname-kernel-mainline:kernel_mainline $pkgname-kernel-mainline-modem:kernel_mainline_modem $pkgname-nonfree-firmware:nonfree_firmware - $pkgname-nonfree-firmware-modem:nonfree_firmware_modem $pkgname-phosh " +# Backwards compatibility for old device package names +_substitutes="device-samsung-a3lte device-samsung-a3ulte" +replaces="$_substitutes" +for pkg in $replaces; do provides="$provides $pkg=$pkgver-r$pkgrel"; done + build() { devicepkg_build $startdir $pkgname } @@ -31,35 +36,40 @@ package() { kernel_mainline() { pkgdesc="Close to mainline kernel (no modem, audio routed directly)" depends="linux-postmarketos-qcom-msm8916" + replaces="" + for pkg in $_substitutes; do replaces="$replaces $pkg-kernel-mainline"; done + for pkg in $replaces; do provides="$provides $pkg=$pkgver-r$pkgrel"; done devicepkg_subpackage_kernel $startdir $pkgname $subpkgname } kernel_mainline_modem() { pkgdesc="Close to mainline kernel (non-free modem, audio routed through ADSP)" depends="linux-postmarketos-qcom-msm8916 soc-qcom-msm8916-modem" + replaces="" + for pkg in $_substitutes; do replaces="$replaces $pkg-kernel-mainline-modem"; done + for pkg in $replaces; do provides="$provides $pkg=$pkgver-r$pkgrel"; done devicepkg_subpackage_kernel $startdir $pkgname $subpkgname } nonfree_firmware() { pkgdesc="GPU/WiFi/BT/Video(/Modem) firmware" - depends="linux-firmware-qcom firmware-samsung-a3lte-venus firmware-samsung-a3lte-wcnss" - mkdir "$subpkgdir" -} - -nonfree_firmware_modem() { - pkgdesc="Modem firmware" - depends="firmware-samsung-a3lte-modem" - install_if="$pkgname-nonfree-firmware $pkgname-kernel-mainline-modem" + depends="linux-firmware-qcom msm-firmware-loader firmware-samsung-a3-wcnss-nv" + replaces="" + for pkg in $_substitutes; do replaces="$replaces $pkg-nonfree-firmware"; done + for pkg in $replaces; do provides="$provides $pkg=$pkgver-r$pkgrel"; done mkdir "$subpkgdir" } phosh() { + replaces="" + for pkg in $_substitutes; do replaces="$replaces $pkg-phosh"; done + for pkg in $replaces; do provides="$provides $pkg=$pkgver-r$pkgrel"; done install_if="$pkgname postmarketos-ui-phosh" install -Dm644 "$srcdir"/rootston.ini \ "$subpkgdir"/etc/phosh/rootston.ini } sha512sums=" -4523b6cd9961fba4a7213c33332172e71fbc3181ca2cd9970fc486d4c6fee831da76a5266f7829ec83da6eb7925093000804892ea7aadf8d9a3a5ad03c1cc7f9 deviceinfo +35999e456ef4035d5ec67f04b159f830fa2ffff6f815925714b8a47d10cd0eb245207b1551808521786657403b1140ddc649c7f15b18ad6091fcbd31f53ee275 deviceinfo f3667b914bb955be9e97db31dc7ed4a7c5d0c369be9549d587bb7208e270590c0c3fa36a0dd997d6f8305c5c9afb3b906423af6ca8724e806f995e61226cfc83 rootston.ini " diff --git a/device/community/device-samsung-a3ulte/deviceinfo b/device/community/device-samsung-a3/deviceinfo similarity index 88% rename from device/community/device-samsung-a3ulte/deviceinfo rename to device/community/device-samsung-a3/deviceinfo index 4bd49d9d2..8ea376446 100644 --- a/device/community/device-samsung-a3ulte/deviceinfo +++ b/device/community/device-samsung-a3/deviceinfo @@ -2,10 +2,12 @@ # Please use double quotes only. You can source this file in shell scripts. deviceinfo_format_version="0" -deviceinfo_name="Samsung Galaxy A3 (SM-A300FU)" +deviceinfo_name="Samsung Galaxy A3 (2015)" deviceinfo_manufacturer="Samsung" -deviceinfo_codename="samsung-a3ulte" +deviceinfo_codename="samsung-a3" deviceinfo_year="2014" + +# All A3 variants seem to use mostly the same hardware so using a3u-eur works. deviceinfo_dtb_mainline="qcom/msm8916-samsung-a3u-eur" deviceinfo_dtb_mainline_modem="qcom/msm8916-samsung-a3u-eur-modem" deviceinfo_append_dtb="true" diff --git a/device/community/device-samsung-a3lte/rootston.ini b/device/community/device-samsung-a3/rootston.ini similarity index 100% rename from device/community/device-samsung-a3lte/rootston.ini rename to device/community/device-samsung-a3/rootston.ini diff --git a/device/community/device-samsung-a3lte/deviceinfo b/device/community/device-samsung-a3lte/deviceinfo deleted file mode 100644 index 8904e9cae..000000000 --- a/device/community/device-samsung-a3lte/deviceinfo +++ /dev/null @@ -1,37 +0,0 @@ -# Reference: -# Please use double quotes only. You can source this file in shell scripts. - -deviceinfo_format_version="0" -deviceinfo_name="Samsung Galaxy A3 (SM-A300F)" -deviceinfo_manufacturer="Samsung" -deviceinfo_codename="samsung-a3lte" -deviceinfo_year="2014" - -# Eventually this should be replaced with a special DTB for a3lte. -# However, the differences are minimal, so for now a3u-eur works fine. -deviceinfo_dtb_mainline="qcom/msm8916-samsung-a3u-eur" -deviceinfo_dtb_mainline_modem="qcom/msm8916-samsung-a3u-eur-modem" -deviceinfo_append_dtb="true" -deviceinfo_modules_initfs="panel-samsung-s6e88a0-ams452ef01 msm zinitix" -deviceinfo_arch="aarch64" - -# Device related -deviceinfo_gpu_accelerated="true" -deviceinfo_chassis="handset" -deviceinfo_keyboard="false" -deviceinfo_external_storage="true" -deviceinfo_screen_width="540" -deviceinfo_screen_height="960" -deviceinfo_getty="ttyMSM0;115200" - -# Bootloader related -deviceinfo_flash_method="fastboot" -deviceinfo_kernel_cmdline="earlycon console=ttyMSM0,115200 PMOS_NO_OUTPUT_REDIRECT" -deviceinfo_generate_bootimg="true" -deviceinfo_flash_offset_base="0x80000000" -deviceinfo_flash_offset_kernel="0x00080000" -deviceinfo_flash_offset_ramdisk="0x02000000" -deviceinfo_flash_offset_second="0x00f00000" -deviceinfo_flash_offset_tags="0x01e00000" -deviceinfo_flash_pagesize="2048" -deviceinfo_flash_sparse="true" diff --git a/device/community/device-samsung-a3ulte/APKBUILD b/device/community/device-samsung-a3ulte/APKBUILD deleted file mode 100644 index 7e8dd7b1d..000000000 --- a/device/community/device-samsung-a3ulte/APKBUILD +++ /dev/null @@ -1,65 +0,0 @@ -# Reference: -# Maintainer: Mis012 -# Co-Maintainer: Minecrell -pkgname=device-samsung-a3ulte -pkgdesc="Samsung Galaxy A3 (SM-A300FU)" -pkgver=4 -pkgrel=1 -url="https://postmarketos.org" -license="MIT" -arch="aarch64" -options="!check !archcheck" -depends="postmarketos-base mkbootimg soc-qcom-msm8916" -makedepends="devicepkg-dev" -source="deviceinfo rootston.ini" -subpackages=" - $pkgname-kernel-mainline:kernel_mainline - $pkgname-kernel-mainline-modem:kernel_mainline_modem - $pkgname-nonfree-firmware:nonfree_firmware - $pkgname-nonfree-firmware-modem:nonfree_firmware_modem - $pkgname-phosh -" - -build() { - devicepkg_build $startdir $pkgname -} - -package() { - devicepkg_package $startdir $pkgname -} - -kernel_mainline() { - pkgdesc="Close to mainline kernel (no modem, audio routed directly)" - depends="linux-postmarketos-qcom-msm8916" - devicepkg_subpackage_kernel $startdir $pkgname $subpkgname -} - -kernel_mainline_modem() { - pkgdesc="Close to mainline kernel (non-free modem, audio routed through ADSP)" - depends="linux-postmarketos-qcom-msm8916 soc-qcom-msm8916-modem" - devicepkg_subpackage_kernel $startdir $pkgname $subpkgname -} - -nonfree_firmware() { - pkgdesc="GPU/WiFi/BT/Video(/Modem) firmware" - depends="linux-firmware-qcom firmware-samsung-a3ulte-venus firmware-samsung-a3ulte-wcnss" - mkdir "$subpkgdir" -} - -nonfree_firmware_modem() { - pkgdesc="Modem firmware" - depends="firmware-samsung-a3ulte-modem" - install_if="$pkgname-nonfree-firmware $pkgname-kernel-mainline-modem" - mkdir "$subpkgdir" -} - -phosh() { - install_if="$pkgname postmarketos-ui-phosh" - install -Dm644 "$srcdir"/rootston.ini \ - "$subpkgdir"/etc/phosh/rootston.ini -} - -sha512sums=" -f8bd5e99aa20b0e3e10168bd71d5a142f53cf2ce839c8531f4dbc43224d5ee2155377e41610f5668507d24571e61904f281c59df310e23f56943c24eb116b81e deviceinfo -94c866b6583faadc4a96a4d737983ba7838ede52afa5e29e261ef0ad0f2afe29fd3b793c9208ae74c7d48db6b991ad21800b9e457fbba4c69ce9dec2cda268ea rootston.ini -" diff --git a/device/community/device-samsung-a3ulte/rootston.ini b/device/community/device-samsung-a3ulte/rootston.ini deleted file mode 100644 index db46e94c0..000000000 --- a/device/community/device-samsung-a3ulte/rootston.ini +++ /dev/null @@ -1,5 +0,0 @@ -[cursor:seat0] -map-to-output:DSI-1 - -[output:DSI-1] -scale = 1.5 diff --git a/device/community/firmware-samsung-a3/APKBUILD b/device/community/firmware-samsung-a3/APKBUILD new file mode 100644 index 000000000..4f7ea337e --- /dev/null +++ b/device/community/firmware-samsung-a3/APKBUILD @@ -0,0 +1,34 @@ +pkgname=firmware-samsung-a3 +pkgver=1 +pkgrel=0 +_name="Samsung Galaxy A3 (2015)" +pkgdesc="Firmware for $_name" +url="https://postmarketos.org" +subpackages="$pkgname-wcnss-nv:wcnss_nv" +arch="aarch64" +license="proprietary" +options="!check !strip !archcheck !tracedeps pmb:cross-native" +source="$pkgname-WCNSS_qcom_wlan_nv.bin.base64::https://pastebin.com/raw/X3t8q7ue" + +_fwdir="/lib/firmware/postmarketos" + +unpack() { + default_unpack + base64 -d $pkgname-WCNSS_qcom_wlan_nv.bin.base64 > WCNSS_qcom_wlan_nv.bin +} + +package() { + # parent package is empty + mkdir -p "$pkgdir" +} + +wcnss_nv() { + pkgdesc="$_name WiFi/BT firmware configuration" + replaces="firmware-samsung-a3lte-wcnss firmware-samsung-a3ulte-wcnss" + install -Dm644 "$srcdir"/WCNSS_qcom_wlan_nv.bin -t "$subpkgdir/$_fwdir"/wlan/prima +} + + +sha512sums=" +54728ddc81b12afe532ce3299a8a6779d2c1553c4e33aa43a8e0e14611fc095a753c33b1edaac90b4c7d104fcdac8929986567560d79023549641d02b8f072e7 firmware-samsung-a3-WCNSS_qcom_wlan_nv.bin.base64 +" diff --git a/device/community/firmware-samsung-a3lte/APKBUILD b/device/community/firmware-samsung-a3lte/APKBUILD deleted file mode 100644 index 09921fa5c..000000000 --- a/device/community/firmware-samsung-a3lte/APKBUILD +++ /dev/null @@ -1,37 +0,0 @@ -pkgname=firmware-samsung-a3lte -pkgver=1 -pkgrel=0 -pkgdesc="Firmware for Samsung Galaxy A3 (SM-A300F)" -url="https://rizzotherat.gitlab.io/firmware/" -subpackages="$pkgname-modem $pkgname-venus $pkgname-wcnss" -arch="aarch64" -license="proprietary" -options="!check !strip !archcheck !tracedeps pmb:cross-native" -source="https://pepethekingprawn.gitlab.io/firmware/SM-A300F.tar.xz" - -_fwdir="/lib/firmware/postmarketos" - -package() { - # parent package is empty - mkdir -p "$pkgdir" -} - -modem() { - pkgdesc="Samsung Galaxy A3 (SM-A300F) modem firmware" - install -Dm644 "$srcdir"/mba.mbn -t "$subpkgdir/$_fwdir" - install -Dm644 "$srcdir"/modem.* -t "$subpkgdir/$_fwdir" -} - -venus() { - pkgdesc="Samsung Galaxy A3 (SM-A300F) video firmware" - install -Dm644 "$srcdir"/venus.* -t "$subpkgdir/$_fwdir"/qcom/venus-1.8 -} - -wcnss() { - pkgdesc="Samsung Galaxy A3 (SM-A300F) WiFi/BT firmware" - cd "$srcdir" - install -Dm644 wcnss.* -t "$subpkgdir/$_fwdir" - install -Dm644 WCNSS_* -t "$subpkgdir/$_fwdir"/wlan/prima -} - -sha512sums="7aeeeca56f629589a02434f6e24ac141139d1080fae369864450917fb3ad2bc8a64803201e9771ff932bf79a379207772b975fc4c184561338e87213093380df SM-A300F.tar.xz" diff --git a/device/community/firmware-samsung-a3ulte/APKBUILD b/device/community/firmware-samsung-a3ulte/APKBUILD deleted file mode 100644 index f0e9f1bef..000000000 --- a/device/community/firmware-samsung-a3ulte/APKBUILD +++ /dev/null @@ -1,37 +0,0 @@ -pkgname=firmware-samsung-a3ulte -pkgver=2 -pkgrel=0 -pkgdesc="Firmware for Samsung Galaxy A3 (SM-A300FU)" -url="https://rizzotherat.gitlab.io/firmware/" -subpackages="$pkgname-modem $pkgname-venus $pkgname-wcnss" -arch="aarch64" -license="proprietary" -options="!check !strip !archcheck !tracedeps pmb:cross-native" -source="https://rizzotherat.gitlab.io/firmware/SM-A300FU.tar.xz" - -_fwdir="/lib/firmware/postmarketos" - -package() { - # parent package is empty - mkdir -p "$pkgdir" -} - -modem() { - pkgdesc="Samsung Galaxy A3 (SM-A300FU) modem firmware" - install -Dm644 "$srcdir"/mba.mbn -t "$subpkgdir/$_fwdir" - install -Dm644 "$srcdir"/modem.* -t "$subpkgdir/$_fwdir" -} - -venus() { - pkgdesc="Samsung Galaxy A3 (SM-A300FU) video firmware" - install -Dm644 "$srcdir"/venus.* -t "$subpkgdir/$_fwdir"/qcom/venus-1.8 -} - -wcnss() { - pkgdesc="Samsung Galaxy A3 (SM-A300FU) WiFi/BT firmware" - cd "$srcdir" - install -Dm644 wcnss.* -t "$subpkgdir/$_fwdir" - install -Dm644 WCNSS_* -t "$subpkgdir/$_fwdir"/wlan/prima -} - -sha512sums="911907209993639aaf19d09dc946edc96c86e660f936c58b4c0deeddbe1ac5d8a5404db4db78cbae9c619a3e93515460bb420a8487e0ded9efcd12da01689a08 SM-A300FU.tar.xz"