mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
linux-initrd: Add special-file->cpio-header*.
* guix/cpio.scm (special-file->cpio-header*): New public procedure.
This commit is contained in:
parent
b1dfc64552
commit
8e7c98963f
1 changed files with 20 additions and 0 deletions
|
@ -27,6 +27,7 @@ (define-module (guix cpio)
|
|||
make-cpio-header
|
||||
file->cpio-header
|
||||
file->cpio-header*
|
||||
special-file->cpio-header*
|
||||
write-cpio-header
|
||||
read-cpio-header
|
||||
|
||||
|
@ -190,6 +191,25 @@ (define* (file->cpio-header* file
|
|||
#:size (stat:size st)
|
||||
#:name-size (string-length file-name))))
|
||||
|
||||
(define* (special-file->cpio-header* file
|
||||
device-type
|
||||
device-major
|
||||
device-minor
|
||||
permission-bits
|
||||
#:optional (file-name file))
|
||||
"Create a character or block device header.
|
||||
|
||||
DEVICE-TYPE is either 'char-special or 'block-special.
|
||||
|
||||
The number of hard links is assumed to be 1."
|
||||
(make-cpio-header #:mode (logior (match device-type
|
||||
('block-special C_ISBLK)
|
||||
('char-special C_ISCHR))
|
||||
permission-bits)
|
||||
#:nlink 1
|
||||
#:rdev (device-number device-major device-minor)
|
||||
#:name-size (string-length file-name)))
|
||||
|
||||
(define %trailer
|
||||
"TRAILER!!!")
|
||||
|
||||
|
|
Loading…
Reference in a new issue