liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

ramdisk.nix (662B)


      1 {
      2   config
      3 , pkgs
      4 , lib
      5 , ...
      6 }:
      7 let
      8   inherit (lib) mkIf mkEnableOption mkOption; # types concatStringsSep;
      9 in {
     10   options = {
     11     boot = {
     12       ramdisk = {
     13         enable = mkEnableOption ''
     14           reserving part of memory as
     15           an MTD-based RAM disk.  Needed for TFTP booting or for
     16           kexec-based revertable upgrade
     17         '';
     18       };
     19     };
     20   };
     21   config = mkIf config.boot.ramdisk.enable {
     22     kernel = {
     23       config = {
     24         MTD = "y";
     25         MTD_PHRAM = "y";
     26         MTD_CMDLINE_PARTS = "y";
     27         MTD_OF_PARTS = "y";
     28         PARTITION_ADVANCED = "y";
     29         MTD_BLKDEVS = "y";
     30         MTD_BLOCK = "y";
     31       };
     32     };
     33   };
     34 }