Skip to content
Snippets Groups Projects
Unverified Commit b959ecee authored by Martijn Braam's avatar Martijn Braam
Browse files

steamlink WIP

parent eb154010
Branches
No related tags found
No related merge requests found
Showing
with 2410 additions and 0 deletions
# 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"
# 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"
#!/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"
File added
File added
# 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"
This diff is collapsed.
../../.shared-patches/linux/gcc7-give-up-on-ilog2-const-optimizations.patch
\ No newline at end of file
../../.shared-patches/linux/gcc8-fix-put-user.patch
\ No newline at end of file
../../.shared-patches/linux/kernel-use-the-gnu89-standard-explicitly.patch
\ No newline at end of file
# 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"
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 \
--- 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*)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment