Compare commits

...
Author SHA1 Message Date
Martijn Braam 2ef1e43baa linux-postmarketos-stable: add steamlink support 2019-08-01 22:51:43 +02:00
Martijn Braam b959eceec8 steamlink WIP 2019-08-01 22:51:20 +02:00
15 changed files with 3307 additions and 686 deletions

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-valve-steamlink"
pkgdesc="Valve SteamLink"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-valve-steamlink mesa-dri-swrast"
makedepends="devicepkg-dev kexec-tools-static"
source="
deviceinfo
factory_test.sh
kexec_load.ko
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -D -m755 "$srcdir"/factory_test.sh \
"$pkgdir"/boot/steamlink/factory_test/run.sh
install -D -m755 "$srcdir"/kexec_load.ko \
"$pkgdir"/boot/kexec_load.ko
# Package a minimum kexec system
install -D -m755 /usr/sbin/kexec \
"$pkgdir"/boot/kexec
install -D -m644 /lib/libc.musl-armv7.so.1 \
"$pkgdir"/boot/lib/libc.musl-armv7.so.1
install -D -m644 /usr/lib/liblzma.so.5 \
"$pkgdir"/boot/usr/lib/liblzma.so.5
install -D -m644 /lib/libz.so.1 \
"$pkgdir"/boot/lib/libz.so.1
}
sha512sums="176578a532d435c801aaeea5a01ff4a2be93faf4239792e46c35d63570fa9b4ff847a09d368056a0bc7345f8acdfc4115fc5e1f614c1fd51b7ea8e095543b549 deviceinfo
1b74ed9ec2548151eda93ea22105e8f99b40cfa346b4e86877ca19d2be3b577976cacb3b908079778fdbfbc001400a94a6f0d20fc1b0f94f555886ed85e726ed factory_test.sh
ae836b2aac526e0c0e65e6ea160e799afeec451943b4bb8df78ab8f246456ca34b468dcdfa97393592a17717d8e81b2f4b93e291e07b89b178b8c59ed5c1a900 kexec_load.ko"
+25
View 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="Valve SteamLink"
deviceinfo_manufacturer="Valve"
deviceinfo_codename="valve-steamlink"
deviceinfo_date=""
deviceinfo_dtb="berlin2cd-dongle"
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_keyboard="true"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1920"
deviceinfo_screen_height="1080"
deviceinfo_dev_touchscreen=""
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
disable_dhcpd="true"
# Bootloader related
deviceinfo_flash_method="none"
@@ -0,0 +1,31 @@
#!/bin/sh
# This script gets executed in the linux rootfs on the steamlink itself
echo "Resetting crashcounter"
fts-set steamlink.crashcounter 0
echo "Mounting stuff"
cd /mnt/disk
mkdir proc sys dev
mount -t proc proc /mnt/disk/proc
mount -o rbind /sys /mnt/disk/sys
mount -o rbind /dev /mnt/disk/dev
echo "Inserting kexec module into valve kernel"
insmod /mnt/disk/kexec_load.ko
chroot /mnt/disk /kexec -h
echo "Loading pmos kernel"
flavor="valve-steamlink"
chroot /mnt/disk /kexec \
-l /vmlinuz-${flavor} \
--initrd /initramfs-${flavor} \
--dtb /dtb-${flavor}.dtb \
--command-line "init=/init.sh rw console=tty0 console=ttyS0,115200 no_console_suspend panic=10 consoleblank=0 loglevel=1 PMOS_NO_OUTPUT_REDIRECT"
echo "Rebooting into pmos"
chroot /mnt/disk /kexec -e
echo "If you're reading this then something went wrong"
Binary file not shown.
Binary file not shown.
+82
View File
@@ -0,0 +1,82 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/bg2cd_penguin_mlc_defconfig
pkgname="linux-valve-steamlink"
pkgver=3.8.13
pkgrel=0
pkgdesc="Valve kernel from the SteamLink SDK"
arch="armv7"
_carch="arm"
_flavor="valve-steamlink"
url="https://github.com/ValveSoftware/steamlink-sdk/"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="steamlink-sdk"
_commit="9181b082be53c64daa83f36c7093a783fd07b464"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/ValveSoftware/${_repository}/archive/${_commit}.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
kernel-use-the-gnu89-standard-explicitly.patch
"
builddir="$srcdir/${_repository}-${_commit}/kernel"
prepare() {
default_prepare
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" modules
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" berlin2cd-dongle.dtb
}
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"
install -D "$builddir"/arch/arm/boot/dts/berlin2cd-dongle.dtb \
"$pkgdir"/usr/share/dtb/berlin2cd-dongle.dtb
}
sha512sums="b904a7b9148ec99e402985d4af5f0ffb1cd2aa6b6216dc106e107d06062d30e09b1ae4802114ecfbbeaecaa938dfa763adf67ba5027be8f3d7a1f720c94063bd linux-valve-steamlink-9181b082be53c64daa83f36c7093a783fd07b464.tar.gz
99246639421405ca5ca0ee9dc86dafe9b1f51fc9d229e69fe727caeb718c368d31458b522868af51b6b7f32f1c10649574cb6d5d49a432a051c098b80d6eb85e config-valve-steamlink.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch"
File diff suppressed because it is too large. Load diff
@@ -0,0 +1 @@
../../.shared-patches/linux/gcc7-give-up-on-ilog2-const-optimizations.patch
+1
View File
@@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch
@@ -0,0 +1 @@
../../.shared-patches/linux/kernel-use-the-gnu89-standard-explicitly.patch
+2 -2
View File
@@ -9,7 +9,7 @@ case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=0
pkgrel=1
arch="x86_64 armv7 aarch64"
pkgdesc="Linux for pmOS supported chipsets (stable)"
@@ -169,7 +169,7 @@ dev() {
}
sha512sums="ae96f347badc95f1f3acf506c52b6cc23c0bd09ce8f4ce6705d4b4058b62593059bba1bc603c8d8b00a2f19131e7e56c31ac62b45883a346fa61d655e178f236 linux-5.1.tar.xz
a428ce2a9c65bae3e7f88a43b0112e2524298ba068cf85732b25f18c5f92d101089ab3589582050c0dc9fca3571ea7fb89f9398d0c9dede03f1754b3f5fe455c config-postmarketos-stable.armv7
f2792f25a5106d2ff54107808246a43f589ac67d6911f7070ff49e4a4543d76d3574da76baf5dd39f5a31f9d08c61f6cd03e896b7f05640d88ffb974bcd53439 config-postmarketos-stable.armv7
b24240f2c8e011ffa1ff141cf8d623dcbe4cbde389322e59e264edf1b01985b3527576a06c1f0d8e5ef67519f95cc9a9ff9f2636178d00e4272cd472e268f1ec config-postmarketos-stable.aarch64
77ae0b80272d871475043cc17ae54e20d5456da8c729ea832906c2881389c53e4d800aaeab38090f3f878f15045b2c70dc4912b62742753c40f80ad69ed51599 config-postmarketos-stable.x86_64
793d61bbefe3587f95cf2b6eb56f3c60ef36512448ddcb1ab7c4fb614e14336e8d703f7cf188dfab46cb40d60511291b5163d2dae8c0bc950caeebd1e4e6c9c2 patch-5.1.5.xz"
File diff suppressed because it is too large. Load diff
+40
View File
@@ -0,0 +1,40 @@
# Contributor: Duncan Guthrie <dguthrie@posteo.net>
# Maintainer: Duncan Guthrie <dguthrie@posteo.net>
pkgname=kexec-tools-static
pkgver=2.0.16
pkgrel=1
pkgdesc="Directly boot into a new kernel over a currently running one"
url="https://kernel.org/pub/linux/utils/kernel/kexec/"
arch="all"
license="GPL-2.0"
depends="xz zlib"
makedepends="zlib-dev xz-dev linux-headers"
subpackages="$pkgname-doc"
source="https://www.kernel.org/pub/linux/utils/kernel/kexec/kexec-tools-$pkgver.tar.xz
kexec-tools-2.0.16-fix-config-sub.patch
aarch64-build-fix.patch"
builddir="$srcdir/kexec-tools-$pkgver"
options="!check"
build() {
cd "$builddir"
LDFLAGS=-static ./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--with-zlib \
--with-lzma
make
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="f2f06e7702fef20c8d7d6aabe1b264e2e2689e5c38cc00dbc2186dd7fa0479edb2dc9e307dd2ad7f03db47015e966e577f11576172604ef01c1bcca471fe2c24 kexec-tools-2.0.16.tar.xz
3c87540309dceda4c074d5822fd1a5d709ad533baed91dfd77aa64ebfe3850fc099c4b3d2bcc887c81ae53dc5940d17ccf34be25609beb37ed5ef7ed75862d43 kexec-tools-2.0.16-fix-config-sub.patch
77c2c33c28b85640646836da1709e898e1d94b92e0a83217664c64cb6606e10471235a396f30f8cae1315d67804851fc9cf8f201bc0b9e1d1f1f8344cd0e448d aarch64-build-fix.patch"
@@ -0,0 +1,12 @@
diff --git a/purgatory/arch/arm64/Makefile b/purgatory/arch/arm64/Makefile
index 636abea..9aad157 100644
--- a/purgatory/arch/arm64/Makefile
+++ b/purgatory/arch/arm64/Makefile
@@ -3,6 +3,7 @@ arm64_PURGATORY_EXTRA_CFLAGS = \
-mcmodel=large \
-fno-stack-protector \
-fno-asynchronous-unwind-tables \
+ -fno-PIC \
-Wundef \
-Werror-implicit-function-declaration \
-Wdeclaration-after-statement \
@@ -0,0 +1,10 @@
--- kexec-tools-2.0.16.old/config/config.sub 2016-12-09 09:42:06.000000000 +0000
+++ kexec-tools-2.0.16/config/config.sub 2017-12-13 19:35:19.248376862 +0000
@@ -124,6 +124,7 @@
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ linux-musl* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)