motorola-montana: new device (Motorola Moto G5s) (!286)

Initial starting point to get the device booting. The downstream kernel
repository can be improved, see discussion in the merge request.

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Jakub Strzelecki 2019-03-21 11:07:55 +01:00 committed by Oliver Smith
parent 568e035837
commit b19509a8fa
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
6 changed files with 5024 additions and 0 deletions

View file

@ -0,0 +1,24 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-motorola-montana"
pkgdesc="Motorola Moto G5s"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-motorola-montana mkbootimg mesa-dri-swrast msm-fb-refresher"
makedepends="devicepkg-dev"
source="deviceinfo initfs-hook.sh"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="4d1d55b0205f506e0f85f00e0a02ff294ff37bac928da98d7b9935971afb6a98adf3af4099e3149cf57c4bfc8ca782885afe580ab2938883db3b2fab1eaf6e11 deviceinfo
aa012cf1940af94fd7b9ec9da6ebe94ce9315d8fb920c4c39e9c08bf409fff3c697d0f045f2d1a2adaa40c99dc9748a0aeb64f55d1dd4ae9999276c70db3314b initfs-hook.sh"

View file

@ -0,0 +1,33 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Motorola Moto G5s"
deviceinfo_manufacturer="Motorola"
deviceinfo_codename="motorola-montana"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="1920"
deviceinfo_dev_touchscreen="/dev/input/event1"
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=30 msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 earlycon=msm_hsl_uart,0x78B0000 vmalloc=400M buildvariant=user"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_flash_offset_base="0x80000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"

View file

@ -0,0 +1,4 @@
#!/bin/sh
# enable touchscreen
echo 1 > /sys/devices/soc/78b7000.i2c/i2c-3/3-0020/drv_irq

View file

@ -0,0 +1,71 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/montana_defconfig
pkgname="linux-motorola-montana"
pkgver=3.18.71
pkgrel=0
pkgdesc="Motorola Moto G5s kernel fork"
arch="armv7"
_carch="arm"
_flavor="motorola-montana"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev dtbtool xz"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="kernel-msm"
_commit="oreo-8.1.0-release"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/kubast2/${_repository}/archive/${_commit}.tar.gz
$_config
gcc8-fix-put-user.patch
"
builddir="$srcdir/${_repository}-${_commit}"
prepare() {
default_prepare
REPLACE_GCCH=0 downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
# Generate master DTB (deviceinfo_bootimg_qcdt)
dtbTool -s 2048 -p "scripts/dtc/" -o "arch/arm/boot/dt.img" "arch/arm/boot/"
}
package() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# zImage (find the right one)
cd "$builddir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in zImage-dtb Image.gz-dtb *zImage Image; do
[ -e "$_zimg" ] || continue
msg "zImage found: $_zimg"
install -Dm644 "$_zimg" "$_target"
break
done
if ! [ -e "$_target" ]; then
error "Could not find zImage in $PWD!"
return 1
fi
# Master DTB (deviceinfo_bootimg_qcdt)
install -Dm644 "$builddir/arch/arm/boot/dt.img" \
"$pkgdir/boot/dt.img"
}
sha512sums="d84030635b95fde39fe92e5eb79c288c1096a276930cd204ad18119d759f785ca7a0647bb16fd2eaa17c0635ed66e5c2324ef454324e83b5fd678e29e05c926c linux-motorola-montana-oreo-8.1.0-release.tar.gz
cd15d24513982b5ce1332cd353f84774eab0d7ac76a8b20a920fc78ee57d3925d25f63171474e959e2018a03401ba7acfa35f4f668f7b1d10d69bd5839b73b2f config-motorola-montana.armv7
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch