nixos/sd-image-raspberrypi: Support Raspberry Pi Zero
This commit is contained in:
parent
912e87c45c
commit
f49906d80c
|
@ -31,10 +31,23 @@ in
|
||||||
users.extraUsers.root.initialHashedPassword = "";
|
users.extraUsers.root.initialHashedPassword = "";
|
||||||
|
|
||||||
sdImage = {
|
sdImage = {
|
||||||
populateBootCommands = ''
|
populateBootCommands = let
|
||||||
|
configTxt = pkgs.writeText "config.txt" ''
|
||||||
|
# Prevent the firmware from smashing the framebuffer setup done by the mainline kernel
|
||||||
|
# when attempting to show low-voltage or overtemperature warnings.
|
||||||
|
avoid_warnings=1
|
||||||
|
|
||||||
|
[pi0]
|
||||||
|
kernel=u-boot-rpi0.bin
|
||||||
|
|
||||||
|
[pi1]
|
||||||
|
kernel=u-boot-rpi1.bin
|
||||||
|
'';
|
||||||
|
in ''
|
||||||
(cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/boot/)
|
(cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/boot/)
|
||||||
cp ${pkgs.ubootRaspberryPi}/u-boot.bin boot/u-boot-rpi.bin
|
cp ${pkgs.ubootRaspberryPiZero}/u-boot.bin boot/u-boot-rpi0.bin
|
||||||
echo 'kernel u-boot-rpi.bin' > boot/config.txt
|
cp ${pkgs.ubootRaspberryPi}/u-boot.bin boot/u-boot-rpi1.bin
|
||||||
|
cp ${configTxt} boot/config.txt
|
||||||
${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot
|
${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue