samsung-a7y18lte: new device (MR 2645)

[ci:skip-build] Already built on CI in MR
This commit is contained in:
M0Rf30 2021-11-05 11:43:09 +01:00 committed by Newbyte
parent f873d8be03
commit dc319b1ed7
No known key found for this signature in database
GPG key ID: 5873C171C9429CFA
7 changed files with 5401 additions and 0 deletions

View file

@ -0,0 +1,32 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-a7y18lte
pkgdesc="Samsung Galaxy A7 (2018)"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="linux-samsung-a7y18lte mesa-dri-gallium mkbootimg postmarketos-base"
makedepends="devicepkg-dev"
source="deviceinfo initfs-hook.sh"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Non-free firmware for the Samsung Galaxy A7 (2018)"
depends="firmware-samsung-universal7885 firmware-samsung-a7y18lte"
mkdir "$subpkgdir"
}
sha512sums="
5d01c7d7dd88e64157aff2114bf7d10c40923b82060ebdf99f9fe7a010fc429cb78deb96c9820cf0ac1c8147509fd273a40620131d986fab2ebd7ef0a9c5ff92 deviceinfo
04445194a5245d08fcf1b425bff1d8dd6a8fdacafdc151223634299a35f1eb20fbd733979b58bcfd854e16fde02629c28453f840d6c9dc34fc15d4fcc8aa4302 initfs-hook.sh
"

View file

@ -0,0 +1,36 @@
# 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 A7 (2018)"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-a7y18lte"
deviceinfo_year="2018"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="2220"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_offset_base="0x10000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"
deviceinfo_flash_heimdall_partition_kernel="BOOT"
deviceinfo_flash_heimdall_partition_system="SYSTEM"
# USB related
deviceinfo_usb_idVendor="0x04e8" # Samsung Electronics Co., Ltd
deviceinfo_usb_idProduct="0x6860" # Galaxy (MTP)

View file

@ -0,0 +1,28 @@
#!/bin/sh
# This is a trimmed down version of setup_usb_network_configfs from
# pmOS's init_functions.sh
# See: https://www.kernel.org/doc/Documentation/usb/gadget_configfs.txt
CONFIGFS=/config/usb_gadget
SYS=/sys/class/android_usb/android0
# Create an usb gadet configuration
mkdir $CONFIGFS/g1 || echo "initfs-hook: Couldn't create $CONFIGFS/g1"
# Create rndis function.
mkdir $CONFIGFS/g1/functions/rndis.usb0 \
|| echo "initfs-hook: Couldn't create $CONFIGFS/g1/functions/rndis.usb0"
# Create configuration instance for the gadget
mkdir $CONFIGFS/g1/configs/c.1 \
|| echo "initfs-hook: Couldn't create $CONFIGFS/g1/configs/c.1"
# Link the rndis instance to the configuration
ln -s $CONFIGFS/g1/functions/rndis.usb0 $CONFIGFS/g1/configs/c.1 \
|| echo "initfs-hook: Couldn't symlink rndis.usb0"
echo "0" >"$SYS/enable"
echo "$(ls /sys/class/udc)" > $CONFIGFS/g1/UDC || echo " Couldn't write UDC"
echo "rndis" >"$SYS/functions"
echo "1" >"$SYS/enable"

View file

@ -0,0 +1,22 @@
pkgname=firmware-samsung-a7y18lte
pkgver=1
pkgrel=0
_commit="05cd435745188e6d6f5bd4f3d1af851534b857d2"
pkgdesc="Firmware files for Samsung Galaxy A7 (2018)"
url="https://postmarketos.org"
arch="aarch64"
license="proprietary"
source="a7y18lte-fw-$_commit.tar.gz::https://github.com/M0Rf30/postmarketos-vendor-samsung-a7y18lte/archive/$_commit.tar.gz"
options="!strip !check !archcheck !spdx !tracedeps pmb:cross-native"
builddir="$srcdir/postmarketos-vendor-samsung-a7y18lte-$_commit"
package() {
cd $srcdir
mkdir -p "$pkgdir/lib/firmware"
cp -r postmarketos-vendor-samsung-a7y18lte-"$_commit"/firmware/ \
"$pkgdir/lib/firmware/postmarketos"
}
sha512sums="
1fcc5db43060db0a8a44580f60be15027812b3c5abeff804e0b4073590887b5d0b2308fa1c9f1c772e357cec445b646998b1c85cdeb8893941c5a1db667398cf a7y18lte-fw-05cd435745188e6d6f5bd4f3d1af851534b857d2.tar.gz
"

View file

@ -0,0 +1,58 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/exynos7885-a7y18lte_defconfig
pkgname=linux-samsung-a7y18lte
pkgver=4.4.177
pkgrel=0
pkgdesc="Samsung Galaxy A7 (2018) kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="samsung-a7y18lte"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="bash bc bison devicepkg-dev flex openssl-dev perl dtbtool-exynos"
# Source
_repository="Universal7885_native_linux"
_commit="d39c5e1cbea46c97e2f6adea1b481c64b5f558cc"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/M0Rf30/$_repository/archive/$_commit.tar.gz
kernel-define-android-version.patch
$_config
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare() {
default_prepare
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
# Needed for the SoC's power management. When booting without it, the kernel is
# unusably slow and glitchy.
objcopy -I binary -O ihex firmware/exynos7885_acpm_fvp.fw firmware/exynos7885_acpm_fvp.fw.ihex
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
dtbTool-exynos --pagesize 2048 --platform 0x50a6 --subtype 0x217584da \
-o "$_outdir/arch/arm64/boot/dtb.img" $(find "$_outdir/arch/arm64/boot/dts/exynos/" -name *a7y18lte*.dtb)
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
# Master DTB (deviceinfo_bootimg_qcdt)
install -Dm644 "$_outdir/arch/arm64/boot/dtb.img" \
"$pkgdir/boot/dt.img"
}
sha512sums="
21fbd2ed1c64a0c715c0ffac75c1803b1dcc81984b2399d58d5be08916e6fc75fb2717648d2f1a2d558226f86485f652497b226d5592653de74ca2942cbe474c linux-samsung-a7y18lte-d39c5e1cbea46c97e2f6adea1b481c64b5f558cc.tar.gz
f3161f62a6ba0de56342b1410e509dce8320e43f788ae2670ebd59d93e5504aab77a913eecdebae33ff9135228869c5fd0559211c511f503fdc25f2fbab48351 kernel-define-android-version.patch
84d3326efdbb5aee7380844034e7bf531c3d30a977f88dc4de3f1a074a18c2c6ec5855bffd604a214b724d7323fa1384266e686b71ab8ef1b6beb04fba27508c config-samsung-a7y18lte.aarch64
"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,14 @@
Defines PLATFORM_VERSION, which is needed for compillation.
diff --git a/Makefile b/Makefile
index 45ce83161..fdb71c8ec 100755
--- a/Makefile
+++ b/Makefile
@@ -469,6 +469,7 @@ asm-generic:
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
src=uapi/asm obj=arch/$(SRCARCH)/include/generated/uapi/asm
+PLATFORM_VERSION=9
ifneq ($(PLATFORM_VERSION), )
PLATFORM_VERSION_NUMBER=$(shell $(CONFIG_SHELL) $(srctree)/scripts/android-version.sh $(PLATFORM_VERSION))
MAJOR_VERSION=$(shell $(CONFIG_SHELL) $(srctree)/scripts/android-major-version.sh $(PLATFORM_VERSION))