This repository was archived by the owner on Mar 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 2626 without the _defconfig part.
2727 '' ;
2828 } ;
29+ firmware-partition-label = mkOption {
30+ default = "FIRMWARE" ;
31+ type = types . str ;
32+ description = "label of rpi firmware partition" ;
33+ } ;
2934 pin-inputs = {
3035 enable = mkOption {
3136 default = true ;
9499 {
95100 Type = "oneshot" ;
96101 MountImages =
97- "/dev/disk/by-label/FIRMWARE :${ firmware-path } " ;
102+ "/dev/disk/by-label/${ cfg . firmware-partition-label } :${ firmware-path } " ;
98103 StateDirectory = "raspberrypi-firmware" ;
99104 ExecStart = pkgs . writeShellScript "migrate-rpi-firmware" ''
100105 shopt -s nullglob
Original file line number Diff line number Diff line change 3030 } // optionalAttrs ( config . sdImage . rootPartitionUUID != null ) {
3131 uuid = config . sdImage . rootPartitionUUID ;
3232 } ) ;
33- in {
33+ in
34+ {
3435 imports = [ ] ;
3536
3637 options . sdImage = {
8283 '' ;
8384 } ;
8485
85- firmwarePartitionName = mkOption {
86- type = types . str ;
87- default = "FIRMWARE" ;
88- description = ''
89- Name of the filesystem which holds the boot firmware.
90- '' ;
91- } ;
92-
9386 rootPartitionUUID = mkOption {
9487 type = types . nullOr types . str ;
9588 default = null ;
160153 config = {
161154 fileSystems = {
162155 "/boot/firmware" = {
163- device = "/dev/disk/by-label/${ config . sdImage . firmwarePartitionName } " ;
156+ device = "/dev/disk/by-label/${ config . raspberry-pi-nix . firmware-partition-label } " ;
164157 fsType = "vfat" ;
165158 } ;
166159 "/" = {
226219 # Create a FAT32 /boot/firmware partition of suitable size into firmware_part.img
227220 eval $(partx $img -o START,SECTORS --nr 1 --pairs)
228221 truncate -s $((SECTORS * 512)) firmware_part.img
229- faketime "1970-01-01 00:00:00" mkfs.vfat -i ${ config . sdImage . firmwarePartitionID } -n ${ config . sdImage . firmwarePartitionName } firmware_part.img
222+ faketime "1970-01-01 00:00:00" mkfs.vfat -i ${ config . sdImage . firmwarePartitionID } -n ${ config . raspberry-pi-nix . firmware-partition-label } firmware_part.img
230223
231224 # Populate the files intended for /boot/firmware
232225 mkdir firmware
244237 zstd -T$NIX_BUILD_CORES --rm $img
245238 fi
246239 '' ;
247- } ) { } ;
240+ } )
241+ { } ;
248242
249243 boot . postBootCommands = lib . mkIf config . sdImage . expandOnBoot ''
250244 # On the first boot do some maintenance tasks
You can’t perform that action at this time.
0 commit comments