From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eP4oe-0003nz-Cw for guix-patches@gnu.org; Wed, 13 Dec 2017 06:03:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eP4oZ-0006s7-Om for guix-patches@gnu.org; Wed, 13 Dec 2017 06:03:08 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:50792) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eP4oZ-0006s3-Kx for guix-patches@gnu.org; Wed, 13 Dec 2017 06:03:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eP4oZ-0001Zk-AV for guix-patches@gnu.org; Wed, 13 Dec 2017 06:03:03 -0500 Subject: [bug#29409] [PATCH v2 4/4] system: Add BeagleBone Black installer. Resent-Message-ID: From: m.othacehe@gmail.com Date: Wed, 13 Dec 2017 12:02:17 +0100 Message-Id: <1513162937-13145-4-git-send-email-m.othacehe@gmail.com> In-Reply-To: <1513162937-13145-1-git-send-email-m.othacehe@gmail.com> References: <1513162937-13145-1-git-send-email-m.othacehe@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 29409@debbugs.gnu.org From: Mathieu Othacehe * gnu/bootloader/u-boot.scm (u-boot-beaglebone-black-bootloader): New exported bootloader. * gnu/system/install.scm (beaglebone-black-installation-os): New exported variable. --- gnu/bootloader/u-boot.scm | 25 ++++++++++++++++++++++++- gnu/system/install.scm | 28 +++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index 963b0d7..397eb81 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -21,18 +21,35 @@ #:use-module (gnu bootloader extlinux) #:use-module (gnu bootloader) #:use-module (gnu system) + #:use-module (gnu build bootloader) #:use-module (gnu packages bootloaders) #:use-module (guix gexp) #:use-module (guix monads) #:use-module (guix records) #:use-module (guix utils) - #:export (u-boot-bootloader)) + #:export (u-boot-bootloader + u-boot-beaglebone-black-bootloader)) (define install-u-boot #~(lambda (bootloader device mount-point) (if bootloader (error "Failed to install U-Boot")))) +(define install-beaglebone-black-u-boot + ;; http://wiki.beyondlogic.org/index.php?title=BeagleBoneBlack_Upgrading_uBoot + ;; This first stage bootloader called MLO (U-Boot SPL) is expected at + ;; 0x20000 by BBB ROM code. The second stage bootloader will be loaded by + ;; the MLO and is expected at 0x60000. Write both first stage ("MLO") and + ;; second stage ("u-boot.img") images, read in BOOTLOADER directory, to the + ;; specified DEVICE. + #~(lambda (bootloader device mount-point) + (let ((mlo (string-append bootloader "/libexec/MLO")) + (u-boot (string-append bootloader "/libexec/u-boot.img"))) + (write-file-on-device mlo (* 256 512) + device (* 256 512)) + (write-file-on-device u-boot (* 1024 512) + device (* 768 512))))) + ;;; @@ -45,3 +62,9 @@ (name 'u-boot) (package #f) (installer install-u-boot))) + +(define u-boot-beaglebone-black-bootloader + (bootloader + (inherit u-boot-bootloader) + (package u-boot-beagle-bone-black) + (installer install-beaglebone-black-u-boot))) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index c2f73f7..d98becd 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -22,6 +22,7 @@ (define-module (gnu system install) #:use-module (gnu) + #:use-module (gnu bootloader u-boot) #:use-module (guix gexp) #:use-module (guix store) #:use-module (guix monads) @@ -42,7 +43,8 @@ #:use-module (gnu packages nvi) #:use-module (ice-9 match) #:use-module (srfi srfi-26) - #:export (installation-os)) + #:export (installation-os + beaglebone-black-installation-os)) ;;; Commentary: ;;; @@ -372,7 +374,27 @@ You have been warned. Thanks for being so brave.\x1b[0m nvi ;:wq! %base-packages)))) -;; Return it here so 'guix system' can consume it directly. -installation-os +(define beaglebone-black-installation-os + (operating-system + (inherit installation-os) + (bootloader (bootloader-configuration + (bootloader u-boot-beaglebone-black-bootloader) + (target "/dev/sda"))) + (kernel linux-libre) + (initrd (lambda (fs . rest) + (apply base-initrd fs + ;; This module is required to mount the sd card. + #:extra-modules (list "omap_hsmmc") + rest))) + (services (append + ;; mingetty does not work on serial lines. + ;; Use agetty with board-specific serial parameters. + (list (agetty-service + (agetty-configuration + (extra-options '("-L")) + (baud-rate "115200") + (term "vt100") + (tty "ttyO0")))) + (operating-system-user-services installation-os))))) ;;; install.scm ends here -- 2.7.4