Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.

Commit 430202a

Browse files
committed
uboot: add package option
1 parent 35bb455 commit 430202a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

rpi/default.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ in
6868
cm4 with an nvme drive.
6969
'';
7070
};
71+
72+
package = mkPackageOption pkgs "uboot-rpi-arm64" {};
7173
};
7274
};
7375
};
@@ -99,7 +101,7 @@ in
99101
TARGET_FIRMWARE_DIR="${firmware-path}"
100102
TARGET_OVERLAYS_DIR="$TARGET_FIRMWARE_DIR/overlays"
101103
TMPFILE="$TARGET_FIRMWARE_DIR/tmp"
102-
UBOOT="${pkgs.uboot-rpi-arm64}/u-boot.bin"
104+
UBOOT="${cfg.uboot.package}/u-boot.bin"
103105
KERNEL="${kernel}/Image"
104106
SHOULD_UBOOT=${if cfg.uboot.enable then "1" else "0"}
105107
SRC_FIRMWARE_DIR="${pkgs.raspberrypifw}/share/raspberrypi/boot"
@@ -117,7 +119,7 @@ in
117119
cp "$UBOOT" "$TMPFILE"
118120
mv -T "$TMPFILE" "$TARGET_FIRMWARE_DIR/u-boot-rpi-arm64.bin"
119121
echo "${
120-
builtins.toString pkgs.uboot-rpi-arm64
122+
builtins.toString cfg.uboot.package
121123
}" > "$STATE_DIRECTORY/uboot-version"
122124
rm "$STATE_DIRECTORY/uboot-migration-in-progress"
123125
}
@@ -178,7 +180,7 @@ in
178180
}
179181
180182
if [[ "$SHOULD_UBOOT" -eq 1 ]] && [[ -f "$STATE_DIRECTORY/uboot-migration-in-progress" || ! -f "$STATE_DIRECTORY/uboot-version" || $(< "$STATE_DIRECTORY/uboot-version") != ${
181-
builtins.toString pkgs.uboot-rpi-arm64
183+
builtins.toString cfg.uboot.package
182184
} ]]; then
183185
migrate_uboot
184186
fi

sd-image/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
populate-kernel =
2727
if cfg.uboot.enable
2828
then ''
29-
cp ${pkgs.uboot-rpi-arm64}/u-boot.bin firmware/u-boot-rpi-arm64.bin
29+
cp ${cfg.uboot.package}/u-boot.bin firmware/u-boot-rpi-arm64.bin
3030
''
3131
else ''
3232
cp "${kernel}/Image" firmware/kernel.img

0 commit comments

Comments
 (0)