From 37dd1e6a34698e5bccaf99b6681c503b1a4e5efc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 3 Feb 2016 22:26:33 +0100 Subject: [PATCH] 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. --- gnu/services.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/services.scm b/gnu/services.scm index 056bb2a1c9..1ad573787f 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -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) -- 2.20.1