aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2018-01-31 13:28:21 +0100
committerDanny Milosavljevic <dannym@scratchpost.org>2018-02-01 00:11:10 +0100
commit015d0a8418d867c13ae83acb44dc1157df2fedae (patch)
treec577312924e9b26066ac4763ef9c4e054e70bd37
parentd4660a54401fb2c2a882d9ae8fa57393c3be193f (diff)
downloadguix-015d0a8418d867c13ae83acb44dc1157df2fedae.tar
guix-015d0a8418d867c13ae83acb44dc1157df2fedae.tar.gz
linux-boot: Add find-long-options.
* gnu/build/linux/boot.scm (find-long-options): New variable.
-rw-r--r--gnu/build/linux-boot.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 0ab8391b0b..c9de4f4b90 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -37,6 +37,7 @@
#: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 @@ Return the value associated with OPTION, or #f on failure."
(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."