diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-12-08 21:22:22 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-12-08 22:43:56 +0100 |
commit | 9b0ac8025860ac426cb1bc7fd417a27fe2bed36a (patch) | |
tree | f2a703efdddbdf89b5cd79e83739bf7f743e3b26 /gnu/packages/patches | |
parent | 677078b48f649588f588c6adef0bb0aba70f7c8c (diff) | |
download | guix-9b0ac8025860ac426cb1bc7fd417a27fe2bed36a.tar guix-9b0ac8025860ac426cb1bc7fd417a27fe2bed36a.tar.gz |
gnu: Populate /etc upon startup.
* gnu/packages/patches/dmd-getpw.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
* gnu/packages/system.scm (dmd): Use it.
* gnu/system/vm.scm (system-qemu-image): Don't explicitly populate /etc;
don't add ETC to the GC roots.
* gnu/system/dmd.scm (dmd-configuration-file): Add 'etc' parameter.
[config]: Populate /etc from there.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/dmd-getpw.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gnu/packages/patches/dmd-getpw.patch b/gnu/packages/patches/dmd-getpw.patch new file mode 100644 index 0000000000..c4f9c35951 --- /dev/null +++ b/gnu/packages/patches/dmd-getpw.patch @@ -0,0 +1,19 @@ +When bootstrapping and running as PID 1, /etc/{passwd,shadow} may be unavailable. +Gracefully handle that. + +diff --git a/modules/dmd/support.scm b/modules/dmd/support.scm +index 9b592c5..602e409 100644 +--- a/modules/dmd/support.scm ++++ b/modules/dmd/support.scm +@@ -151,7 +151,10 @@ There is NO WARRANTY, to the extent permitted by law."))) + + + ;; Home directory of the user. +-(define user-homedir (passwd:dir (getpwuid (getuid)))) ++(define user-homedir ++ (or (false-if-exception (passwd:dir (getpwuid (getuid)))) ++ (getenv "HOME") ++ "/")) + + ;; Logfile. + (define default-logfile |