summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2020-03-27 21:09:07 -0400
committerworldofpeace <worldofpeace@protonmail.ch>2020-03-27 21:35:12 -0400
commit591e8d5708b5c245d4349479828f4c05a45979e8 (patch)
treea8ab04bf6bcbdc04c30dc9e897a3164683679828
parent70a8e9ace9669b9685213e4631879fd2cdd79102 (diff)
downloadnixpkgs-591e8d5708b5c245d4349479828f4c05a45979e8.tar
nixpkgs-591e8d5708b5c245d4349479828f4c05a45979e8.tar.gz
nixpkgs-591e8d5708b5c245d4349479828f4c05a45979e8.tar.bz2
nixpkgs-591e8d5708b5c245d4349479828f4c05a45979e8.tar.lz
nixpkgs-591e8d5708b5c245d4349479828f4c05a45979e8.tar.xz
nixpkgs-591e8d5708b5c245d4349479828f4c05a45979e8.tar.zst
nixpkgs-591e8d5708b5c245d4349479828f4c05a45979e8.zip
iso-image: make sure volumeID is less than 32 chars
-rw-r--r--nixos/modules/installer/cd-dvd/iso-image.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix
index 58589b6b824..b85f20bb09b 100644
--- a/nixos/modules/installer/cd-dvd/iso-image.nix
+++ b/nixos/modules/installer/cd-dvd/iso-image.nix
@@ -524,6 +524,19 @@ in
   };
 
   config = {
+    assertions = [
+      {
+        assertion = !(stringLength config.isoImage.volumeID > 32);
+        # https://wiki.osdev.org/ISO_9660#The_Primary_Volume_Descriptor
+        # Volume Identifier can only be 32 bytes
+        message = let
+          length = stringLength config.isoImage.volumeID;
+          howmany = toString length;
+          toomany = toString (length - 32);
+        in
+        "isoImage.volumeID ${config.isoImage.volumeID} is ${howmany} characters. That is ${toomany} characters longer than the limit of 32.";
+      }
+    ];
 
     boot.loader.grub.version = 2;