vm: Adjust FAT serial number code to 32-bit Guile.
On 32-bit systems, 'string-hash' would raise an out-of-range exception when the second argument was 2^32. * gnu/build/vm.scm (make-iso9660-image): Pass 2^32 - 1 to 'string-hash'.
This commit is contained in:
		
							parent
							
								
									e7c7b73320
								
							
						
					
					
						commit
						ecb33b87aa
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -473,8 +473,12 @@ GRUB configuration and OS-DRV as the stuff in it."
 | 
			
		|||
  ;; allows for deterministic builds.
 | 
			
		||||
  (setenv "GRUB_FAT_SERIAL_NUMBER"
 | 
			
		||||
          (number->string (if volume-uuid
 | 
			
		||||
 | 
			
		||||
                              ;; On 32-bit systems the 2nd argument must be
 | 
			
		||||
                              ;; lower than 2^32.
 | 
			
		||||
                              (string-hash (iso9660-uuid->string volume-uuid)
 | 
			
		||||
                                           (expt 2 32))
 | 
			
		||||
                                           (- (expt 2 32) 1))
 | 
			
		||||
 | 
			
		||||
                              #x77777777)
 | 
			
		||||
                          16))
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue