Skip to content

Instantly share code, notes, and snippets.

View Gnurou's full-sized avatar

Alexandre Courbot Gnurou

View GitHub Profile
@Gnurou
Gnurou / gist:9657726
Last active August 29, 2015 13:57
Configure Mesa for Nouveau/GBM usage
DRM: ./configure --prefix=$NVD --enable-tegra-experimental-api
Mesa: ./configure --without-dri-drivers --with-gallium-drivers=nouveau --enable-gallium-egl --enable-gbm --enable-egl --with-egl-platforms=drm,wayland --enable-gles1 --enable-gles2 --enable-opengl --prefix=$NVD
@Gnurou
Gnurou / gist:e42ec008c9fe378ae4c6
Created October 2, 2015 07:53
Prepare an Arch Linux Arm rootfs on an Android device
mount -obind /data/Linux/ArchLinuxArm /data/Linux/ArchLinuxArm
mount -t proc proc /data/Linux/ArchLinuxArm/proc
mount -obind /sys /data/Linux/ArchLinuxArm/sys/
mount -obind /dev /data/Linux/ArchLinuxArm/dev/
@Gnurou
Gnurou / gist:349a0fa6b4088d65a4a5
Created November 10, 2015 05:10
Apply a Nouveau patch to the Linux kernel
git am --directory drivers/gpu/ foo.patch
@Gnurou
Gnurou / gist:9505462f921d3ba3918e
Last active December 7, 2015 05:36
Falcon IMEM/DMEM dump functions
static void
falcon_dump_imem(struct nvkm_device *device, u32 base)
{
u32 imem_size = nvkm_rd32(device, base + 0x108) & 0x1ff;
u32 i;
u32 buf[8];
imem_size *= 0x100;
nvkm_wr32(device, 0x0010a180, 0x1 << 25);
@Gnurou
Gnurou / 50-joystick-shield.conf
Created September 16, 2013 04:48
X11 Joystick mappings for NVIDIA SHIELD. Allow to control mouse, scroll wheel, and main keyboard keys using the controller.
# JS config for NVIDIA SHIELD
# Axes:
# -----
# 1 Left stick H
# 2 Left stick V
# 3 Left trigger
# 4 Right stick H
# 5 Right stick V
# 6 Right trigger
# 7 Pad H
@Gnurou
Gnurou / Compile attr statically
Created October 30, 2013 05:57
How to make libtool produce static binaries even though it doesn't want to
$ ./configure --host=arm-none-linux-gnueabi
$ LDFLAGS=-all-static make
# -all-static is not recognized by GCC but will be processed by libtool
@Gnurou
Gnurou / 05-display.conf
Created November 12, 2013 03:09
Xorg display config for NVIDIA SHIELD.
Section "Device"
Identifier "Default Device"
Driver "fbdev"
Option "Rotate" "CW"
EndSection
@Gnurou
Gnurou / tegrarcmboot.py
Last active January 3, 2016 05:19
Simple script that boots a kernel using tegrarcm by creating an image containing U-boot and the kernel concatenated.
#!/bin/python3
# Simple script that boots a kernel using tegrarcm by creating an image
# containing U-boot and the kernel concatenated.
#
# Usage: boot.py board.bct zImage tegraxx-board.dtb
#
# The files listed below must be present in the working directory and
# can be obtained from U-boot.
@Gnurou
Gnurou / gist:9b3e9e78077b76d6930a
Created January 4, 2016 01:57
Script to convert KML files to GPX
#/bin/bash
for f in $*
do
unzip "$f" doc.kml
gpsbabel -i kml -f doc.kml -o gpx -F "${f%.kmz}.gpx"
rm doc.kml
done
@Gnurou
Gnurou / gist:121666303a811436a412
Created January 15, 2016 06:48
Script that rebases a bunch of branches and merges them into one.
# Usage: reb.sh branch_base new_base
set -e
git checkout --detach
oldbase=`git show-ref --heads -s "$1/base"`
branches=`git branch --list "$1/*"`
git checkout "$1/base"