diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index b6561dfc7..3bfd6b4ca 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -319,6 +319,18 @@ the image." (set-path-environment-variable "PATH" '("bin" "sbin") inputs) + ;; Try writing from /dev/hwrng into /dev/urandom. + ;; It seems that the file /dev/hwrng always exists, even + ;; when there is no hardware random number generator + ;; available. So, we handle a failed read or any other error + ;; reported by the operating system. + (let ((buf (call-with-input-file "/dev/hwrng" + (lambda (hwrng) + (get-bytevector-n hwrng 512))))) + (call-with-output-file "/dev/urandom" + (lambda (urandom) + (put-bytevector urandom buf)))) + (let* ((graphs '#$(match inputs (((names . _) ...) names)))