From b29ee6c8ff11613c545dcd332f2f3ff37b00a068 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Fri, 20 Jan 2017 14:54:05 +0200 Subject: U-Boot: Add 64-bit Raspberry Pi 3 build And rename the old ubootRaspberryPi3 to ubootRaspberryPi3_32bit. --- nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix b/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix index 456ef7c9f541..ded8af0a6ce2 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix @@ -46,7 +46,7 @@ in cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/$f boot/ done cp ${pkgs.ubootRaspberryPi2}/u-boot.bin boot/u-boot-rpi2.bin - cp ${pkgs.ubootRaspberryPi3}/u-boot.bin boot/u-boot-rpi3.bin + cp ${pkgs.ubootRaspberryPi3_32bit}/u-boot.bin boot/u-boot-rpi3.bin cp ${configTxt} boot/config.txt ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot ''; -- cgit 1.4.1 From 0e4c1bfb43a4558fe9c2c420a907d40e757fa585 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Tue, 24 Jan 2017 00:52:25 +0200 Subject: installer: Add SD image expression for Aarch64 This one works on the Raspberry Pi 3 so far. --- .../modules/installer/cd-dvd/sd-image-aarch64.nix | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 nixos/modules/installer/cd-dvd/sd-image-aarch64.nix (limited to 'nixos') diff --git a/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix b/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix new file mode 100644 index 000000000000..517ddc75c87c --- /dev/null +++ b/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix @@ -0,0 +1,61 @@ +{ config, lib, pkgs, ... }: + +let + extlinux-conf-builder = + import ../../system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix { + inherit pkgs; + }; +in +{ + imports = [ + ../../profiles/minimal.nix + ../../profiles/installation-device.nix + ./sd-image.nix + ]; + + assertions = lib.singleton { + assertion = pkgs.stdenv.system == "aarch64-linux"; + message = "sd-image-aarch64.nix can be only built natively on Aarch64 / ARM64; " + + "it cannot be cross compiled"; + }; + + # Needed by RPi firmware + nixpkgs.config.allowUnfree = true; + + boot.loader.grub.enable = false; + boot.loader.generic-extlinux-compatible.enable = true; + + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelParams = ["console=ttyS0,115200n8" "console=tty0"]; + boot.consoleLogLevel = 7; + + # FIXME: this probably should be in installation-device.nix + users.extraUsers.root.initialHashedPassword = ""; + + sdImage = { + populateBootCommands = let + # Contains a couple of fixes for booting a Linux kernel, will hopefully appear upstream soon. + patchedUboot = pkgs.ubootRaspberryPi3_64bit.overrideAttrs (oldAttrs: { + src = pkgs.fetchFromGitHub { + owner = "dezgeg"; + repo = "u-boot"; + rev = "baab53ec244fe44def01948a0f10e67342d401e6"; + sha256 = "0r5j2pc42ws3w3im0a9c6bh01czz5kapqrqp0ik9ra823cw73lxr"; + }; + }); + + configTxt = pkgs.writeText "config.txt" '' + kernel=u-boot-rpi3.bin + arm_control=0x200 + enable_uart=1 + ''; + in '' + for f in bootcode.bin fixup.dat start.elf; do + cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/$f boot/ + done + cp ${patchedUboot}/u-boot.bin boot/u-boot-rpi3.bin + cp ${configTxt} boot/config.txt + ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot + ''; + }; +} -- cgit 1.4.1 From 32643dc07db92ed989c496f23037138802927dea Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Wed, 25 Jan 2017 15:07:37 +0200 Subject: installer: sd-image-*.nix: Document how to build them --- nixos/modules/installer/cd-dvd/sd-image-aarch64.nix | 2 ++ nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix | 2 ++ nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix | 2 ++ 3 files changed, 6 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix b/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix index 517ddc75c87c..8cf349fbd078 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix @@ -1,3 +1,5 @@ +# To build, use: +# nix-build nixos -I nixos-config=nixos/modules/installer/cd-dvd/sd-image-aarch64.nix -A config.system.build.sdImage { config, lib, pkgs, ... }: let diff --git a/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix b/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix index ded8af0a6ce2..76f5d4bf6472 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix @@ -1,3 +1,5 @@ +# To build, use: +# nix-build nixos -I nixos-config=nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix -A config.system.build.sdImage { config, lib, pkgs, ... }: let diff --git a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix index e7163f10a3c3..c7915b578d8a 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix @@ -1,3 +1,5 @@ +# To build, use: +# nix-build nixos -I nixos-config=nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix -A config.system.build.sdImage { config, lib, pkgs, ... }: let -- cgit 1.4.1