From 82ae8a31ae0ff64c0b6c603634f41a4472cce657 Mon Sep 17 00:00:00 2001 From: Jakob Leifhelm Date: Sun, 16 Apr 2023 22:53:29 +0200 Subject: [PATCH] starfive-visionfive2: Add README.md --- starfive/visionfive/v2/README.md | 53 +++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/starfive/visionfive/v2/README.md b/starfive/visionfive/v2/README.md index 10496e7..4dea95f 100644 --- a/starfive/visionfive/v2/README.md +++ b/starfive/visionfive/v2/README.md @@ -1,5 +1,56 @@ -# Creating SD-Image +# Creating a SD-Image +Create and configure the `flake.nix` file: ``` nix +{ + # Kernel is broken on riscv64 see https://github.com/NixOS/nixpkgs/issues/225756 + inputs.nixpkgs.url = + "github:nixos/nixpkgs/c3e12e57c3e3d5c84cc500420be4507b3de33e90"; + inputs.nixos-hardware.url = "github:nixos/nixos-hardware"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + outputs = { self, nixpkgs, nixos-hardware, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + rec { + packages.default = packages.sd-image; + packages.sd-image = (import "${nixpkgs}/nixos" { + configuration = + { config, ... }: { + imports = [ + "${nixos-hardware}/starfive/visionfive/v2/sd-image-installer.nix" + ]; + # If you want to use ssh set a password + # users.users.nixos.password = "super secure password"; + # OR add your public ssh key + # users.users.nixos.openssh.authorizedKeys.keys = [ "ssh-rsa ..." ]; + + # AND configure networking + # networking.interfaces.end0.useDHCP = true; + # networking.interfaces.end1.useDHCP = true; + + # If you have the 2A variant uncomment the following line + # hardware.deviceTree.name = + # lib.mkDefault "starfive/jh7110-starfive-visionfive-2-v1.2a.dtb"; + + # Additional configuration goes here + + sdImage.compressImage = false; + + nixpkgs.crossSystem = { + config = "riscv64-unknown-linux-gnu"; + system = "riscv64-linux"; + }; + + system.stateVersion = "23.05"; + }; + inherit system; + }).config.system.build.sdImage; + }); +} +``` + +Build the sd image. + +``` sh +nix build .# ```