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.
This commit is contained in:
Nikita Travkin 2021-08-27 18:08:28 +05:00 committed by Alexey Minnekhanov
parent b23163daf0
commit 7c7f5c7300
No known key found for this signature in database
GPG key ID: 6FE3B029D9D9FAFF
9 changed files with 63 additions and 198 deletions

View file

@ -1,10 +1,11 @@
# Reference: <https://postmarketos.org/devicepkg> # Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Nikita Travkin <nikitos.tr@gmail.com> # Maintainer: Mis012 <Michael.Srba@seznam.cz>
# Co-Maintainer: Nikita Travkin <nikita@trvn.ru>
# Co-Maintainer: Minecrell <minecrell@minecrell.net> # Co-Maintainer: Minecrell <minecrell@minecrell.net>
pkgname=device-samsung-a3lte pkgname=device-samsung-a3
pkgdesc="Samsung Galaxy A3 (SM-A300F)" pkgdesc="Samsung Galaxy A3 (2015)"
pkgver=4 pkgver=5
pkgrel=1 pkgrel=0
url="https://postmarketos.org" url="https://postmarketos.org"
license="MIT" license="MIT"
arch="aarch64" arch="aarch64"
@ -16,10 +17,14 @@ subpackages="
$pkgname-kernel-mainline:kernel_mainline $pkgname-kernel-mainline:kernel_mainline
$pkgname-kernel-mainline-modem:kernel_mainline_modem $pkgname-kernel-mainline-modem:kernel_mainline_modem
$pkgname-nonfree-firmware:nonfree_firmware $pkgname-nonfree-firmware:nonfree_firmware
$pkgname-nonfree-firmware-modem:nonfree_firmware_modem
$pkgname-phosh $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() { build() {
devicepkg_build $startdir $pkgname devicepkg_build $startdir $pkgname
} }
@ -31,35 +36,40 @@ package() {
kernel_mainline() { kernel_mainline() {
pkgdesc="Close to mainline kernel (no modem, audio routed directly)" pkgdesc="Close to mainline kernel (no modem, audio routed directly)"
depends="linux-postmarketos-qcom-msm8916" 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 devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
} }
kernel_mainline_modem() { kernel_mainline_modem() {
pkgdesc="Close to mainline kernel (non-free modem, audio routed through ADSP)" pkgdesc="Close to mainline kernel (non-free modem, audio routed through ADSP)"
depends="linux-postmarketos-qcom-msm8916 soc-qcom-msm8916-modem" 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 devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
} }
nonfree_firmware() { nonfree_firmware() {
pkgdesc="GPU/WiFi/BT/Video(/Modem) firmware" pkgdesc="GPU/WiFi/BT/Video(/Modem) firmware"
depends="linux-firmware-qcom firmware-samsung-a3lte-venus firmware-samsung-a3lte-wcnss" depends="linux-firmware-qcom msm-firmware-loader firmware-samsung-a3-wcnss-nv"
mkdir "$subpkgdir" replaces=""
} for pkg in $_substitutes; do replaces="$replaces $pkg-nonfree-firmware"; done
for pkg in $replaces; do provides="$provides $pkg=$pkgver-r$pkgrel"; done
nonfree_firmware_modem() {
pkgdesc="Modem firmware"
depends="firmware-samsung-a3lte-modem"
install_if="$pkgname-nonfree-firmware $pkgname-kernel-mainline-modem"
mkdir "$subpkgdir" mkdir "$subpkgdir"
} }
phosh() { 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_if="$pkgname postmarketos-ui-phosh"
install -Dm644 "$srcdir"/rootston.ini \ install -Dm644 "$srcdir"/rootston.ini \
"$subpkgdir"/etc/phosh/rootston.ini "$subpkgdir"/etc/phosh/rootston.ini
} }
sha512sums=" sha512sums="
4523b6cd9961fba4a7213c33332172e71fbc3181ca2cd9970fc486d4c6fee831da76a5266f7829ec83da6eb7925093000804892ea7aadf8d9a3a5ad03c1cc7f9 deviceinfo 35999e456ef4035d5ec67f04b159f830fa2ffff6f815925714b8a47d10cd0eb245207b1551808521786657403b1140ddc649c7f15b18ad6091fcbd31f53ee275 deviceinfo
f3667b914bb955be9e97db31dc7ed4a7c5d0c369be9549d587bb7208e270590c0c3fa36a0dd997d6f8305c5c9afb3b906423af6ca8724e806f995e61226cfc83 rootston.ini f3667b914bb955be9e97db31dc7ed4a7c5d0c369be9549d587bb7208e270590c0c3fa36a0dd997d6f8305c5c9afb3b906423af6ca8724e806f995e61226cfc83 rootston.ini
" "

View file

@ -2,10 +2,12 @@
# Please use double quotes only. You can source this file in shell scripts. # Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0" deviceinfo_format_version="0"
deviceinfo_name="Samsung Galaxy A3 (SM-A300FU)" deviceinfo_name="Samsung Galaxy A3 (2015)"
deviceinfo_manufacturer="Samsung" deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-a3ulte" deviceinfo_codename="samsung-a3"
deviceinfo_year="2014" 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="qcom/msm8916-samsung-a3u-eur"
deviceinfo_dtb_mainline_modem="qcom/msm8916-samsung-a3u-eur-modem" deviceinfo_dtb_mainline_modem="qcom/msm8916-samsung-a3u-eur-modem"
deviceinfo_append_dtb="true" deviceinfo_append_dtb="true"

View file

@ -1,37 +0,0 @@
# Reference: <https://postmarketos.org/deviceinfo>
# 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"

View file

@ -1,65 +0,0 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Mis012 <Michael.Srba@seznam.cz>
# Co-Maintainer: Minecrell <minecrell@minecrell.net>
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
"

View file

@ -1,5 +0,0 @@
[cursor:seat0]
map-to-output:DSI-1
[output:DSI-1]
scale = 1.5

View file

@ -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
"

View file

@ -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"

View file

@ -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"