-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
most of the changes to make rpi and nix work on not-os
- Loading branch information
1 parent
3241413
commit 832baa7
Showing
10 changed files
with
312 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ stdenv, fetchFromGitHub, perl, buildLinux, ... } @ args: | ||
|
||
let | ||
modDirVersion = "4.4.36"; | ||
tag = "1.20161020-1"; | ||
in | ||
stdenv.lib.overrideDerivation (import <nixpkgs/pkgs/os-specific/linux/kernel/generic.nix> (args // rec { | ||
version = "${modDirVersion}-${tag}"; | ||
inherit modDirVersion; | ||
|
||
src = fetchFromGitHub { | ||
owner = "raspberrypi"; | ||
repo = "linux"; | ||
rev = "c6d86f7aa554854b04614ebb4d394766081fb41f"; | ||
sha256 = "13rjmks4whh7kn0wrswanwq3b0ia9bxsq8a6xiqiivh6k3vxqhys"; | ||
}; | ||
|
||
features.iwlwifi = true; | ||
features.needsCifsUtils = true; | ||
features.canDisableNetfilterConntrackHelpers = true; | ||
features.netfilterRPFilter = true; | ||
|
||
extraMeta.hydraPlatforms = []; | ||
})) (oldAttrs: { | ||
postConfigure = '' | ||
# The v7 defconfig has this set to '-v7' which screws up our modDirVersion. | ||
sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/' | ||
''; | ||
|
||
postFixup = '' | ||
# Make copies of the DTBs so that U-Boot finds them, as it is looking for the upstream names. | ||
# This is ugly as heck. | ||
copyDTB() { | ||
if [ -f "$out/dtbs/$1" ]; then | ||
cp -v "$out/dtbs/$1" "$out/dtbs/$2" | ||
fi | ||
} | ||
# I am not sure if all of these are correct... | ||
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb | ||
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb | ||
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb | ||
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb | ||
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb | ||
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb | ||
copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb | ||
copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb | ||
copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb | ||
''; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ ... }: | ||
|
||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ ... }: | ||
|
||
{ | ||
boot.initrd.kernelModules = [ "virtio" "virtio_pci" "virtio_net" "virtio_rng" "virtio_blk" "virtio_console" ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ config, pkgs, ... }: | ||
|
||
{ | ||
nixpkgs.system = "armv7l-linux"; | ||
system.build.rpi_image = let | ||
config_txt = pkgs.writeText "config.txt" '' | ||
initramfs initrd followkernel | ||
dtoverlay=pi3-disable-bt | ||
enable_uart=1 | ||
''; | ||
cmdline = pkgs.writeText "cmdline.txt" '' | ||
console=ttyS0,115200 pi3-disable-bt kgdboc=ttyS0,115200 systemConfig=${builtins.unsafeDiscardStringContext config.system.build.toplevel} netroot=192.168.2.1=9080d9b6/root.squashfs quiet splash plymouth.ignore-serial-consoles plymouth.ignore-udev | ||
''; | ||
in pkgs.runCommand "rpi_image" {} '' | ||
mkdir $out | ||
cd $out | ||
cp ${config_txt} config.txt | ||
cp ${cmdline} cmdline.txt | ||
cp -s ${config.system.build.kernel}/*zImage kernel7.img | ||
cp -s ${config.system.build.squashfs} root.squashfs | ||
cp ${./../bcm2710-rpi-3-b.dtb} bcm2710-rpi-3-b.dtb | ||
cp -r ${./../../overlays} overlays | ||
cp -s ${../../start.elf} start.elf | ||
cp ${../../fixup.dat} fixup.dat | ||
cp -s ${config.system.build.initialRamdisk}/initrd initrd | ||
ls -ltrhL | ||
''; | ||
environment.systemPackages = [ pkgs.strace ]; | ||
nixpkgs.config.packageOverrides = pkgs: { | ||
linux_rpi = pkgs.callPackage ./linux-rpi.nix {}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.