Add Teclast X80 Pro (EFI/x86_64 tablet) (#1050)
This commit is contained in:
parent
6666f8a984
commit
2a951d962d
6 changed files with 8679 additions and 3 deletions
24
device/device-teclast-x80pro/APKBUILD
Normal file
24
device/device-teclast-x80pro/APKBUILD
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
# See wiki: <https://wiki.postmarketos.org/wiki/Teclast_X80_Pro_(teclast-x80pro)> for installation information
|
||||
# This package is also likely to work for most Intel based, EFI booting tablets (and laptops).
|
||||
pkgname="device-teclast-x80pro"
|
||||
pkgdesc="Teclast X80Pro"
|
||||
pkgver=1.0
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="noarch"
|
||||
options="!check"
|
||||
depends="linux-teclast-x80pro linux-firmware"
|
||||
makedepends="devicepkg-dev"
|
||||
source="deviceinfo"
|
||||
|
||||
build() {
|
||||
devicepkg_build $startdir $pkgname
|
||||
}
|
||||
|
||||
package() {
|
||||
devicepkg_package $startdir $pkgname
|
||||
}
|
||||
|
||||
sha512sums="18e6b8d59378fea9eb7f41b9aae755e493ea62dc199eb8f3f25ee4d55a1b823d80e881845941933067aea11e722b4fd0de097e38f32f64392ee1fd21256d08ec deviceinfo"
|
25
device/device-teclast-x80pro/deviceinfo
Normal file
25
device/device-teclast-x80pro/deviceinfo
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Reference: <https://postmarketos.org/deviceinfo>
|
||||
# Please use double quotes only. You can source this file in shell scripts.
|
||||
|
||||
deviceinfo_format_version="0"
|
||||
deviceinfo_name="Teclast X80 Pro"
|
||||
deviceinfo_manufacturer="Teclast"
|
||||
deviceinfo_date=""
|
||||
deviceinfo_dtb=""
|
||||
deviceinfo_modules_initfs="i915 usbhid usb-storage hid_generic sdhci_acpi mmc_block xhci_pci sd_mod"
|
||||
deviceinfo_external_disk="true"
|
||||
deviceinfo_external_disk_install="false"
|
||||
deviceinfo_arch="x86_64"
|
||||
|
||||
# Device related
|
||||
deviceinfo_keyboard="false"
|
||||
deviceinfo_external_disk="true"
|
||||
deviceinfo_screen_width="1200"
|
||||
deviceinfo_screen_height="1920"
|
||||
deviceinfo_dev_touchscreen="/dev/input/event5"
|
||||
deviceinfo_dev_touchscreen_calibration=""
|
||||
deviceinfo_dev_keyboard=""
|
||||
|
||||
# Bootloader related
|
||||
# See wiki for this device. Installation procedure is non-standard.
|
||||
deviceinfo_flash_method="none"
|
183
device/linux-teclast-x80pro/APKBUILD
Normal file
183
device/linux-teclast-x80pro/APKBUILD
Normal file
|
@ -0,0 +1,183 @@
|
|||
# Note that this is equivalent to postmarketos-stable with the kernel config from Arch Linux.
|
||||
# TODO: Merge the two packages so that the teclast-x80pro is on actual mainline/stable kernel.
|
||||
# The default QEMU kernel config is missing too many options to allow it to boot on a real x86_64 platform.
|
||||
_flavor=teclast-x80pro
|
||||
_hash="7b6fbfd899b4133e4f789843e5967beb139ec4d2"
|
||||
_config="config-${_flavor}.${CARCH}"
|
||||
|
||||
pkgname=linux-${_flavor}
|
||||
|
||||
pkgver=4.14.2
|
||||
case $pkgver in
|
||||
*.*.*) _kernver=${pkgver%.*};;
|
||||
*.*) _kernver=$pkgver;;
|
||||
esac
|
||||
pkgrel=0
|
||||
|
||||
arch="x86_64"
|
||||
pkgdesc="Linux for pmOS supported chipsets (stable)"
|
||||
url="https://kernel.org/"
|
||||
depends="postmarketos-mkinitfs"
|
||||
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev libressl-dev"
|
||||
options="!strip !check !tracedeps"
|
||||
install=
|
||||
source="
|
||||
https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$_kernver.tar.xz
|
||||
config-${_flavor}.x86_64
|
||||
"
|
||||
|
||||
if [ "${pkgver%.0}" = "$pkgver" ]; then
|
||||
source="$source
|
||||
https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/patch-$pkgver.xz"
|
||||
fi
|
||||
subpackages="$pkgname-dev::$CBUILD_ARCH"
|
||||
|
||||
license="GPL2"
|
||||
_abi_release=${pkgver}
|
||||
_carch=${CARCH}
|
||||
case "$_carch" in
|
||||
aarch64*) _carch="arm64" ;;
|
||||
arm*) _carch="arm" ;;
|
||||
ppc*) _carch="powerpc" ;;
|
||||
s390*) _carch="s390" ;;
|
||||
esac
|
||||
|
||||
HOSTCC="${CC:-gcc}"
|
||||
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
|
||||
|
||||
ksrcdir="$srcdir/linux-$_kernver"
|
||||
|
||||
prepare() {
|
||||
local _patch_failed=
|
||||
cd "$ksrcdir"
|
||||
if [ "$_kernver" != "$pkgver" ]; then
|
||||
msg "Applying patch-$pkgver.xz"
|
||||
unxz -c < "$srcdir"/patch-$pkgver.xz | patch -p1 -N
|
||||
fi
|
||||
|
||||
# first apply patches in specified order
|
||||
for i in $source; do
|
||||
case $i in
|
||||
*.patch)
|
||||
msg "Applying $i..."
|
||||
if ! patch -s -p1 -N -i "$srcdir"/$i; then
|
||||
echo $i >>failed
|
||||
_patch_failed=1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if ! [ -z "$_patch_failed" ]; then
|
||||
error "The following patches failed:"
|
||||
cat failed
|
||||
return 1
|
||||
fi
|
||||
|
||||
mkdir -p "$srcdir"/build
|
||||
cp -v "$srcdir"/$_config "$srcdir"/build/.config
|
||||
make -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \
|
||||
olddefconfig
|
||||
}
|
||||
|
||||
|
||||
|
||||
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
|
||||
menuconfig() {
|
||||
cd "$srcdir"/build
|
||||
make ARCH="$_carch" menuconfig
|
||||
cp .config "$startdir"/$_config
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$srcdir"/build
|
||||
unset LDFLAGS
|
||||
make ARCH="$_carch" CC="${CC:-gcc}" \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
|
||||
CFLAGS_MODULE=-fno-pic
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/build/arch/${_carch}/boot"
|
||||
|
||||
if [ "$CARCH" == "aarch64" ]; then
|
||||
install -Dm644 "$srcdir/build/arch/${_carch}/boot/Image" \
|
||||
"$pkgdir/boot/vmlinuz-$_flavor"
|
||||
else
|
||||
install -Dm644 "$srcdir/build/arch/${_carch}/boot/"*zImage \
|
||||
"$pkgdir/boot/vmlinuz-$_flavor"
|
||||
fi
|
||||
|
||||
install -D "$srcdir/build/include/config/kernel.release" \
|
||||
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
|
||||
|
||||
cd "$srcdir"/build
|
||||
|
||||
local _install
|
||||
case "$CARCH" in
|
||||
aarch64*|arm*) _install="modules_install dtbs_install" ;;
|
||||
*) _install="modules_install" ;;
|
||||
esac
|
||||
|
||||
make -j1 $_install \
|
||||
ARCH="$_carch" \
|
||||
INSTALL_MOD_PATH="$pkgdir" \
|
||||
INSTALL_DTBS_PATH="$pkgdir/usr/share/dtb"
|
||||
}
|
||||
|
||||
|
||||
dev() {
|
||||
# copy the only the parts that we really need for build 3rd party
|
||||
# kernel modules and install those as /usr/src/linux-headers,
|
||||
# simlar to what ubuntu does
|
||||
#
|
||||
# this way you dont need to install the 300-400 kernel sources to
|
||||
# build a tiny kernel module
|
||||
#
|
||||
pkgdesc="Headers and script for third party modules for postmarketos kernel"
|
||||
depends="gmp-dev bash perl"
|
||||
local dir="$subpkgdir"/usr/src/linux-headers-${_abi_release}
|
||||
|
||||
# first we import config, run prepare to set up for building
|
||||
# external modules, and create the scripts
|
||||
mkdir -p "$dir"
|
||||
cp "$srcdir"/$_config "$dir"/.config
|
||||
make -j1 -C "$srcdir"/linux-$_kernver O="$dir" ARCH="$_carch" HOSTCC="$HOSTCC" \
|
||||
olddefconfig prepare modules_prepare scripts
|
||||
|
||||
# needed for 3rd party modules
|
||||
# https://bugzilla.kernel.org/show_bug.cgi?id=11143
|
||||
case "$CARCH" in
|
||||
ppc*) (cd "$dir" && make arch/powerpc/lib/crtsavres.o);;
|
||||
esac
|
||||
|
||||
# remove the stuff that points to real sources. we want 3rd party
|
||||
# modules to believe this is the soruces
|
||||
rm "$dir"/Makefile "$dir"/source
|
||||
|
||||
# copy the needed stuff from real sources
|
||||
#
|
||||
# this is taken from ubuntu kernel build script
|
||||
# http://kernel.ubuntu.com/git/ubuntu/ubuntu-zesty.git/tree/debian/rules.d/3-binary-indep.mk
|
||||
|
||||
cd "$srcdir"/linux-$_kernver
|
||||
find . -path './include/*' -prune \
|
||||
-o -path './scripts/*' -prune -o -type f \
|
||||
\( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
|
||||
-name '*.sh' -o -name '*.pl' -o -name '*.lds' \) \
|
||||
-print | cpio -pdm "$dir"
|
||||
cp -a scripts include "$dir"
|
||||
find $(find arch -name include -type d -print) -type f \
|
||||
| cpio -pdm "$dir"
|
||||
|
||||
install -Dm644 "$srcdir"/build/Module.symvers \
|
||||
"$dir"/Module.symvers
|
||||
|
||||
mkdir -p "$subpkgdir"/lib/modules/${_abi_release}
|
||||
ln -sf /usr/src/linux-headers-${_abi_release} \
|
||||
"$subpkgdir"/lib/modules/${_abi_release}/build
|
||||
}
|
||||
|
||||
sha512sums="77e43a02d766c3d73b7e25c4aafb2e931d6b16e870510c22cef0cdb05c3acb7952b8908ebad12b10ef982c6efbe286364b1544586e715cf38390e483927904d8 linux-4.14.tar.xz
|
||||
2bd6a0264a249cf3d1119cc86c39c29114ed583472635788aceb9c0a59e306b50f030eb9f27fad98df35a9b7e1f8b42bae01b00bedaa1d21015bbd6ab656a615 config-teclast-x80pro.x86_64
|
||||
04415954c3c4d3044a6a3da979e59fb18f0eda3fd872a8036ac8947fbbadcd6041384a900973b917353de6e5c1a589eff1db63c029edcb78f38b07868a929f9d patch-4.14.2.xz"
|
8437
device/linux-teclast-x80pro/config-teclast-x80pro.x86_64
Normal file
8437
device/linux-teclast-x80pro/config-teclast-x80pro.x86_64
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
pkgname=postmarketos-mkinitfs
|
||||
pkgver=0.5.5
|
||||
pkgver=0.5.6
|
||||
pkgrel=0
|
||||
pkgdesc="Tool to generate initramfs images for postmarketOS"
|
||||
url="https://github.com/postmarketOS"
|
||||
|
@ -23,5 +23,5 @@ package() {
|
|||
mkdir -p "$pkgdir/etc/postmarketos-mkinitfs/hooks/"
|
||||
}
|
||||
sha512sums="9eaf7c1fa3bd8c4e065b523dbdf98cd5d002629c1691d388feca8ae7784ffc8e901d92265d6538fd92689483673a65e175e8b8b2c893bbe5746a07ff20a65e82 init.sh.in
|
||||
cf2bbf7908032bee827676fe218bebc0171a84417f9e93cf20809b3d9392f4d0d84c33023960519170024d5c38e392d39a77640dbeed324fa4f96a71798920ad init_functions.sh
|
||||
eca1e4647494556be52b3eecffe2db75735006a6c53e8778630949808aabc464281ffa75a8744e22a5512c2de1eb5f92f9eb377a55ca4a7402ba8cc0705df83d init_functions.sh
|
||||
5bb521186c5f6586136ab3edb13d2ba44c00a84e9d18f255f5e92305bf78ff5aa9bd414d7a50eda4168e5c6eadd87d62fd4169f370fd18e0ebd291fcf2103a9f mkinitfs.sh"
|
||||
|
|
|
@ -48,7 +48,14 @@ mount_subpartitions() {
|
|||
2)
|
||||
echo "Mount subpartitions of $i"
|
||||
kpartx -afs "$i"
|
||||
break
|
||||
# Ensure that this was the *correct* subpartition
|
||||
# Some devices have mmc partitions that appear to have
|
||||
# subpartitions, but aren't our subpartition.
|
||||
if blkid | grep -q "pmOS_boot"; then
|
||||
break
|
||||
fi
|
||||
kpartx -d "$i"
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue