aboutsummaryrefslogtreecommitdiff
path: root/gnu/bootloader/extlinux.scm
blob: b48596c4969fd167e970b895a5a870feccf5752a (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 David Craven <david@craven.ch>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu bootloader extlinux)
  #:use-module (gnu bootloader)
  #:use-module (gnu packages bootloaders)
  #:use-module (guix gexp)
  #:use-module (guix utils)
  #:export (extlinux-bootloader
            extlinux-bootloader-gpt))

(define* (extlinux-configuration-file config entries
                                      #:key
                                      (system (%current-system))
                                      (old-entries '()))
  "Return the U-Boot configuration file corresponding to CONFIG, a
<u-boot-configuration> object, and where the store is available at STORE-FS, a
<file-system> object.  OLD-ENTRIES is taken to be a list of menu entries
corresponding to old generations of the system."

  (define all-entries
    (append entries (bootloader-configuration-menu-entries config)))

  (define (menu-entry->gexp entry)
    (let ((label (menu-entry-label entry))
          (kernel (menu-entry-linux entry))
          (kernel-arguments (menu-entry-linux-arguments entry))
          (initrd (menu-entry-initrd entry)))
      #~(format port "LABEL ~a
  MENU LABEL ~a
  KERNEL ~a
  FDTDIR ~a/lib/dtbs
  INITRD ~a
  APPEND ~a
~%"
                #$label #$label
                #$kernel (dirname #$kernel) #$initrd
                (string-join (list #$@kernel-arguments)))))

  (define builder
    #~(call-with-output-file #$output
        (lambda (port)
          (let ((timeout #$(bootloader-configuration-timeout config)))
            (format port "# This file was generated from your GuixSD configuration.  Any changes
# will be lost upon reconfiguration.
UI menu.c32
MENU TITLE GuixSD Boot Options
PROMPT ~a
TIMEOUT ~a~%"
                    (if (> timeout 0) 1 0)
                    ;; timeout is expressed in 1/10s of seconds.
                    (* 10 timeout))
            #$@(map menu-entry->gexp all-entries)

            #$@(if (pair? old-entries)
                   #~((format port "~%")
                      #$@(map menu-entry->gexp old-entries)
                      (format port "~%"))
                   #~())))))

  (computed-file "extlinux.conf" builder))




;;;
;;; Install procedures.
;;;

(define (install-extlinux mbr)
  #~(lambda (bootloader device mount-point)
      (let ((extlinux (string-append bootloader "/sbin/extlinux"))
            (install-dir (string-append mount-point "/boot/extlinux"))
            (syslinux-dir (string-append bootloader "/share/syslinux")))
        (for-each (lambda (file)
                    (install-file file install-dir))
                  (find-files syslinux-dir "\\.c32$"))
        (unless
            (and (zero? (system* extlinux "--install" install-dir))
                 (write-file-on-device
                  (string-append syslinux-dir "/" #$mbr) 440 device 0))
          (error "failed to install SYSLINUX")))))

(define install-extlinux-mbr
  (install-extlinux "mbr.bin"))

(define install-extlinux-gpt
  (install-extlinux "gptmbr.bin"))



;;;
;;; Bootloader definitions.
;;;

(define extlinux-bootloader
  (bootloader
   (name 'extlinux)
   (package syslinux)
   (installer install-extlinux-mbr)
   (configuration-file "/boot/extlinux/extlinux.conf")
   (configuration-file-generator extlinux-configuration-file)))

(define extlinux-bootloader-gpt
  (bootloader
   (inherit extlinux-bootloader)
   (installer install-extlinux-gpt)))
8f6fb9aece5a345bfaf1c8a75e743fe6db8'>gnu: libfm: Build with GTK 3....* gnu/packages/lxde.scm (libfm) [arguments]: New field. [inputs]: Replace gtk+2 with gtk+. Maxim Cournoyer 2022-08-17gnu: openjdk: Add a variable tracking the latest openjdk package....* gnu/packages/java.scm (openjdk): New variable. Maxim Cournoyer 2022-08-14gnu: bind: Update to 9.16.32....* gnu/packages/dns.scm (isc-bind): Update to 9.16.32. Tobias Geerinckx-Rice 2022-08-17gnu: gdal: Update to 3.5.1....* gnu/packages/geo.scm (gdal): Update to 3.5.1. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Nikolay Korotkiy 2022-08-17gnu: python-maxminddb: Update to 2.2.0....* gnu/packages/geo.scm (python-maxminddb): Update to 2.2.0. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Nikolay Korotkiy 2022-08-17gnu: libmaxminddb: Update to 1.6.0....* gnu/packages/geo.scm (libmaxminddb): Update to 1.6.0. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Nikolay Korotkiy 2022-08-17gnu: geos: Update to 3.11.0....* gnu/packages/geo.scm (geos): Update to 3.11.0. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Nikolay Korotkiy 2022-08-17gnu: scintilla: Update to 5.2.4....* gnu/packages/text-editors.scm (scintilla): Update to 5.2.4. Nicolas Goaziou 2022-08-17gnu: fsearch: Update to 0.2....* gnu/packages/search.scm (fsearch): Update to 0.2. [inputs]: Replace PCRE with PCRE2. Nicolas Goaziou 2022-08-17gnu: emacs-eldev: Update to 1.2....* gnu/packages/emacs-xyz.scm (emacs-eldev): Update to 1.2. Nicolas Goaziou 2022-08-17gnu: emacs-crdt: Update to 0.3.1....* gnu/packages/emacs-xyz.scm (emacs-crdt): Update to 0.3.1. Nicolas Goaziou 2022-08-17gnu: xnec2c: Update to 4.4.11....* gnu/packages/radio.scm (xnec2c): Update to 4.4.11. Guillaume Le Vaillant 2022-08-17gnu: sdrangel: Update to 7.6.2....* gnu/packages/radio.scm (sdrangel): Update to 7.6.2. [inputs]: Add qtwebchannel-5 and qtwebengine-5. Guillaume Le Vaillant 2022-08-17gnu: stumpwm-contrib: Fix description....* gnu/packages/wm.scm (stumpwm-contrib)[synopsis, description]: Fix them. Guillaume Le Vaillant 2022-08-17gnu: stumpwm-contrib: Update to 0.0.1-4.d0c0507....* gnu/packages/wm.scm (stumpwm-contrib): Update to 0.0.1-4.d0c0507. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Trevor Richards 2022-08-17gnu: osm2pgsql: Update to 1.7.0....* gnu/packages/geo.scm (osm2pgsql): Update to 1.7.0. [source]: Update snippet. [inputs]: Add fmt and rapidjson. [arguments]: Update 'configure-flags'. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Nikolay Korotkiy 2022-08-17gnu: Add python-lief....From c865b31b702d0e5f86faaadcb306cea269ae1109 Mon Sep 17 00:00:00 2001 From: Hilton Chain <hako@ultrarare.space> Date: Tue, 16 Aug 2022 21:26:33 +0800 Subject: [PATCH v3] gnu: Add python-lief. * gnu/packages/python-xyz.scm (python-lief): New variable. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Hilton Chain 2022-08-17gnu: neovim: Update to 0.7.2....* gnu/packages/vim.scm (neovim): Update to 0.7.2. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Mike Jones 2022-08-17gnu: fish: Update to 3.5.1....* gnu/packages/shells.scm (fish): Update to 3.5.1. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Mike Jones 2022-08-17gnu: icestorm: Update to 0.0-4.2bc5417....* gnu/packages/fpga.scm (icestorm): Update to commit 2bc541743ada3542c6da36a50e66303b9cbd2059. 宋文武 2022-08-17gnu: greybird-gtk-theme: Build with librsvg-for-system....* gnu/packages/gnome-xyz.scm (greybird-gtk-theme)[inputs]: Replace librsvg with librsvg-for-system. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Denis 'GNUtoo' Carikli 2022-08-17gnu: emacs-straight-el: Update to fed2153....* gnu/packages/emacs-xyz.scm (emacs-straight-el): Update to fed215348076ba9182f634e0770a175220474b5a. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Hilton Chain 2022-08-14gnu: rsync: Update to 3.2.5 [fixes CVE-2022-29154]....* gnu/packages/rsync.scm (rsync): Update to 3.2.5. Tobias Geerinckx-Rice 2022-08-14gnu: plocate: Update to 1.1.16....* gnu/packages/search.scm (plocate): Update to 1.1.16. Tobias Geerinckx-Rice 2022-08-14gnu: font-util: Update to 1.3.3....* gnu/packages/xorg.scm (font-util): Update to 1.3.3. Tobias Geerinckx-Rice 2022-08-14gnu: arx-libertatis: Update to 1.2.1....* gnu/packages/games.scm (arx-libertatis): Update to 1.2.1. Tobias Geerinckx-Rice 2022-08-14gnu: dhewm3: Remove input labels....* gnu/packages/game-development.scm (dhewm3)[inputs]: Remove input labels. Tobias Geerinckx-Rice 2022-08-14gnu: dhewm3: Update to 1.5.2....* gnu/packages/game-development.scm (dhewm3): Update to 1.5.2. [arguments]: Don't explicitly return #t from phases. [inputs]: Remove libjpeg-turbo, libogg, and libvorbis. Tobias Geerinckx-Rice