Skip to content

Instantly share code, notes, and snippets.

View dhess's full-sized avatar

Drew Hess dhess

View GitHub Profile
@dhess
dhess / gist:aee9edcdf672e6ddffb10bee7791a84c
Created July 24, 2017 01:31
NixOS aarch64 install image oops with nouveau driver
U-Boot 2016.11+dfsg1-4 (Mar 27 2017 - 18:39:51 +0000)
TEGRA210
Model: NVIDIA P2371-2180
Board: NVIDIA P2371-2180
DRAM: 3.5 GiB
MMC: Tegra SD/MMC: 0, Tegra SD/MMC: 1
In: serial
Out: serial
Err: serial
[root@nixos:/]# dmesg | grep -i xusb
[ 0.096804] OF: ERROR: Bad of_node_put() on /pmc@7000e400/powergates/xusba
[ 0.097121] OF: ERROR: Bad of_node_put() on /pmc@7000e400/powergates/xusbc
[ 0.427840] tegra-xusb-padctl 7009f000.padctl: failed to setup XUSB ports: -517
[ 2.350012] tegra-xusb 70090000.usb: 70090000.usb supply dvdd-pex-pll not found, using dummy regulator
[ 2.365506] tegra-xusb 70090000.usb: 70090000.usb supply hvdd-pex-pll-e not found, using dummy regulator
[ 2.397504] tegra-xusb 70090000.usb: Direct firmware load for nvidia/tegra210/xusb.bin failed with error -2
[ 2.408619] tegra-xusb 70090000.usb: failed to request firmware: -2
[ 2.414914] tegra-xusb 70090000.usb: failed to load firmware: -2
[ 2.421615] tegra-xusb: probe of 70090000.usb failed with error -2
@dhess
dhess / gist:74d8304344f5ef218b2d0ad950b08a3d
Created July 29, 2017 04:51
2017-07-28 aarch64 image on Jetson TX1
[0000.160] [TegraBoot] (version 00.00.2014.50-mobile-d44d4bf0)
[0000.166] Processing in cold boot mode Bootloader 2
[0000.170] A02 Bootrom Patch rev = 63
[0000.174] Power-up reason: reset button
[0000.177] No Battery Present
[0000.180] RamCode = 0
[0000.182] Platform has Ddr4 type ram
[0000.186] max77620 disabling SD1 Remote Sense
[0000.190] Setting Ddr voltage to 1125mv
[0000.194] Serial Number of Pmic Max77663: 0x2712ae
{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
let
modDirVersion = "4.4";
in
stdenv.lib.overrideDerivation (import ./generic.nix (args // rec {
version = "${modDirVersion}-l4t-r28.1";
inherit modDirVersion;
$ nix-build -A linux_jetson_tx1 -K
these derivations will be built:
/nix/store/vfr3hbganq78jkxz2ajxk172hiayxi0p-linux-config-4.4-l4t-r28.1.drv
/nix/store/6s1hzc7rjpf3sjcvkyiq3xj2mbsjmp7f-linux-4.4-l4t-r28.1.drv
building path(s) ‘/nix/store/1xvnicmlg1sw0l7iqyy1yipkhp3hqbrj-linux-config-4.4-l4t-r28.1’
unpacking sources
unpacking source archive /nix/store/l4lmx6ms9mnhx4cb303h4m7jakgxf092-source_release.tbz2
source root is sources
setting SOURCE_DATE_EPOCH to timestamp 1501033533 of file sources/kernel_src-tx2.tbz2
patching sources
clang -g -O2 -DHAVE_CONFIG_H -c -o wakelan.o wakelan.c
wakelan.c:39:26: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
static void *use_rcsid = (void *)((char *)&use_rcsid || (void *)&rcsid);
^
wakelan.c:49:5: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration]
exit (0);
^
wakelan.c:49:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
wakelan.c:65:10: warning: implicitly declaring library function 'toupper' with type 'int (int)' [-Wimplicit-function-declaration]
c = toupper(*str++);
NOTICE: BL31: v1.2(release):cc5fd7c
NOTICE: BL31: Built : 00:44:34, Jul 20 2017
NOTICE: Trusty image missing.
ERROR: Error initializing runtime service trusty_fast
[0001.137] I> Welcome to Cboot
[0001.140] I> Cboot Version: 00.00.2014.50-t186-96ecc32e
[0001.145] I> CPU-BL Params @ 0x277200000
[0001.149] I> 0) Base:0x00000000 Size:0x00000000
[0001.153] I> 1) Base:0x277f00000 Size:0x00100000
[0001.157] I> 2) Base:0x277e00000 Size:0x00100000
@dhess
dhess / default.nix
Created November 1, 2017 01:01
Fix php for macOS in Nixpkgs. Put the contents of this file in ~/.config/nixpkgs/overlays/default.nix
self: super:
{
php = super.stdenv.lib.overrideDerivation super.php (oldAttrs: {
CXXFLAGS = "-std=c++11";
});
}
@@ -159,7 +164,11 @@ in rec {
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { };
};
ghc802 = callPackage ../development/haskell-modules {
- ghc = compiler.ghc802;
+ ghc = if stdenv.system == "armv7l-linux" || stdenv.system == "aarch64-linux"
+ then
+ compiler.ghc802Arm
+ else
+ compiler.ghc802;
@dhess
dhess / 8.0.1-binary.nix
Last active September 24, 2019 08:07
GHC nixpkgs overlay for ARM hosts
{stdenv, lib, fetchurl, llvm_37, dpkg, perl, ncurses5, gmp, libffi, binutils, coreutils, makeWrapper }:
let
LD_LIBRARY_PATH = lib.makeLibraryPath
[ gmp libffi ncurses5 ];
in
stdenv.mkDerivation rec {
version = "8.0.1";
name = "ghc-${version}-binary";