Skip to content
Snippets Groups Projects
Unverified Commit 94d5efbc authored by Dang Huynh's avatar Dang Huynh Committed by Oliver Smith
Browse files

chuwi-hi10plus: new device (CHUWI Hi10 Plus) (!347)

This port uses the Android bootloader (kernelflinger) instead of
Gummiboot or rEFInd,... just in case if people still want to easily
reflash Android later without going through some DNX Fastboot, Intel
Flash Tool blah blah.

Chuwi violates GPLv2 by not releasing the kernel sources of Android to
the public. This port uses Linux mainline (5.1-rc7), and almost
everything works properly, so thankfully we don't have to use the 3.10
kernel which is outdated and EOL.

[ci:skip-build]: kernel takes more than an hour to compile on CI.
                 ollieparanoid made sure that everything builds.
parent f343cb5a
No related branches found
No related tags found
No related merge requests found
Pipeline #192265 passed
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-chuwi-hi10plus"
pkgdesc="CHUWI Hi10 Plus"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="x86_64"
options="!check !archcheck"
depends="postmarketos-base linux-chuwi-hi10plus mkbootimg mesa-dri-intel libva-intel-driver libsparse wireless-regdb pulseaudio pulseaudio-alsa alsa-plugins-pulse"
makedepends="devicepkg-dev"
subpackages="
$pkgname-nonfree-firmware:nonfree_firmware
$pkgname-x11
$pkgname-weston
"
source="deviceinfo
initfs-hook.sh
weston.ini"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -D -m644 "$srcdir"/initfs-hook.sh \
"$pkgdir"/etc/postmarketos-mkinitfs/hooks/00-${pkgname}.sh
}
x11() {
install_if="$pkgname xorg-server"
depends="xf86-video-intel gstreamer-vaapi"
mkdir "$subpkgdir"
}
weston() {
install_if="$pkgname weston"
install -Dm644 "$srcdir"/weston.ini \
"$subpkgdir"/etc/xdg/weston/weston.ini
}
nonfree_firmware() {
pkgdesc="Touch, Wi-Fi, Bluetooth, Sound Firmware"
depends="firmware-chuwi-hi10plus linux-firmware-intel linux-firmware-rtlwifi linux-firmware-rtl_bt"
mkdir "$subpkgdir"
}
sha512sums="519a4add79bbf8ded51fb45affac03c59bd5f5e34b4a7e0f77baa5d007cf3a72349b494105c35ba50a52632bf20dd01c8db9bcf625a47196cf4d2b18342c5f51 deviceinfo
8191c479588ccd0c44d23a06cee975635ad9353a7469489c3436ca22051410ff5153dccfb38284dd3976fd6bb8ea6979d32224b652ce68b51f4448c2aa8fc9dd initfs-hook.sh
15497cf556750d2b91ef81dab7c4071dc5d1d62bab6f98db0b240e74d8b26ebcda5af2f80fe998518c3b53e72e0daa762d063c87dff46d73d70a8d879cb9aaa8 weston.ini"
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="CHUWI Hi10 Plus"
deviceinfo_manufacturer="CHUWI"
deviceinfo_codename="chuwi-hi10plus"
deviceinfo_date="2016"
deviceinfo_dtb=""
deviceinfo_modules_initfs="gslx680_ts_acpi"
deviceinfo_arch="x86_64"
# Device related
deviceinfo_keyboard="true"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1920"
deviceinfo_screen_height="1280"
deviceinfo_dev_touchscreen="/dev/input/event4"
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="add_efi_memmap PMOS_NO_OUTPUT_REDIRECT"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_sparse=true
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"
#!/bin/sh
# If the device is booted from kernelflinger bootloader,
# there is a watchdog running as soon the device load it's kernel.
#
# When watchdog is running, the system will reboot after 100 seconds,
#
# The script below will run "Magic Close", which will stop the timer. (thanks lambdadroid)
# http://lxr.free-electrons.com/source/Documentation/watchdog/watchdog-api.txt
# snip from device-nokia-n9 (initfs-hook.sh)
for wd in /dev/watchdog*; do
[ -c $wd ] && echo V > $wd
done
# DRM is enabled on this tablet, so we'll use DRM as backend on Weston.
[core]
xwayland=true
backend=drm-backend.so
[shell]
background-image=/usr/share/wallpapers/postmarketos.jpg
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: <https://git.archlinux.org/svntogit/packages.git/plain/trunk/config?h=packages/linux>
pkgname="linux-chuwi-hi10plus"
pkgver=5.1
pkgrel=0
pkgdesc="Chuwi Hi10 Plus mainline kernel"
arch="x86_64"
_carch="x86"
_flavor="chuwi-hi10plus"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps !pmb:kconfigcheck"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev
devicepkg-dev bison flex openssl-dev xz coreutils findutils"
subpackages="$pkgname-dev"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="linux"
_commit="e93c9c99a629c61837d5a7fc2120cd2b6c70dbdd"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/torvalds/${_repository}/archive/${_commit}.tar.gz
$_config
0001-input-touchscreen-gslx680_ts_acpi-Add-driver-from-on.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"
}
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
cd "$builddir"
make -j1 modules_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_DTBS_PATH="$pkgdir/usr/share/dtb"
}
dev() {
cd $builddir
# https://github.com/torvalds/linux/blob/master/Documentation/kbuild/headers_install.txt
make -j1 headers_install \
ARCH="$_carch" \
INSTALL_HDR_PATH="$subpkgdir"/usr
}
sha512sums="a2a4463056bbec1187f2a113e514dd58ed8f8e74a4c6dbe4477ba635c12d8a8bc50d431168579ee22f720ef799b21033ea52425a0c0a79849a96783545034ff5 linux-chuwi-hi10plus-e93c9c99a629c61837d5a7fc2120cd2b6c70dbdd.tar.gz
b477c78f842961ac1887bbaf8018030e1e9a1ff865a36e57784427884695fa923aa314d0d4abc1ebd48b2b08f18e0b0ecd9280975933eace521715a55f80c342 config-chuwi-hi10plus.x86_64
a545d9a0cab4b30ed1a012a6a3a27df3dd9d44d096d0832c938ba5a14c54bc5c7a9cce12fe7b5a6797db676f6275b1308a2febb715a4faf653eb3c1ee3a32857 0001-input-touchscreen-gslx680_ts_acpi-Add-driver-from-on.patch"
This diff is collapsed.
/lib/firmware/silead_ts.fw
pkgname=firmware-chuwi-hi10plus
pkgver=0.1
pkgrel=0
pkgdesc="Firmware for Chuwi Hi10 Plus"
url="https://github.com/onitake/gsl-firmware"
arch="x86_64"
license="proprietary"
depends=""
source="https://github.com/onitake/gsl-firmware/raw/master/firmware/chuwi/hi10_plus/silead_ts.fw
20-touchscreen-firmware.files"
options="!strip !check !archcheck"
package() {
install -Dm644 "$srcdir/silead_ts.fw" \
"$pkgdir/lib/firmware/silead_ts.fw"
install -Dm644 "$srcdir/20-touchscreen-firmware.files" \
"$pkgdir/etc/postmarketos-mkinitfs/files/20-touchscreen-firmware.files"
}
sha512sums="00f2e99f8966dc50be0c2c21750eb729b7cec4408e962a8da6c0ee5ba2d26937711bcd09466019912f82022839dacf11ae1cf2760d2bc6a6a9321afb049c2ef8 silead_ts.fw
99db65efe61bd0a4b85f98adb69f7faef974d83135f2d0e8ca38fe009c71dc7b3f77bb856e05299aa92af5bf343c9c7f35a12889180bbf7c087f802dffecf6d3 20-touchscreen-firmware.files"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment