From 828c0bec6b95a6dcfffd28d0a28caecf4f69addf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 4 Jan 2015 18:00:23 +0100 Subject: pk-crypto: Improve docstring of signature-related procedures. * guix/pk-crypto.scm (bytevector->hash-data, sign): Augment docstring. --- guix/pk-crypto.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'guix') diff --git a/guix/pk-crypto.scm b/guix/pk-crypto.scm index 71104128c1..e5d4dc9ecc 100644 --- a/guix/pk-crypto.scm +++ b/guix/pk-crypto.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -254,9 +254,9 @@ Return #f if that element does not exist, or if it's a list." #:optional (hash-algo "sha256") #:key (key-type 'ecc)) - "Given BV, a bytevector containing a hash, return an s-expression suitable -for use as the data for 'sign'. KEY-TYPE must be a symbol: 'dsa, 'ecc, or -'rsa." + "Given BV, a bytevector containing a hash of type HASH-ALGO, return an +s-expression suitable for use as the 'data' argument for 'sign'. KEY-TYPE +must be a symbol: 'dsa, 'ecc, or 'rsa." (string->canonical-sexp (format #f "(data (flags ~a) (hash \"~a\" #~a#))" (case key-type @@ -289,8 +289,10 @@ Return #f if DATA does not conform." (let* ((ptr (libgcrypt-func "gcry_pk_sign")) (proc (pointer->procedure int ptr '(* * *)))) (lambda (data secret-key) - "Sign DATA (an s-expression) with SECRET-KEY (an s-expression whose car -is 'private-key'.)" + "Sign DATA, a canonical s-expression representing a suitable hash, with +SECRET-KEY (a canonical s-expression whose car is 'private-key'.) Note that +DATA must be a 'data' s-expression, as returned by +'bytevector->hash-data' (info \"(gcrypt) Cryptographic Functions\")." (let* ((sig (bytevector->pointer (make-bytevector (sizeof '*)))) (err (proc sig (canonical-sexp->pointer data) (canonical-sexp->pointer secret-key)))) -- cgit v1.2.3 From 9331ba5dd9dc2224b427d71f2ee56250463f4ef3 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Mon, 5 Jan 2015 22:07:03 +0800 Subject: linux-boot: Make /etc/mtab a symlink to /proc/self/mounts. Fixes . * gnu/build/linux-boot.scm (mount-root-file-system): Make /root/etc/mtab a symlink to /proc/self/mounts. * gnu/build/file-systems.scm (mount-file-system): Don't update /etc/mtab. * guix/build/syscalls.scm (mount, umount): Have #:update-mtab? default to #f. --- gnu/build/file-systems.scm | 9 +-------- gnu/build/linux-boot.scm | 5 ++++- guix/build/syscalls.scm | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'guix') diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 84f58538fd..38e4851515 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -287,13 +287,6 @@ run a file system check." (mount source mount-point type (mount-flags->bit-mask flags) (if options (string->pointer options) - %null-pointer)) - - ;; Update /etc/mtab. - (mkdir-p (string-append root "/etc")) - (let ((port (open-file (string-append root "/etc/mtab") "a"))) - (format port "~a ~a ~a ~a 0 0~%" - source mount-point type (or options "rw")) - (close-port port)))))) + %null-pointer)))))) ;;; file-systems.scm ends here diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index b2ed1a8b54..3096989468 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -275,7 +275,10 @@ UNIONFS." (check-file-system root type) (mount root "/root" type))) - (copy-file "/proc/mounts" "/root/etc/mtab")) + ;; Make sure /root/etc/mtab is a symlink to /proc/self/mounts. + (when (file-exists? "/root/etc/mtab") + (delete-file "/root/etc/mtab")) + (symlink "/proc/self/mounts" "/root/etc/mtab")) (define (switch-root root) "Switch to ROOT as the root file system, in a way similar to what diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index b210f8faa8..b62a8cce64 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -130,7 +130,7 @@ (let* ((ptr (dynamic-func "mount" (dynamic-link))) (proc (pointer->procedure int ptr `(* * * ,unsigned-long *)))) (lambda* (source target type #:optional (flags 0) options - #:key (update-mtab? #t)) + #:key (update-mtab? #f)) "Mount device SOURCE on TARGET as a file system TYPE. Optionally, FLAGS may be a bitwise-or of the MS_* constants, and OPTIONS may be a string. When FLAGS contains MS_REMOUNT, SOURCE and TYPE are ignored. When @@ -159,7 +159,7 @@ error." (let* ((ptr (dynamic-func "umount2" (dynamic-link))) (proc (pointer->procedure int ptr `(* ,int)))) (lambda* (target #:optional (flags 0) - #:key (update-mtab? #t)) + #:key (update-mtab? #f)) "Unmount TARGET. Optionally FLAGS may be one of the MNT_* or UMOUNT_* constants from ." (let ((ret (proc (string->pointer target) flags)) -- cgit v1.2.3