about summary refs log tree commit diff
path: root/nixos/modules/installer/cd-dvd
diff options
context:
space:
mode:
authorSamuel Dionne-Riel <samuel@dionne-riel.com>2018-11-27 21:51:41 -0500
committerTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2018-11-29 01:50:30 +0200
commit2e5eb135aac300032edd82e4b7a49a17dc80ba4d (patch)
tree4482ec0d1d29098ad94458cadae485513dd86b18 /nixos/modules/installer/cd-dvd
parent2570da807715a9027c96a99c17ebc0f860894aaa (diff)
downloadnixlib-2e5eb135aac300032edd82e4b7a49a17dc80ba4d.tar
nixlib-2e5eb135aac300032edd82e4b7a49a17dc80ba4d.tar.gz
nixlib-2e5eb135aac300032edd82e4b7a49a17dc80ba4d.tar.bz2
nixlib-2e5eb135aac300032edd82e4b7a49a17dc80ba4d.tar.lz
nixlib-2e5eb135aac300032edd82e4b7a49a17dc80ba4d.tar.xz
nixlib-2e5eb135aac300032edd82e4b7a49a17dc80ba4d.tar.zst
nixlib-2e5eb135aac300032edd82e4b7a49a17dc80ba4d.zip
sd-image: Verifies the FAT partition before copying it.
This is to ensure `mtools`-based operations don't wreck the FS.
Diffstat (limited to 'nixos/modules/installer/cd-dvd')
-rw-r--r--nixos/modules/installer/cd-dvd/sd-image.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/installer/cd-dvd/sd-image.nix b/nixos/modules/installer/cd-dvd/sd-image.nix
index b6e1d11c2b54..e3b1ce3b7c42 100644
--- a/nixos/modules/installer/cd-dvd/sd-image.nix
+++ b/nixos/modules/installer/cd-dvd/sd-image.nix
@@ -135,6 +135,8 @@ in
 
         # Copy the populated /boot into the SD image
         (cd boot; mcopy -bpsvm -i ../bootpart.img ./* ::)
+        # Verify the FAT partition before copying it.
+        fsck.vfat -vn bootpart.img
         dd conv=notrunc if=bootpart.img of=$img seek=$START count=$SECTORS
       '';
     }) {};