sony-pioneer: new device (MR 4207)

Note by ollieparanoid:
Based on Konrad Dybcio's great work in MR 1645.

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Max Buchholz 2023-06-29 10:40:38 +02:00 committed by Oliver Smith
parent 54d42e22be
commit c1d23e5fdb
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
9 changed files with 184 additions and 0 deletions

View file

@ -0,0 +1,52 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Max Buchholz <max.buchholz@gmx.de>
pkgname=device-sony-pioneer
pkgdesc="Sony Xperia XA2"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-postmarketos-qcom-sdm660
mkbootimg
postmarketos-base
soc-qcom-sdm660
soc-qcom-sdm660-rproc
"
makedepends="devicepkg-dev"
install="$pkgname.post-install"
source="
deviceinfo
phoc.ini
"
subpackages="
$pkgname-nonfree-firmware:nonfree_firmware
$pkgname-phosh
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
phosh() {
install_if="$pkgname=$pkgver-r$pkgrel postmarketos-ui-phosh"
install -Dm644 "$srcdir"/phoc.ini \
"$subpkgdir"/etc/phosh/phoc.ini
}
nonfree_firmware() {
pkgdesc="Various firmware files required for most subsystems to run"
depends="firmware-sony-ninges soc-qcom-sdm-660-nonfree-firmware"
mkdir "$subpkgdir"
}
sha512sums="
a6449c6668152c7ff0e998ecc910b8763f3cb8a40f05e049e78430b88770504da43cc193c6cdebadcfdacc373f3238588aa1a8707549817f9d31e78e6392402c deviceinfo
aad7cce10db5ec156585893c82932bd42f2c86e4d68208b5f3816ac7f5f80eb6ddf15157666e81de97d30b20897f88e1027545a87fe5c96c37b5e75e3e125ee4 phoc.ini
"

View file

@ -0,0 +1,11 @@
#!/bin/sh
if [ -z "$(grep /dev/disk/by-partlabel/modem_a /etc/fstab)" ]; then
# Firmware shipped with the stock ROM, _a is always populated
echo "/dev/disk/by-partlabel/modem_a /opt/firmware/modem auto ro 0 0" >> /etc/fstab
fi
if [ -z "$(grep /dev/disk/by-partlabel/oem_a /etc/fstab)" ]; then
# ODM blobs provided by Sony Open Devices Project
echo "/dev/disk/by-partlabel/oem_a /opt/firmware/odm auto ro 0 0" >> /etc/fstab
fi

View file

@ -0,0 +1,32 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Sony Xperia XA2"
deviceinfo_manufacturer="Sony"
deviceinfo_codename="sony-pioneer"
deviceinfo_year="2018"
deviceinfo_dtb="qcom/sdm630-sony-xperia-nile-pioneer"
deviceinfo_append_dtb="true"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="1920"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x02000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x01e00000"
deviceinfo_flash_pagesize="4096"

View file

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

View file

@ -0,0 +1,19 @@
pkgname=firmware-sony-ninges
pkgver=1
pkgrel=0
pkgdesc="Firmware for Sony Xperia XA2/Plus/Ultra & 10/10 Plus"
url="postmarketos.org"
arch="aarch64"
license="BSD-3-Clause"
install="$pkgname.post-install"
options="!check !archcheck !strip !tracedeps pmb:cross-native"
depends="rsync"
source="copy-firmware.initd"
package() {
install -Dm755 "$srcdir/copy-firmware.initd" "$pkgdir/etc/init.d/copy-firmware"
}
sha512sums="
53a6f039264547a2f5972c45a9b4c468867a0dc2f2eaea0f085d323643a8cd2f308fa840cd30502c0511441754ca1ee2f7a242135e37e73b9123a5e4162e2da6 copy-firmware.initd
"

View file

@ -0,0 +1,19 @@
#!/sbin/openrc-run
description="Copy firmware to rootfs"
start() {
# Set up directories (if needed)
mkdir -p /opt/firmware/modem
mkdir -p /opt/firmware/odm
mkdir -p /lib/firmware/qcom/venus-4.4
# Copy all the firmware over (except Venus)
rsync -r -l -p --owner=root --group=root --chmod=0755 --exclude 'venus*' /opt/firmware/modem/image/* /lib/firmware/
# Copy Venus FW over to the correct location
rsync -r -l -p --owner=root --group=root --chmod=0755 /opt/firmware/modem/image/venus* /lib/firmware/qcom/venus-4.4
# Get Adreno & ZAP firmware from ODM package
rsync -r -l -p --owner=root --group=root --chmod=0755 /opt/firmware/odm/firmware/* /lib/firmware/qcom
}

View file

@ -0,0 +1,3 @@
#!/bin/sh
rc-update add copy-firmware default

View file

@ -0,0 +1,40 @@
# Maintainer: Max Buchholz <max.buchholz@gmx.de>
pkgname=soc-qcom-sdm660
pkgdesc="Common package for Qualcomm SDM630/636/660 devices"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="BSD-3-Clause"
arch="aarch64"
options="!check !archcheck !tracedeps pmb:cross-native"
subpackages="
$pkgname-rproc
$pkgname-nonfree-firmware:nonfree_firmware
"
package() {
mkdir -p "$pkgdir"
}
rproc() {
pkgdesc="Modem and Wifi services and configuration"
depends="
msm-modem
pd-mapper
pd-mapper-openrc
tqftpserv
tqftpserv-openrc
"
install="$subpkgname.post-install"
mkdir "$subpkgdir"
}
nonfree_firmware() {
pkgdesc="Non-free firmware for GPU and Bluetooth"
depends="
linux-firmware-qca
linux-firmware-qcom
"
mkdir "$subpkgdir"
}

View file

@ -0,0 +1,3 @@
#!/bin/sh
rc-update add tqftpserv boot
rc-update add pd-mapper boot