mirror of
https://github.com/nix-community/raspberry-pi-nix.git
synced 2025-11-08 11:36:04 +01:00
rem firmware dir
This commit is contained in:
parent
5242e479ef
commit
6b896975ef
3 changed files with 13 additions and 28 deletions
|
|
@ -37,19 +37,19 @@
|
|||
populate-kernel =
|
||||
if cfg.uboot.enable
|
||||
then ''
|
||||
cp ${cfg.uboot.package}/u-boot.bin firmware/u-boot-rpi-arm64.bin
|
||||
cp ${cfg.uboot.package}/u-boot.bin ./u-boot-rpi-arm64.bin
|
||||
''
|
||||
else ''
|
||||
cp "${kernel}" firmware/kernel.img
|
||||
cp "${initrd}" firmware/initrd
|
||||
cp "${kernel-params}" firmware/cmdline.txt
|
||||
cp "${kernel}" ./kernel.img
|
||||
cp "${initrd}" ./initrd
|
||||
cp "${kernel-params}" ./cmdline.txt
|
||||
'';
|
||||
in
|
||||
{
|
||||
populateFirmwareCommands = ''
|
||||
${populate-kernel}
|
||||
cp -r ${pkgs.raspberrypifw}/share/raspberrypi/boot/{start*.elf,*.dtb,bootcode.bin,fixup*.dat,overlays} firmware
|
||||
cp ${config.hardware.raspberry-pi.config-output} firmware/config.txt
|
||||
cp -r ${pkgs.raspberrypifw}/share/raspberrypi/boot/{start*.elf,*.dtb,bootcode.bin,fixup*.dat,overlays} ./
|
||||
cp ${config.hardware.raspberry-pi.config-output} ./config.txt
|
||||
'';
|
||||
populateRootCommands =
|
||||
if cfg.uboot.enable
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
# Builds an ext4 image containing a populated /nix/store with the closure
|
||||
# Builds a directory containing a populated /nix/store with the closure
|
||||
# of store paths passed in the storePaths parameter, in addition to the
|
||||
# contents of a directory that can be populated with commands. The
|
||||
# generated image is sized to only fit its contents, with the expectation
|
||||
# that a script resizes the filesystem at boot time.
|
||||
# contents of a directory that can be populated with commands.
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ in
|
|||
|
||||
populateFirmwareCommands = mkOption {
|
||||
example =
|
||||
literalExpression "'' cp \${pkgs.myBootLoader}/u-boot.bin firmware/ ''";
|
||||
literalExpression "'' cp \${pkgs.myBootLoader}/u-boot.bin ./ ''";
|
||||
description = ''
|
||||
Shell commands to populate the ./firmware directory.
|
||||
Shell commands to populate the ./ directory.
|
||||
All files in that directory are copied to the
|
||||
/boot/firmware partition on the Netboot image.
|
||||
tftp files on the Netboot image.
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -96,16 +96,6 @@ in
|
|||
populate the ./files/boot (/boot) directory.
|
||||
'';
|
||||
};
|
||||
|
||||
postBuildCommands = mkOption {
|
||||
example = literalExpression
|
||||
"'' dd if=\${pkgs.myBootLoader}/SPL of=$img bs=1024 seek=1 conv=notrunc ''";
|
||||
default = "";
|
||||
description = ''
|
||||
Shell commands to run after the image is built.
|
||||
Can be used for boards requiring to dd u-boot SPL before actual partitions.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -131,13 +121,10 @@ in
|
|||
mkdir -p $rootfs
|
||||
cp -r ${rootfsImage} $rootfs
|
||||
|
||||
# Populate the files intended for /boot/firmware
|
||||
mkdir -p firmware
|
||||
# Populate the files intended for tftp
|
||||
${config.netImage.populateFirmwareCommands}
|
||||
mkdir -p $bootfs
|
||||
cp -r firmware $bootfs
|
||||
|
||||
${config.netImage.postBuildCommands}
|
||||
cp -r . $bootfs
|
||||
'';
|
||||
})
|
||||
{ };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue