From 4ce4fc501035a8ef461e10d5f3df6ea3a63c7572 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Fri, 15 Jun 2018 09:52:42 +0200 Subject: system: Add os-with-u-boot. * gnu/system/install.scm (os-with-u-boot): New procedure. * gnu/packages/bootloaders.scm (make-u-boot-package): Export. * doc/guix.texi (Building the Installation Image for ARM Boards): New subsection. --- gnu/packages/bootloaders.scm | 2 +- gnu/system/install.scm | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index a86c73731e..c58fe07423 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -439,7 +439,7 @@ (define-public u-boot-tools also initializes the boards (RAM etc). This package provides its board-independent tools."))) -(define (make-u-boot-package board triplet) +(define-public (make-u-boot-package board triplet) "Returns a u-boot package for BOARD cross-compiled for TRIPLET." (let ((same-arch? (if (string-prefix? (%current-system) (gnu-triplet->nix-system triplet)) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 35f4ba9c24..6a3ae1947b 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -54,7 +54,8 @@ (define-module (gnu system install) novena-installation-os pine64-plus-installation-os rk3399-puma-installation-os - wandboard-installation-os)) + wandboard-installation-os + os-with-u-boot)) ;;; Commentary: ;;; @@ -386,6 +387,19 @@ (define installation-os nvi ;:wq! %base-packages)))) +(define* (os-with-u-boot os board #:key (bootloader-target "/dev/mmcblk0") + (triplet "arm-linux-gnueabihf")) + "Given OS, amend it with the u-boot bootloader for BOARD, +installed to BOOTLOADER-TARGET (a drive), compiled for TRIPLET. + +If you want a serial console, make sure to specify one in your +operating-system's kernel-arguments (\"console=ttyS0\" or similar)." + (operating-system (inherit os) + (bootloader (bootloader-configuration + (bootloader (bootloader (inherit u-boot-bootloader) + (package (make-u-boot-package board triplet)))) + (target bootloader-target))))) + (define* (embedded-installation-os bootloader bootloader-target tty #:key (extra-modules '())) "Return an installation os for embedded systems. -- cgit v1.2.3