community/device-asus-me176c: switch to linux-edge (MR 3167)

Linux 5.18 brought better support for some x86-based Android tablets,
thanks to work from Hans de Goede. This includes asus-me176c: the
modified ACPI table and the Linux fork is no longer necessary,
it can just run linux-edge from Alpine.

Drop the old Linux 5.4 fork and related packages. Instead of using
the proprietary sound firmware from linux-firmware-intel, switch to
using the open-source(!) "Sound Open Firmware" (SOF).

NOTE: The mainline battery driver seems quite a bit less accurate
than the ugly old driver ported from the downstream driver. Also,
Bluetooth seems to fail on some boots now. Overall it works quite
well though. :)
This commit is contained in:
Minecrell 2022-05-28 13:36:32 +02:00 committed by Alexey Minnekhanov
parent 1ebdc7f4ab
commit 018b1a1a2d
No known key found for this signature in database
GPG key ID: 6FE3B029D9D9FAFF
7 changed files with 18 additions and 7234 deletions

View file

@ -16,16 +16,11 @@ def device_dependency_check(apkbuild, path):
""" Raise an error if a device package has a dependency that is not allowed
(e.g. because it should be in a subpackage instead). """
# asus-me176c: without this, the device will simply run the broken ACPI
# DSDT table, so we might as well update it. See pmaports!699.
firmware_ok = {"device-asus-me176c": ["firmware-asus-me176c-acpi"]}
pkgname = apkbuild["pkgname"]
for depend in apkbuild["depends"]:
if depend == "linux-firmware-none":
continue
if (depend.startswith("firmware-") or
depend.startswith("linux-firmware")):
if pkgname in firmware_ok and depend in firmware_ok[pkgname]:
continue
raise RuntimeError("Firmware package '" + depend + "' found in"
" depends of " + path + ". These go into"
" subpackages now, see"
@ -83,7 +78,7 @@ def test_aports_device_kernel(args):
# Parse kernels from depends
kernels_depends = []
for depend in apkbuild["depends"]:
if not depend.startswith("linux-"):
if not depend.startswith("linux-") or depend.startswith("linux-firmware-"):
continue
kernels_depends.append(depend)

View file

@ -2,8 +2,8 @@
# Maintainer: Minecrell <minecrell@minecrell.net>
pkgname=device-asus-me176c
pkgdesc="ASUS MeMO Pad 7 (ME176C(X))"
pkgver=5
pkgrel=1
pkgver=6
pkgrel=0
_commit=3155254999ac36c3051a2118c415de25a072c0f6
url="https://postmarketos.org"
license="MIT"
@ -12,16 +12,18 @@ options="!check !archcheck"
depends="
$pkgname-factory
alsa-ucm-conf
firmware-asus-me176c-acpi
intel-ucode
linux-asus-me176c
linux-edge
linux-firmware-none
mesa-dri-gallium
postmarketos-base
sof-firmware
"
makedepends="devicepkg-dev meson eudev-dev"
source="https://github.com/me176c-dev/linux-me176c/archive/$_commit.tar.gz
deviceinfo
phoc.ini
sof-workaround.conf
"
subpackages="
$pkgname-factory
@ -44,6 +46,8 @@ build() {
package() {
devicepkg_package $startdir $pkgname
install -Dm644 "$srcdir"/sof-workaround.conf \
"$pkgdir"/etc/modprobe.d/sof-workaround.conf
}
factory() {
@ -54,8 +58,8 @@ factory() {
}
nonfree_firmware() {
pkgdesc="WiFi, Bluetooth and Sound firmware"
depends="linux-firmware-intel firmware-asus-me176c"
pkgdesc="WiFi/Bluetooth firmware"
depends="firmware-asus-me176c"
mkdir "$subpkgdir"
}
@ -79,6 +83,7 @@ libva() {
sha512sums="
75243e3d0bc9a352465683ec8cf8b83566e4131bb7fae0f388267a62bdbf4691c955ed034b30df550f921b771080688123ae8db144b72f786bf1677ef1d83f57 3155254999ac36c3051a2118c415de25a072c0f6.tar.gz
c8bb189b08035e647e07dec120a6e166d871c17a227987387228c8bf6ff264e029f950c69bb560d3062cee0e27e4fb93449523592558108690a82c6d40931de1 deviceinfo
2f5bc546336673452413948d3bbed6af45ef08f0b568b6398739a4c6a918e8b4c358191f0a8c84efccde490d559883ceab4ba81dfcf30593f3552dd867930ab5 deviceinfo
3823556d741a352fc7f43567d7218255a27c45c2c5d4d4bdf23f4d26ce2828c5a1c642519b84fef7f59756c990e6a199d72e6ba0c277939b08a40526c3ff3714 phoc.ini
3d0dd014ac7c2700c4ceb7adf549b96dd0eaa7e75bc4ebee7aab23dc31679edc822e9f6ab0e51a1500459e7f04683c00b5a5c600aa2e13a61697e415ad4a019d sof-workaround.conf
"

View file

@ -6,7 +6,7 @@ deviceinfo_name="ASUS MeMO Pad 7 (ME176C(X))"
deviceinfo_codename="asus-me176c"
deviceinfo_manufacturer="ASUS"
deviceinfo_year="2014"
deviceinfo_modules_initfs="goodix"
deviceinfo_modules_initfs="gpio-crystalcove intel_crystal_cove_charger 8250_dw x86-android-tablets mmc_block sdhci_acpi phy-tusb1210 dwc3 dwc3-pci goodix_ts"
deviceinfo_arch="x86_64"
# Device related

View file

@ -0,0 +1,2 @@
# https://github.com/thesofproject/sof/issues/3868
options snd_sof sof_debug=1

View file

@ -1,27 +0,0 @@
pkgname=firmware-asus-me176c-acpi
pkgver=0_git20190206
pkgrel=2
arch="x86_64"
pkgdesc="Patched ACPI DSDT table for ASUS MeMO Pad 7 (ME176C(X))"
url="https://github.com/me176c-dev/me176c-acpi"
license="unknown"
options="!check !strip !archcheck !tracedeps pmb:cross-native"
makedepends="iasl"
_commit="9c25272d67965b7bbc03283e333822f02a8f9a9a"
source="$url/archive/$_commit.tar.gz"
builddir="$srcdir/me176c-acpi-$_commit"
build() {
iasl dsdt.dsl
mkdir -p kernel/firmware/acpi
cp dsdt.aml kernel/firmware/acpi/dsdt.aml
echo kernel/firmware/acpi/dsdt.aml | cpio -o -H newc -R 0:0 > acpi.img
}
package() {
install -Dm644 acpi.img "$pkgdir"/boot/acpi-me176c.img
}
sha512sums="c85db14df9e6d90d3e63f496243d27ee9750b302c1829a678ea51e9070f5e8679ea51e65609a43d8ae359287f713da37ea98df2e39b22e0a7a797bff4c63768d 9c25272d67965b7bbc03283e333822f02a8f9a9a.tar.gz"

View file

@ -1,69 +0,0 @@
# Maintainer: Minecrell <minecrell@minecrell.net>
# Kernel config based on: https://github.com/me176c-dev/archlinux-me176c/blob/master/linux-me176c/config
_flavor="asus-me176c"
pkgname=linux-$_flavor
pkgver=5.4.197
_kernver=${pkgver%.*}
_me176cver=5.4.17
pkgrel=1
pkgdesc="Mainline kernel fork for ASUS MeMO Pad 7 (ME176C(X))"
arch="x86_64"
_carch="x86_64"
url="https://github.com/me176c-dev/linux-me176c"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native pmb:kconfigcheck-community"
makedepends="
bison
diffutils
elfutils-dev
flex
gmp-dev
linux-headers
mpc1-dev
mpfr-dev
openssl-dev
perl
postmarketos-installkernel
xz
"
# Source
source="
https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$_kernver.tar.xz
linux-$pkgver.patch.xz::https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/patch-$pkgver.xz
https://github.com/me176c-dev/linux-me176c/releases/download/$_me176cver/linux-me176c-$_me176cver.patch.xz
config-$_flavor.$arch
"
builddir="$srcdir/linux-$_kernver"
prepare() {
default_prepare
cp "$srcdir/config-$_flavor.$arch" .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION=$((pkgrel + 1 ))
}
package() {
mkdir -p "$pkgdir"/boot
make install modules_install \
ARCH="$_carch" \
INSTALL_PATH="$pkgdir"/boot \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_MOD_STRIP=1
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
}
sha512sums="
9f60f77e8ab972b9438ac648bed17551c8491d6585a5e85f694b2eaa4c623fbc61eb18419b2656b6795eac5deec0edaa04547fc6723fbda52256bd7f3486898f linux-5.4.tar.xz
74d40207bec5273988759660cee5d5ed4fdd993ca92027a726d4d4f45a23c2c86f4a42fc060af8bcf2a367cab8c17f19eccb85c7f473e11bae6c5cac405c32dc linux-5.4.197.patch.xz
aa462bfcbba87469a617e2ffd4058cd41137b74f836aae47ac89bc70de2836b8f3ddce94f597e61bb287eb009bb71f4e831c487b0073011673d5db4a8d8ae080 linux-me176c-5.4.17.patch.xz
aacbe561ff3864be48ced173175347f2198a03d6eb55c3ebb1a3bcab06483af901fa27013b821a80a892853e9755bed3e07e118330865affabe2449a8276900e config-asus-me176c.x86_64
"

File diff suppressed because it is too large Load diff