| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 |
|
| 23 | (define-module (gnu packages coreboot)
|
| 24 | #:use-module (gnu packages bison)
|
| 25 | #:use-module (gnu packages compression)
|
| 26 | #:use-module (gnu packages compiler-tools)
|
| 27 | #:use-module (gnu packages pciutils)
|
| 28 | #:use-module ((guix licenses) #:prefix license:)
|
| 29 | #:use-module (guix build-system cargo)
|
| 30 | #:use-module (guix build-system cmake)
|
| 31 | #:use-module (guix build-system copy)
|
| 32 | #:use-module (guix build-system gnu)
|
| 33 | #:use-module (guix build-system go)
|
| 34 | #:use-module (guix build-system meson)
|
| 35 | #:use-module (guix build-system pyproject)
|
| 36 | #:use-module (guix build-system qt)
|
| 37 | #:use-module (guix download)
|
| 38 | #:use-module (guix gexp)
|
| 39 | #:use-module (guix git-download)
|
| 40 | #:use-module (guix packages)
|
| 41 | #:use-module (guix utils)
|
| 42 | #:use-module (srfi srfi-26))
|
| 43 |
|
| 44 | (define %coreboot-version "26.03")
|
| 45 |
|
| 46 | (define %coreboot-origin
|
| 47 | (origin
|
| 48 | (method git-fetch)
|
| 49 | (uri (git-reference
|
| 50 | (url "https://review.coreboot.org/coreboot")
|
| 51 | (commit %coreboot-version)))
|
| 52 | (file-name (git-file-name "coreboot" %coreboot-version))
|
| 53 | (sha256
|
| 54 | (base32
|
| 55 | "0436rr0vibh35phvkxrc939njvrmnfq9xw87y1b0nlllglvq07kk"))))
|
| 56 |
|
| 57 | (define-public bincfg
|
| 58 | (package
|
| 59 | (name "bincfg")
|
| 60 | (version %coreboot-version)
|
| 61 | (source %coreboot-origin)
|
| 62 | (build-system gnu-build-system)
|
| 63 | (arguments
|
| 64 | (list
|
| 65 | #:tests? #f |
| 66 | #:make-flags
|
| 67 | #~(list
|
| 68 | (string-append "CC=" #$(cc-for-target)))
|
| 69 | #:phases
|
| 70 | #~(modify-phases %standard-phases
|
| 71 | (delete 'configure) |
| 72 | (add-after 'unpack 'chdir
|
| 73 | (lambda _
|
| 74 | (chdir "util/bincfg")))
|
| 75 | (add-after 'build 'build-binaries
|
| 76 | (lambda* (#:key make-flags #:allow-other-keys)
|
| 77 | (for-each
|
| 78 | (lambda (target result)
|
| 79 | (apply invoke "make" (string-append "gen-" target) make-flags)
|
| 80 | (rename-file result
|
| 81 | (string-append target ".bin")))
|
| 82 | (list
|
| 83 | |
| 84 | "gbe-ich9m"
|
| 85 | |
| 86 | "gbe-82579LM"
|
| 87 | |
| 88 | "ifd-x200")
|
| 89 | (list
|
| 90 | "flashregion_3_gbe.bin"
|
| 91 | "flashregion_3_gbe.bin"
|
| 92 | "flashregion_0_fd.bin"))))
|
| 93 | |
| 94 | (replace 'install
|
| 95 | (lambda _
|
| 96 | (let ((bin (string-append #$output "/bin"))
|
| 97 | (lib (string-append #$output "/lib/bincfg"))
|
| 98 | (data (string-append #$output "/share/bincfg")))
|
| 99 | |
| 100 | (install-file "bincfg" bin)
|
| 101 | |
| 102 | (for-each
|
| 103 | (lambda (path)
|
| 104 | (install-file path data))
|
| 105 | (append (find-files "." ".*\\.set")
|
| 106 | (find-files "." ".*\\.spec")))
|
| 107 | |
| 108 | (for-each
|
| 109 | (lambda (path)
|
| 110 | (install-file path lib))
|
| 111 | (find-files "." ".*\\.bin"))))))))
|
| 112 | (native-inputs (list bison flex))
|
| 113 | (home-page "https://coreboot.org")
|
| 114 | (synopsis "Encoder/decoder for binary formats described in text files")
|
| 115 | (description "
|
| 116 | The bincfg program comes with specifications files for the following binary
|
| 117 | formats:
|
| 118 | @itemize
|
| 119 | @item Various DDR3 and DDR4 SPD
|
| 120 | @item Configuration data for the Intel 82579LM Gigabit Ethernet PHY
|
| 121 | @item Configuration data for the Intel Gigabit Ethernet controller present in
|
| 122 | the Intel ICH9-M chipset.
|
| 123 | @item Intel Firmware Descriptor data for the Lenovo ThinkPad X200
|
| 124 | @item Configuration data for the ITE IT8718F SuperIO
|
| 125 | @end itemize
|
| 126 | It also comes with example files generated by bincfg.")
|
| 127 | (license license:gpl3+)))
|
| 128 |
|
| 129 | (define-public bucts
|
| 130 | (package
|
| 131 | (name "bucts")
|
| 132 | (version %coreboot-version)
|
| 133 | (source %coreboot-origin)
|
| 134 | (build-system gnu-build-system)
|
| 135 | (arguments
|
| 136 | (list
|
| 137 | #:tests? #f |
| 138 | #:make-flags #~(list (string-append "CC=" #$(cc-for-target)))
|
| 139 | #:phases #~(modify-phases %standard-phases
|
| 140 | (delete 'configure) |
| 141 | (add-after 'unpack 'enter-source
|
| 142 | (lambda _
|
| 143 | (chdir "util/bucts")))
|
| 144 | (add-after 'enter-source 'set-version
|
| 145 | (lambda _
|
| 146 | (substitute* "Makefile"
|
| 147 | (("^VERSION:=*")
|
| 148 | #$(string-append "VERSION:=" version)))))
|
| 149 | |
| 150 | (replace 'install
|
| 151 | (lambda _
|
| 152 | (let ((bin (string-append #$output "/bin"))
|
| 153 | (doc (string-append #$output "/share/doc/bucts/"))
|
| 154 | (licenses (string-append #$output
|
| 155 | "/share/licenses/bucts/")))
|
| 156 | (install-file "bucts" bin)
|
| 157 | (install-file "readme.md" doc)
|
| 158 | (install-file "../../COPYING" licenses)))))))
|
| 159 | (inputs (list pciutils))
|
| 160 | (home-page "https://coreboot.org")
|
| 161 | (synopsis "Tool to swap the BIOS bootblock and backup bootblock on the
|
| 162 | Intel I945 chipsets")
|
| 163 | (description
|
| 164 | "The @command{bucts} command can flip a bit in the BUC.TS register of the
|
| 165 | Intel I945 chipsets and show the register status. When the bit is set, it
|
| 166 | swaps the bootblock location. Because the bootblock region is often set
|
| 167 | read-only by the default BIOS, this enables to bypass that restriction and is
|
| 168 | used as part of a procedure to replace the nonfree BIOS with free software on
|
| 169 | various computers (Lenovo X60, X60s, X60T, T60, probably more).")
|
| 170 | (license license:gpl2)))
|
| 171 |
|
| 172 | (define-public ectool
|
| 173 | (package
|
| 174 | (name "ectool")
|
| 175 | (version %coreboot-version)
|
| 176 | (source %coreboot-origin)
|
| 177 | (build-system gnu-build-system)
|
| 178 | (arguments
|
| 179 | (list
|
| 180 | #:tests? #f |
| 181 | #:make-flags
|
| 182 | #~(list (string-append "CC=" #$(cc-for-target))
|
| 183 | "INSTALL=install"
|
| 184 | (string-append "PREFIX=" #$output))
|
| 185 | #:phases
|
| 186 | #~(modify-phases %standard-phases
|
| 187 | (add-after 'unpack 'chdir
|
| 188 | (lambda _
|
| 189 | (chdir "util/ectool")))
|
| 190 | (delete 'configure)))) |
| 191 | (home-page "https://doc.coreboot.org/util.html")
|
| 192 | (synopsis "Tool to dump and modify @acronym{EC, Embedded Controller} RAM
|
| 193 | on computers such as laptops")
|
| 194 | (description "This package provides @command{ectool}, a program to dump
|
| 195 | and modify the contents of @acronym{EC, Embedded Controller} RAM
|
| 196 | on mobile computers.")
|
| 197 | (license license:gpl2)))
|
| 198 |
|
| 199 | (define-public ifdtool
|
| 200 | (package
|
| 201 | (name "ifdtool")
|
| 202 | (version %coreboot-version)
|
| 203 | (source %coreboot-origin)
|
| 204 | (build-system gnu-build-system)
|
| 205 | (arguments
|
| 206 | (list
|
| 207 | #:make-flags
|
| 208 | #~(list (string-append "CC=" #$(cc-for-target))
|
| 209 | "INSTALL=install"
|
| 210 | (string-append "PREFIX=" #$output))
|
| 211 | #:phases
|
| 212 | #~(modify-phases %standard-phases
|
| 213 | (add-after 'unpack 'chdir
|
| 214 | (lambda _
|
| 215 | (chdir "util/ifdtool")))
|
| 216 | (delete 'configure)) |
| 217 | #:tests? #f)) |
| 218 | (home-page "https://doc.coreboot.org/util/ifdtool/")
|
| 219 | (synopsis "Intel Firmware Descriptor dumper")
|
| 220 | (description "This package provides @command{ifdtool}, a program to
|
| 221 | dump Intel Firmware Descriptor data of an image file.")
|
| 222 | (license license:gpl2)))
|
| 223 |
|
| 224 | (define-public intelmetool
|
| 225 | (package
|
| 226 | (name "intelmetool")
|
| 227 | (version %coreboot-version)
|
| 228 | (source %coreboot-origin)
|
| 229 | (build-system gnu-build-system)
|
| 230 | (arguments
|
| 231 | (list
|
| 232 | #:tests? #f |
| 233 | #:make-flags
|
| 234 | #~(list (string-append "CC=" #$(cc-for-target))
|
| 235 | "INSTALL=install"
|
| 236 | (string-append "PREFIX=" #$output))
|
| 237 | #:phases
|
| 238 | #~(modify-phases %standard-phases
|
| 239 | (add-after 'unpack 'chdir
|
| 240 | (lambda _
|
| 241 | (chdir "util/intelmetool")))
|
| 242 | (delete 'configure) |
| 243 | (delete 'check))))
|
| 244 | (inputs (list pciutils zlib))
|
| 245 | (home-page
|
| 246 | "https://github.com/coreboot/coreboot/tree/main/util/intelmetool/")
|
| 247 | (synopsis "Intel Management Engine tools")
|
| 248 | (description "This package provides tools for working with Intel
|
| 249 | Management Engine (ME). You need to @code{sudo rmmod mei_me} and
|
| 250 | @code{sudo rmmod mei} before using this tool. Also pass
|
| 251 | @code{iomem=relaxed} to the Linux kernel command line.")
|
| 252 | (license license:gpl2)
|
| 253 |
|
| 254 | |
| 255 | (supported-systems '("x86_64-linux" "i686-linux"))))
|
| 256 |
|
| 257 | (define-public nvramtool
|
| 258 | (package
|
| 259 | (name "nvramtool")
|
| 260 | (version %coreboot-version)
|
| 261 | (source %coreboot-origin)
|
| 262 | (build-system gnu-build-system)
|
| 263 | (arguments
|
| 264 | (list
|
| 265 | #:tests? #f |
| 266 | #:make-flags
|
| 267 | #~(list (string-append "CC=" #$(cc-for-target))
|
| 268 | "INSTALL=install"
|
| 269 | (string-append "PREFIX=" #$output))
|
| 270 | #:phases
|
| 271 | #~(modify-phases %standard-phases
|
| 272 | (add-after 'unpack 'chdir
|
| 273 | (lambda _
|
| 274 | (chdir "util/nvramtool")))
|
| 275 | (delete 'configure)))) |
| 276 | (home-page "https://coreboot.org")
|
| 277 | (synopsis "Command line tool that can edit Coreboot settings")
|
| 278 | (description "@command{nvramtool} can see and/or modify Coreboot settings
|
| 279 | like the serial port speed, log level, etc. It requires Coreboot to be compiled
|
| 280 | with CONFIG_USE_OPTION_TABLE and some options require the iomem=relaxed kernel
|
| 281 | command line to work. Features:
|
| 282 | @itemize
|
| 283 | @item If Coreboot was compiled without CONFIG_STATIC_OPTION_TABLE, it can change
|
| 284 | its settings, which are applied after a reboot.
|
| 285 | @item It can modify Coreboot images default settings with
|
| 286 | @command{nvramtool -C coreboot.rom [...]}.
|
| 287 | @item It has various options related to the file format used to store these
|
| 288 | settings.
|
| 289 | @item It can also read/write the CMOS memory where the Coreboot settings can be
|
| 290 | located.
|
| 291 | @end itemize")
|
| 292 | |
| 293 | |
| 294 | |
| 295 | (license license:gpl2)))
|