samsung-a5*: squash to a5, use msm-firmware-loader (MR 2431)

Right now we have multiple variants of A5 that are only different in
secure-boot keys and as such different firmware blobs.
Use msm-firmware-loader to support all A5 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-09-19 14:18:08 +05:00 committed by Alexey Minnekhanov
parent 7c7f5c7300
commit a1688878a2
No known key found for this signature in database
GPG key ID: 6FE3B029D9D9FAFF
7 changed files with 56 additions and 181 deletions

View file

@ -1,9 +1,10 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Minecrell <minecrell@minecrell.net>
pkgname=device-samsung-a5ulte
pkgdesc="Samsung Galaxy A5 (SM-A500FU)"
pkgver=4
pkgrel=1
# Co-Maintainer: Alexey Min <alexey.min@gmail.com>
pkgname=device-samsung-a5
pkgdesc="Samsung Galaxy A5 (2015)"
pkgver=5
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
@ -15,9 +16,13 @@ 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
"
# Backwards compatibility for old device package names
_substitutes="device-samsung-a5lte device-samsung-a5ulte"
replaces="$_substitutes"
for pkg in $replaces; do provides="$provides $pkg=$pkgver-r$pkgrel"; done
build() {
devicepkg_build $startdir $pkgname
}
@ -29,28 +34,30 @@ 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-a5ulte-venus firmware-samsung-a5ulte-wcnss"
mkdir "$subpkgdir"
}
nonfree_firmware_modem() {
pkgdesc="Modem firmware"
depends="firmware-samsung-a5ulte-modem"
install_if="$pkgname-nonfree-firmware $pkgname-kernel-mainline-modem"
depends="linux-firmware-qcom msm-firmware-loader firmware-samsung-a5-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"
}
sha512sums="
b13a0ed1dfdbe15f66125cc9774ef3eb328e1ab712a15771862a47ac21924bd2f0819e2064b46c5d0e4d5414f4ab36f6f6daf64c1f6f216118a07da6eb2084eb deviceinfo
8159d38ec4e9b85ca929de9cd6888475e596b64c73b9c2bedf68e2d21434448fc0d40d6aa3a5aa1d3da767d34557f0691bae7d0802239872fdf5bbb810664dab deviceinfo
"

View file

@ -2,9 +2,9 @@
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Samsung Galaxy A5 (SM-A500F)"
deviceinfo_name="Samsung Galaxy A5 (2015)"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-a5lte"
deviceinfo_codename="samsung-a5"
deviceinfo_year="2015"
# Eventually this should be replaced with a special DTB for a5lte.
# However, the differences are minimal, so for now a5u-eur works fine.

View file

@ -1,57 +0,0 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Alexey Min <alexey.min@gmail.com>
# Co-Maintainer: Minecrell <minecrell@minecrell.net>
pkgname=device-samsung-a5lte
pkgdesc="Samsung Galaxy A5 (SM-A500F)"
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"
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
"
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-a5lte-venus firmware-samsung-a5lte-wcnss"
mkdir "$subpkgdir"
}
nonfree_firmware_modem() {
pkgdesc="Modem firmware"
depends="firmware-samsung-a5lte-modem"
install_if="$pkgname-nonfree-firmware $pkgname-kernel-mainline-modem"
mkdir "$subpkgdir"
}
sha512sums="
2aaf980c8650b9687713d6813a182455ab1aa692b3bee338930cd90238231033dbdeddf3970b19a84fcbaf78b0cfeb08f4f9eace3669e6ef1c7b82372234d728 deviceinfo
"

View file

@ -1,34 +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 A5 (SM-A500FU)"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-a5ulte"
deviceinfo_year="2015"
deviceinfo_dtb_mainline="qcom/msm8916-samsung-a5u-eur"
deviceinfo_dtb_mainline_modem="qcom/msm8916-samsung-a5u-eur-modem"
deviceinfo_append_dtb="true"
deviceinfo_modules_initfs="panel-samsung-ea8061v-ams497ee01 msm mms114"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_gpu_accelerated="true"
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="720"
deviceinfo_screen_height="1280"
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

