services: 'file-union' makes sure each source file exists.
Before that, specifying an invalid timezone in 'operating-system' would lead to a dangling symlink in the 'etc' directory, which in turn would lead to a kernel panic at boot time. Reported by pizzaiolo on #guix. * gnu/services.scm (file-union): Add 'stat' call for SOURCE.
This commit is contained in:
		
							parent
							
								
									240b57f0ca
								
							
						
					
					
						commit
						37dd1e6a34
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -291,7 +291,12 @@ file."
 | 
			
		|||
                     (chdir #$output)
 | 
			
		||||
                     #$@(map (match-lambda
 | 
			
		||||
                               ((target source)
 | 
			
		||||
                                #~(symlink #$source #$target)))
 | 
			
		||||
                                #~(begin
 | 
			
		||||
                                    ;; Stat the source to abort early if it
 | 
			
		||||
                                    ;; does not exist.
 | 
			
		||||
                                    (stat #$source)
 | 
			
		||||
 | 
			
		||||
                                    (symlink #$source #$target))))
 | 
			
		||||
                             files))))
 | 
			
		||||
 | 
			
		||||
(define (directory-union name things)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue