diff --git a/device/device-motorola-thea/90-android-touch-dev.rules b/device/device-motorola-thea/90-android-touch-dev.rules new file mode 100644 index 000000000..5c9cbd972 --- /dev/null +++ b/device/device-motorola-thea/90-android-touch-dev.rules @@ -0,0 +1,8 @@ +# udev rules file +# All device names can be read from weston's logfile + +# Touchscreen (use 'weston-calibrator' to calibrate) +SUBSYSTEM=="input", ATTRS{name}=="synaptics_dsx_i2c", \ +ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1" \ +ENV{WL_CALIBRATION}="1.058484 -0.016513 -7.906464 0.020550 0.998119 -34.100464" + diff --git a/device/device-motorola-thea/APKBUILD b/device/device-motorola-thea/APKBUILD new file mode 100644 index 000000000..838de2fc7 --- /dev/null +++ b/device/device-motorola-thea/APKBUILD @@ -0,0 +1,48 @@ +# Reference: +# Contributor: Pablo Castellano +pkgname=device-motorola-thea +pkgver=1 +pkgrel=0 +pkgdesc="Motorola Moto G 2014" +url="https://postmarketos.org" +arch="armv7" +license="MIT" +depends="postmarketos-base linux-motorola-titan mkbootimg msm-fb-refresher mesa-dri-swrast" +makedepends="devicepkg-dev" +install="$pkgname.post-install" +subpackages="$pkgname-weston $pkgname-nonfree-firmware:nonfree_firmware" +source="deviceinfo 90-android-touch-dev.rules profile.sh weston.ini" +options="!check !archcheck" + +build() { + devicepkg_build $startdir $pkgname +} + +package() { + devicepkg_package $startdir $pkgname + install -Dm644 "$srcdir"/90-android-touch-dev.rules \ + "$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules + install -Dm644 "$srcdir"/profile.sh \ + "$pkgdir"/etc/profile.d/00-$pkgname.sh + + # Disable v4l (video4linux), because without the camera firmware + # blobs this makes dev hang with the kernel this device uses (#1033) + ln -s /dev/null "$pkgdir"/etc/udev/rules.d/60-persistent-v4l.rules +} + +weston() { + install_if="$pkgname weston" + install -Dm644 "$srcdir"/weston.ini \ + "$subpkgdir"/etc/xdg/weston/weston.ini +} + +nonfree_firmware() { + pkgdesc="Wifi firmware" + depends="firmware-motorola-titan" + mkdir "$subpkgdir" +} + +sha512sums="c82df81c55e6f11dc4aba1d3cb1f6bf7be37bfdea0eef6c0e17f7c39ff7bf915b5ffed3daca211e8dec6e699c4232d5759d0f91c1a8a84a2fbc0346f3233d15f deviceinfo +8406968cd554393ea1e350967c80810d059de2b1d33ea1302e265780c1f0110d64cf15a68c2f374981a88906d0317315e0a71995c85fd5eaf93bb47ed427529c 90-android-touch-dev.rules +d04013c17caf77a87ebea167dbe48f7efa9c9d3123c5743d359f3ea8ccc6b268fa021535a4bf8291eb4a352f0c92f6eb527da0db340421f53bc1cc439a453306 profile.sh +86a0c08720225e4532f797ad69307dfff66867e4a35de1aacceefc48f19721caf93f9a17a268e58f1f5a7e947f157d6984676837c2b5b835b0caf6ee9821bb5a weston.ini" diff --git a/device/device-motorola-thea/device-motorola-thea.post-install b/device/device-motorola-thea/device-motorola-thea.post-install new file mode 100644 index 000000000..c9c687510 --- /dev/null +++ b/device/device-motorola-thea/device-motorola-thea.post-install @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ -z "$(grep /mnt/firmware /etc/fstab)" ]; then + mkdir -p /mnt/firmware + echo "/dev/mmcblk0p1 /mnt/firmware auto ro 0 0" >> /etc/fstab +fi + +if [ -z "$(grep /mnt/data /etc/fstab)" ]; then + mkdir -p /mnt/data + echo "/dev/mmcblk0p38 /mnt/data auto ro 0 0" >> /etc/fstab +fi + +if [ -z "$(grep /mnt/persist /etc/fstab)" ]; then + mkdir -p /mnt/persist + echo "/dev/mmcblk0p29 /mnt/persist auto ro 0 0" >> /etc/fstab +fi diff --git a/device/device-motorola-thea/deviceinfo b/device/device-motorola-thea/deviceinfo new file mode 100644 index 000000000..3dcc0264a --- /dev/null +++ b/device/device-motorola-thea/deviceinfo @@ -0,0 +1,31 @@ +# Reference: +# Please use double quotes only. You can source this file in shell scripts. + +deviceinfo_format_version="0" +deviceinfo_name="Motorola Moto G 2014 LTE" +deviceinfo_manufacturer="Motorola" +deviceinfo_codename="motorola-thea" +deviceinfo_year="2014" +deviceinfo_keyboard="false" +deviceinfo_dtb="" +deviceinfo_modules_initfs="" +deviceinfo_external_storage="true" +deviceinfo_flash_method="fastboot" +deviceinfo_arch="armv7" + +# Splash screen +deviceinfo_screen_width="720" +deviceinfo_screen_height="1280" +deviceinfo_dev_touchscreen="/dev/input/event4" + +# Fastboot related +deviceinfo_flash_offset_base="0x00000000" +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_kernel_cmdline="androidboot.bootdevice=msm_sdcc.1 androidboot.hardware=qcom vmalloc=400M utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags buildvariant=userdebug" +deviceinfo_generate_bootimg="true" +deviceinfo_bootimg_qcdt="true" +deviceinfo_flash_sparse="true" diff --git a/device/device-motorola-thea/profile.sh b/device/device-motorola-thea/profile.sh new file mode 100644 index 000000000..d469a6b7f --- /dev/null +++ b/device/device-motorola-thea/profile.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# Run a few weston demos, because the postmarketos-demos program depends +# on xwayland for now (Alpine's GTK3 isn't configured for Wayland +# support yet.) +if [ $(tty) = "/dev/tty1" ]; then + ( + sleep 3; + export XDG_RUNTIME_DIR=/tmp/0-runtime-dir + weston-smoke & + weston-simple-damage & + weston-editor & + weston-terminal --shell=/usr/bin/htop & + ) > /dev/null & +fi + diff --git a/device/device-motorola-thea/weston.ini b/device/device-motorola-thea/weston.ini new file mode 100644 index 000000000..d94ea3a19 --- /dev/null +++ b/device/device-motorola-thea/weston.ini @@ -0,0 +1,11 @@ +# XWayland seems to be broken for this device. +# NOTE: This information might be outdated! simply delete /etc/xdg/weston/weston.ini +# after installation to check if it is still broken, and please report if it +# isn't broken anymore (or even better: make a pull request, that removes this +# config file). + +[core] +xwayland=false +backend=fbdev-backend.so +[shell] +background-image=/usr/share/wallpapers/postmarketos.jpg