projects/guix·blob javascript-team · refs

84 lines · 3.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2020 Danny Milosavljevic <[email protected]>
3;;; Copyright © 2024 Janneke Nieuwenhuizen <[email protected]>
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages heads)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix build-system trivial)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix utils)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages admin)
30 #:use-module (gnu packages algebra)
31 #:use-module (gnu packages assembly)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages base)
34 #:use-module (gnu packages bash)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages compiler-tools)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages elf)
39 #:use-module (gnu packages m4)
40 #:use-module (gnu packages curl)
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages multiprecision)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages cpio)
45 #:use-module (gnu packages file)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages version-control)
48 #:use-module (gnu packages virtualization)
49 #:use-module ((guix build utils) #:select (alist-replace))
50 #:use-module (srfi srfi-1))
51
52;; This package provides a "dev.cpio" file usable as a base for booting Heads.
53(define-public heads-dev-cpio
54 (package
55 (name "heads-dev-cpio")
56 (version "0.1")
57 (source #f)
58 (build-system trivial-build-system)
59 (arguments
60 `(#:modules ((guix build utils)
61 (guix build syscalls)
62 (guix cpio))
63 #:builder (begin
64 (use-modules (guix build utils)
65 (guix cpio)
66 (srfi srfi-26))
67 (mkdir-p "dev") ; input directory.
68 (let* ((out (assoc-ref %outputs "out"))
69 (libexec (string-append out "/libexec")))
70 (mkdir-p libexec)
71 (call-with-output-file (string-append libexec "/dev.cpio")
72 (lambda (port)
73 (write-cpio-archive '("dev" "dev/console") port
74 #:file->header
75 (lambda (name)
76 (if (string=? "dev/console" name)
77 (special-file->cpio-header* name 'char-special 5 1 #o600)
78 (file->cpio-header* name))))))
79 #t))))
80 (synopsis "@file{dev.cpio} for Heads")
81 (description "This package provides a @file{dev.cpio} file usable as a
82base for heads' initrd.")
83 (home-page "https://osresearch.net/")
84 (license license:bsd-2)))