From: Danny Milosavljevic <dannym@scratchpost.org>
To: 44507@debbugs.gnu.org
Cc: Danny Milosavljevic <dannym@scratchpost.org>
Subject: [bug#44507] [PATCH 3/3] gnu: Add heads-dev-cpio.
Date: Sat, 7 Nov 2020 22:27:33 +0100 [thread overview]
Message-ID: <20201107212733.22326-3-dannym@scratchpost.org> (raw)
In-Reply-To: <20201107212733.22326-1-dannym@scratchpost.org>
* gnu/packages/heads.scm (heads-dev-cpio): New variable.
---
gnu/packages/heads.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/gnu/packages/heads.scm b/gnu/packages/heads.scm
index b28433431c..d7e90471a2 100644
--- a/gnu/packages/heads.scm
+++ b/gnu/packages/heads.scm
@@ -19,6 +19,7 @@
(define-module (gnu packages heads)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
@@ -161,3 +162,36 @@ done
(synopsis "Musl-cross gcc 5 toolchain")
(description "Musl-cross toolchain: binutils, gcc 5 and musl.")
(license license:isc))))
+
+;; This package provides a "dev.cpio" file usable as a base for booting Heads.
+(define-public heads-dev-cpio
+ (package
+ (name "heads-dev-cpio")
+ (version "0.1")
+ (source #f)
+ (build-system trivial-build-system)
+ (arguments
+ `(#:modules ((guix build utils)
+ (guix cpio))
+ #:builder (begin
+ (use-modules (guix build utils)
+ (guix cpio)
+ (srfi srfi-26))
+ (mkdir-p "dev") ; input directory.
+ (let* ((out (assoc-ref %outputs "out"))
+ (libexec (string-append out "/libexec")))
+ (mkdir-p libexec)
+ (call-with-output-file (string-append libexec "/dev.cpio")
+ (lambda (port)
+ (write-cpio-archive '("dev" "dev/console") port
+ #:file->header
+ (lambda (name)
+ (if (string=? "dev/console" name)
+ (special-file->cpio-header* name 'char-special 5 1 #o600)
+ (file->cpio-header* name))))))
+ #t))))
+ (synopsis "\"dev.cpio\" for Heads")
+ (description "This package provides a \"dev.cpio\" file usable as a base for
+heads' initrd.")
+ (home-page "http://osresearch.net/")
+ (license license:bsd-2)))
next prev parent reply other threads:[~2020-11-07 21:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-07 20:47 [bug#44507] [PATCH 0/3] Create "dev.cpio" for Heads Danny Milosavljevic
2020-11-07 21:27 ` [bug#44507] [PATCH 1/3] linux-initrd: Handle 'block-special and 'char-special cpio headers as well Danny Milosavljevic
2020-11-07 21:27 ` [bug#44507] [PATCH 2/3] linux-initrd: Add special-file->cpio-header* Danny Milosavljevic
2020-11-07 21:27 ` Danny Milosavljevic [this message]
2020-11-22 10:07 ` bug#44507: [PATCH 0/3] Create "dev.cpio" for Heads Danny Milosavljevic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201107212733.22326-3-dannym@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=44507@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).