pmaports/device/testing/firmware-xiaomi-wt88047/APKBUILD
Minecrell c64f29713f
xiaomi-wt88047: add mainline port for Xiaomi Redmi 2 (MR 1604)
Replace the old downstream port with a new aarch64 port running the
linux-postmarketos-qcom-msm8916 close-to-mainline(TM) kernel.
Most of the functionality is working:

  - USB Network
  - Storage (eMMC, SD card)
  - Display, brightness control
  - Touchscreen, buttons
  - IMU (accelerometer+gyroscope)
  - Notification LED
  - Sound (Speaker, Headphones, Microphones)
  - WiFi, Bluetooth
  - Modem (SMS, voice calls, mobile data)

Coming soon (hopefully): Battery/Charging, USB-OTG (not working yet)

There are many variants of the device, so more changes to handle
differences between them may be needed in the future. For now,
the only relevant difference is the required modem firmware:

  - wt88047 (global variant)
  - wt86047 (China variant)

... have different kind of modems and they do not seem to work with
the firmware of the other one. The way this is handled in this device
package is that there is a separate kernel variant for both of them.
All other required firmware can be shared, and therefore there is no
differentiation needed when using the kernel variant without modem.

I renamed "wingtech-wt88047" to "xiaomi-wt88047".
My reasoning for that is the following:

  - Wingtech is the ODM (original design manufacturer), they designed the
    hardware and (probably) manufactured it. But postmarketOS port applies
    to the combination of both hardware and firmware, and the firmware was
    at least partially provided by Xiaomi.

  - wt88047 looks lonely with the "wingtech" vendor, when all other Xiaomi
    devices use "xiaomi", even though many from them were probably also
    designed by Wingtech.

  - We don't use the ODM hardware name for other devices either, e.g.
    "wileyfox-crackling" would be "longcheer-l8150" with the same approach.

I think the port is better visible as "xiaomi-wt88047" (too bad Xiaomi
seemingly did not have a proper codename for this device...)
2020-10-05 04:00:56 +03:00

44 lines
1.5 KiB
Text

pkgname=firmware-xiaomi-wt88047
pkgver=9.2.5.0
pkgrel=0
pkgdesc="Firmware for Xiaomi Redmi 2"
url="https://androidfilehost.com/?w=files&flid=303434"
subpackages="$pkgname-modem $pkgname-wcnss-nv:wcnss_nv"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck !tracedeps pmb:cross-native"
makedepends="mtools"
source="
wt88047-WCNSS_qcom_wlan_nv.bin.base64::https://pastebin.com/raw/bntm8Z7m
https://archive.org/download/lineage-15.1-20200223-nightly-wt88047-signed_202004/wt88047-firmware_V9.2.5.0.LHJMIEK.zip
"
_fwdir="/lib/firmware/postmarketos"
unpack() {
default_unpack
base64 -d wt88047-WCNSS_qcom_wlan_nv.bin.base64 > WCNSS_qcom_wlan_nv.bin
# Extract firmware files from FAT file system image
mcopy -i firmware-update/NON-HLOS.bin -p -m -v \
::image/mba.mbn ::image/modem.* "$srcdir"
}
package() {
# parent package is empty
mkdir -p "$pkgdir"
}
modem() {
pkgdesc="Xiaomi Redmi 2 (wt88047) modem firmware"
install -Dm644 "$srcdir"/mba.mbn -t "$subpkgdir/$_fwdir"
install -Dm644 "$srcdir"/modem.* -t "$subpkgdir/$_fwdir"
}
wcnss_nv() {
pkgdesc="Xiaomi Redmi 2 WiFi/BT firmware configuration"
install -Dm644 "$srcdir"/WCNSS_qcom_wlan_nv.bin -t "$subpkgdir/$_fwdir"/wlan/prima
}
sha512sums="cab8578bf8b20ff83035a10598ebb673619e5409683799a5d6d04496b7f4b4e0f54a635b29efe2007137adf089d24134339c69214fdfa06a9d2ff052c39b9e59 wt88047-WCNSS_qcom_wlan_nv.bin.base64
45b0926f1694dc2f71d26b1408922345e2340bb84a73597ea00bd5025e31f5bafcf910395a6b021686043e041b8f2cd4ca448e891341fe4eca7382b6ee5b2186 wt88047-firmware_V9.2.5.0.LHJMIEK.zip"