diff options
author | Samuel Dionne-Riel <samuel@dionne-riel.com> | 2020-06-10 21:30:22 -0400 |
---|---|---|
committer | Samuel Dionne-Riel <samuel@dionne-riel.com> | 2020-06-11 14:41:18 -0400 |
commit | 34caab71bbd2ae342c65667cc999a3be8a1ad336 (patch) | |
tree | 39cbb82076de44d7ff9288dd8711b436c8c1b3bd | |
parent | 37e50ca63513072d7024a3c44500684b4f2e032b (diff) | |
download | nixpkgs-34caab71bbd2ae342c65667cc999a3be8a1ad336.tar nixpkgs-34caab71bbd2ae342c65667cc999a3be8a1ad336.tar.gz nixpkgs-34caab71bbd2ae342c65667cc999a3be8a1ad336.tar.bz2 nixpkgs-34caab71bbd2ae342c65667cc999a3be8a1ad336.tar.lz nixpkgs-34caab71bbd2ae342c65667cc999a3be8a1ad336.tar.xz nixpkgs-34caab71bbd2ae342c65667cc999a3be8a1ad336.tar.zst nixpkgs-34caab71bbd2ae342c65667cc999a3be8a1ad336.zip |
sd-image: Make firmware partition name configurable
This will be helpful in the now too-long-lived image for the Raspberry Pi 4. We'll be able to properly configure the partition to be useful.
-rw-r--r-- | nixos/modules/installer/cd-dvd/sd-image.nix | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/nixos/modules/installer/cd-dvd/sd-image.nix b/nixos/modules/installer/cd-dvd/sd-image.nix index 589bf74263b..d0ef55bd0e1 100644 --- a/nixos/modules/installer/cd-dvd/sd-image.nix +++ b/nixos/modules/installer/cd-dvd/sd-image.nix @@ -63,6 +63,14 @@ in ''; }; + firmwarePartitionName = mkOption { + type = types.str; + default = "FIRMWARE"; + description = '' + Name of the filesystem which holds the boot firmware. + ''; + }; + rootPartitionUUID = mkOption { type = types.nullOr types.str; default = null; @@ -114,7 +122,7 @@ in config = { fileSystems = { "/boot/firmware" = { - device = "/dev/disk/by-label/FIRMWARE"; + device = "/dev/disk/by-label/${config.sdImage.firmwarePartitionName}"; fsType = "vfat"; # Alternatively, this could be removed from the configuration. # The filesystem is not needed at runtime, it could be treated @@ -178,7 +186,7 @@ in # Create a FAT32 /boot/firmware partition of suitable size into firmware_part.img eval $(partx $img -o START,SECTORS --nr 1 --pairs) truncate -s $((SECTORS * 512)) firmware_part.img - faketime "1970-01-01 00:00:00" mkfs.vfat -i ${config.sdImage.firmwarePartitionID} -n FIRMWARE firmware_part.img + faketime "1970-01-01 00:00:00" mkfs.vfat -i ${config.sdImage.firmwarePartitionID} -n ${config.sdImage.firmwarePartitionName} firmware_part.img # Populate the files intended for /boot/firmware mkdir firmware |