22997fd7428aeaec5fa894e68a29798c7e3fb030
[jackhill/guix/guix.git] / gnu / system / images / pinebook-pro.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu system images pinebook-pro)
20 #:use-module (gnu bootloader)
21 #:use-module (gnu bootloader u-boot)
22 #:use-module (gnu image)
23 #:use-module (gnu packages linux)
24 #:use-module (gnu services)
25 #:use-module (gnu services base)
26 #:use-module (gnu system)
27 #:use-module (gnu system file-systems)
28 #:use-module (gnu system image)
29 #:use-module (srfi srfi-26)
30 #:export (pinebook-pro-barebones-os
31 pinebook-pro-image-type
32 pinebook-pro-barebones-raw-image))
33
34 (define pinebook-pro-barebones-os
35 (operating-system
36 (host-name "viso")
37 (timezone "Europe/Paris")
38 (locale "en_US.utf8")
39 (bootloader (bootloader-configuration
40 (bootloader u-boot-pinebook-pro-rk3399-bootloader)
41 (target "/dev/vda")))
42 (initrd-modules '())
43 (kernel linux-libre-arm64-generic)
44 (file-systems (cons (file-system
45 (device (file-system-label "my-root"))
46 (mount-point "/")
47 (type "ext4"))
48 %base-file-systems))
49 (services (cons (service agetty-service-type
50 (agetty-configuration
51 (extra-options '("-L")) ; no carrier detect
52 (baud-rate "115200")
53 (term "vt100")
54 (tty "ttyS2")))
55 %base-services))))
56
57 (define pinebook-pro-image-type
58 (image-type
59 (name 'pinebook-pro-raw)
60 (constructor (cut image-with-os
61 (arm64-disk-image (* 9 (expt 2 20))) ;9MiB
62 <>))))
63
64 (define pinebook-pro-barebones-raw-image
65 (image
66 (inherit
67 (os->image pinebook-pro-barebones-os #:type pinebook-pro-image-type))
68 (name 'pinebook-pro-barebones-raw-image)))