device-samsung-klte-downstream: new aport (MR 2279)

This commit is contained in:
Alexey Minnekhanov 2021-06-27 02:45:15 +03:00
parent cc6384a986
commit 383c695e38
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
6 changed files with 137 additions and 0 deletions

View file

@ -0,0 +1,63 @@
# Unmaintained: Downstream port, only for testing. Use mainline port (samsung-klte)!
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-klte-downstream
pkgdesc="Samsung Galaxy S5 (SM-G900F)"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
cpufrequtils
linux-samsung-klte-downstream
mesa-dri-gallium
mkbootimg
msm-fb-refresher
postmarketos-base
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="
cpufreq.start
deviceinfo
fstab.android
NetworkManager-klte.conf
"
install="$pkgname.post-install"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
# Disable v4l udev rules (video4linux), because without the camera
# firmware blobs this makes udev helper hang (#1033).
mkdir -p "$pkgdir"/etc/udev/rules.d
ln -s /dev/null "$pkgdir"/etc/udev/rules.d/60-persistent-v4l.rules
# NetworkManager configuration - ignore unsupported devices and set default dhcp client
install -Dm644 "$startdir"/NetworkManager-klte.conf \
"$pkgdir"/etc/NetworkManager/conf.d/10-klte.conf
# Power/battery saver, prevent device from overheating
install -Dm755 "$startdir"/cpufreq.start "$pkgdir"/etc/local.d/cpufreq.start
# fstab with android mountpoints
install -Dm644 "$startdir"/fstab.android "$pkgdir"/etc/fstab.android
}
nonfree_firmware() {
pkgdesc="Wi-Fi firmware"
depends="firmware-samsung-klte-wifi"
mkdir "$subpkgdir"
}
sha512sums="
c66e0c57e911b644cf6c340ea19ce0a9399b8e9e6cb0da38f612e0f8b3d0812ad109cd7b7506184e840a653397a64e3e57fdc71ab8b0fc52733bf74365b9c0e7 cpufreq.start
64f4951e064ecd598e19a187c9d03989f37954ddb5726f97d54e21a46ad9ea49b0945f93bc04e3dcb97183bd03c87c66c28f2d3b8cc88e5bd8427795a4865d31 deviceinfo
6648d792ffd9fc002e45834fe12a77d20935a8936246d4a06f1835a4370c2de1cb3191650d02c21d637cfe68a5a7286a5c9e5f9c00b9c56c299176b210f6af3f fstab.android
3753dcd8c25cfbbdd8f087a3168537df1334f0d33f36bc8923ec3d225ceb88121aa8d1670d6c6a2baab3d7067c86a43571695ce22e3b47076f97fcb53d1d7e6f NetworkManager-klte.conf
"

View file

@ -0,0 +1,6 @@
[main]
plugins+=keyfile
dhcp=dhcpcd
[keyfile]
unmanaged-devices+=interface-name:rmnet_usb?;interface-name:rmnet?;interface-name:rev_rmnet?

View file

@ -0,0 +1,4 @@
#!/bin/sh
# Configure conservative CPU governor on system startup
for CORE in 0 1 2 3; do cpufreq-set -c$CORE -g conservative; done

View file

@ -0,0 +1,16 @@
#!/bin/sh
# Enable autostart of deferred initcalls (needed to bring Wi-Fi online)
# deferred-initcalls comes from postmarketos-base package
rc-update -q add deferred-initcalls sysinit
# Explicitly specify wlan device. Without this, p2p0 will be
# selected automatically instead of wlan0, and Wi-Fi will not work.
if ! grep -q "i wlan0" /etc/conf.d/wpa_supplicant ; then
sed -i 's/-Dwext,nl80211/-Dwext,nl80211 -i wlan0/' /etc/conf.d/wpa_supplicant
fi
# Append Android mount points to fstab, if needed
if ! grep -q "# Android specific mount points:" /etc/fstab ; then
cat /etc/fstab.android >> /etc/fstab
fi

View file

@ -0,0 +1,34 @@
# 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 S5"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-klte-downstream"
deviceinfo_year="2014"
deviceinfo_arch="armv7"
# 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="heimdall-bootimg"
deviceinfo_kernel_cmdline="console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 zcache.enabled=1 zcache.compressor=lz4 androidboot.bootdevice=msm_sdcc.1 audit=0 selinux=0 androidboot.selinux=disabled"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_bootimg_append_seandroidenforce="true"
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="2048"
deviceinfo_flash_heimdall_partition_kernel="BOOT"
# USB related
deviceinfo_usb_idVendor="0x04e8" # Samsung Electronics Co., Ltd
deviceinfo_usb_idProduct="0x6860" # Galaxy (MTP)

View file

@ -0,0 +1,14 @@
# This file defines some mount points that are used by Android 7.1
# Its contents should be appended to device's default /etc/fstab file.
# Android specific mount points:
# Userdata partition (Android apps and user files live here)
# Use this as storage, unless you've installed postmarketOS to userdata partition
/dev/mmcblk0p26 /mnt/data ext4 noauto,rw,nosuid,nodev,noatime 0 0
# Other:
/dev/mmcblk0p24 /mnt/cache ext4 noauto,rw,nosuid,nodev,noatime 0 0
/dev/mmcblk0p1 /mnt/firmware vfat noauto,ro,shortname=lower 0 0
/dev/mmcblk0p2 /mnt/firmware-modem vfat noauto,ro,shortname=lower 0 0
/dev/mmcblk0p12 /mnt/efs ext4 noauto,ro,nosuid,nodev,noatime 0 0