NixOS on RISCV/VisionFive 2: Difference between revisions

Onny (talk | contribs)
Manually build a SD-card image: Configure different root filesystem type
Onny (talk | contribs)
Setup: Add note on required patch for btrfs root image
 
(4 intermediate revisions by the same user not shown)
Line 88: Line 88:
</nowiki>}}
</nowiki>}}


If you want to use an alternative filesystem for system root, for example [[Btrfs]], you could change the <code>sdImage</code>-part to this
If you want to use an alternative filesystem for system root, for example [[Btrfs]], you could change the <code>sdImage</code>-part to this. Currently [https://github.com/NixOS/nixpkgs/pull/434122 this patch] is required to produce a functioning btrfs image.


{{file|flake.nix|nix|<nowiki>
{{file|flake.nix|nix|<nowiki>
Line 97: Line 97:
   # might be too complex. btrfs uses its own resize command.
   # might be too complex. btrfs uses its own resize command.
   expandOnBoot = false;
   expandOnBoot = false;
};
nixpkgs.overlays = [
  (final: prev: {
    ubootVisionFive2 = prev.ubootVisionFive2.overrideAttrs (oldAttrs: {
      extraConfig = (oldAttrs.extraConfig or "") + ''
        CONFIG_FS_BTRFS=y
        CONFIG_CMD_BTRFS=y
      '';
    });
  })
];
fileSystems."/" = {
  fsType = lib.mkForce "btrfs";
  options = [
    "compress=zstd"
    "noatime"
  ];
};
};
</nowiki>}}
</nowiki>}}
You might need to adjust [[U-Boot]] configuration if you wish to boot other filesystems or filesystem features.


It might be helpful to add [[RISC-V#Binary cache|third-party binary cache configuration]] to this system configuration.
It might be helpful to add [[RISC-V#Binary cache|third-party binary cache configuration]] to this system configuration.