mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
linux-boot: Add find-long-options.
* gnu/build/linux/boot.scm (find-long-options): New variable.
This commit is contained in:
parent
d4660a5440
commit
015d0a8418
1 changed files with 11 additions and 0 deletions
|
@ -37,6 +37,7 @@ (define-module (gnu build linux-boot)
|
|||
#:export (mount-essential-file-systems
|
||||
linux-command-line
|
||||
find-long-option
|
||||
find-long-options
|
||||
make-essential-device-nodes
|
||||
make-static-device-nodes
|
||||
configure-qemu-networking
|
||||
|
@ -99,6 +100,16 @@ (define (find-long-option option arguments)
|
|||
(lambda (arg)
|
||||
(substring arg (+ 1 (string-index arg #\=)))))))
|
||||
|
||||
(define (find-long-options option arguments)
|
||||
"Find OPTIONs among ARGUMENTS, where OPTION is something like \"console\".
|
||||
Return the values associated with OPTIONs as a list, or the empty list if
|
||||
OPTION doesn't appear in ARGUMENTS."
|
||||
(let ((opt (string-append option "=")))
|
||||
(filter-map (lambda (arg)
|
||||
(and (string-prefix? opt arg)
|
||||
(substring arg (+ 1 (string-index arg #\=)))))
|
||||
arguments)))
|
||||
|
||||
(define* (make-disk-device-nodes base major #:optional (minor 0))
|
||||
"Make the block device nodes around BASE (something like \"/root/dev/sda\")
|
||||
with the given MAJOR number, starting with MINOR."
|
||||
|
|
Loading…
Reference in a new issue