diff options
author | Lassulus <github@lassul.us> | 2020-08-27 21:02:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 21:02:20 +0200 |
commit | 7c509270d6894b7c804516f2d86f9c53d5925884 (patch) | |
tree | a83c1fa81b9beaae3336fa82008cae6b2cfda37b /nixos | |
parent | 1d1c2f36674784a4b318cb4f6377c77d2834c410 (diff) | |
parent | 170e1afd84672502880acd4b3b8e2bd579d6c4e2 (diff) |
Merge pull request #96460 from sorki/sdImage_post_build
nixos/sdImage: add postBuildCommands
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/installer/cd-dvd/sd-image.nix | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/installer/cd-dvd/sd-image.nix b/nixos/modules/installer/cd-dvd/sd-image.nix index ddad1116c94af..231c7bf0a6c25 100644 --- a/nixos/modules/installer/cd-dvd/sd-image.nix +++ b/nixos/modules/installer/cd-dvd/sd-image.nix @@ -108,6 +108,15 @@ in ''; }; + postBuildCommands = mkOption { + example = literalExample "'' 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. + ''; + }; + compressImage = mkOption { type = types.bool; default = true; @@ -197,6 +206,9 @@ in # Verify the FAT partition before copying it. fsck.vfat -vn firmware_part.img dd conv=notrunc if=firmware_part.img of=$img seek=$START count=$SECTORS + + ${config.sdImage.postBuildCommands} + if test -n "$compressImage"; then zstd -T$NIX_BUILD_CORES --rm $img fi |