@ -0,0 +1,33 @@
pkgname=firmware-samsung-a5
pkgver=1
pkgrel=0
_name="Samsung Galaxy A5 (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/br6nKv4W"
_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-a5lte-wcnss firmware-samsung-a5ulte-wcnss"
install -Dm644 "$srcdir"/WCNSS_qcom_wlan_nv.bin -t "$subpkgdir/$_fwdir"/wlan/prima
}
sha512sums="
c2e48a0ce9bc40a2b9a4bb6197e7e338090a0c63cfdb7004d0dfb89bd9abbdb4536ec8e0a0ca487dc759fd4746cc8e44619680797cc05d2a274032def0fd2cef firmware-samsung-a5-WCNSS_qcom_wlan_nv.bin.base64
"

View file

@ -1,37 +0,0 @@
pkgname=firmware-samsung-a5lte
pkgver=2
pkgrel=0
pkgdesc="Firmware for Samsung Galaxy A5 (SM-A500F)"
url="https://pepethekingprawn.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-A500F.tar.xz"
_fwdir="/lib/firmware/postmarketos"
package() {
# parent package is empty
mkdir -p "$pkgdir"
}
modem() {
pkgdesc="Samsung Galaxy A5 (SM-A500F) modem firmware"
install -Dm644 "$srcdir"/mba.mbn -t "$subpkgdir/$_fwdir"
install -Dm644 "$srcdir"/modem.* -t "$subpkgdir/$_fwdir"
}
venus() {
pkgdesc="Samsung Galaxy A5 (SM-A500F) video firmware"
install -Dm644 "$srcdir"/venus.* -t "$subpkgdir/$_fwdir"/qcom/venus-1.8
}
wcnss() {
pkgdesc="Samsung Galaxy A5 (SM-A500F) WiFi/BT firmware"
cd "$srcdir"
install -Dm644 wcnss.* -t "$subpkgdir/$_fwdir"
install -Dm644 WCNSS_* -t "$subpkgdir/$_fwdir"/wlan/prima
}
sha512sums="08421f2788eb873b4c4440c09da6732065233075e99a37b25932112297e036443664b5a9c19bb11f03da68618e065ce7638b41f80a2ad6a295a1375137a20405 SM-A500F.tar.xz"

View file

@ -1,37 +0,0 @@
pkgname=firmware-samsung-a5ulte
pkgver=2
pkgrel=0
pkgdesc="Firmware for Samsung Galaxy A5 (SM-A500FU)"
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-A500FU.tar.xz"
_fwdir="/lib/firmware/postmarketos"
package() {
# parent package is empty
mkdir -p "$pkgdir"
}
modem() {
pkgdesc="Samsung Galaxy A5 (SM-A500FU) modem firmware"
install -Dm644 "$srcdir"/mba.mbn -t "$subpkgdir/$_fwdir"
install -Dm644 "$srcdir"/modem.* -t "$subpkgdir/$_fwdir"
}
venus() {
pkgdesc="Samsung Galaxy A5 (SM-A500FU) video firmware"
install -Dm644 "$srcdir"/venus.* -t "$subpkgdir/$_fwdir"/qcom/venus-1.8
}
wcnss() {
pkgdesc="Samsung Galaxy A5 (SM-A500FU) WiFi/BT firmware"
cd "$srcdir"
install -Dm644 wcnss.* -t "$subpkgdir/$_fwdir"
install -Dm644 WCNSS_* -t "$subpkgdir/$_fwdir"/wlan/prima
}
sha512sums="de63dc9075c559248666afbd76b4f1bd29b235f7bc1c83f68fef65fa9532ce042e42074a9b3bf498a9038d5204f780708e9de750b83b51a6afa519bc358216b0 SM-A500FU.tar.xz"