From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMrwW-00053f-NT for guix-patches@gnu.org; Thu, 07 Dec 2017 03:54:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMrwQ-0003cD-Rz for guix-patches@gnu.org; Thu, 07 Dec 2017 03:54:08 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:41156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eMrwQ-0003c6-O1 for guix-patches@gnu.org; Thu, 07 Dec 2017 03:54:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eMrwQ-0000aA-BQ for guix-patches@gnu.org; Thu, 07 Dec 2017 03:54:02 -0500 Subject: [bug#29409] [PATCH] system: Add BeagleBone Black installer. References: <877euhtjkj.fsf@gmail.com> In-Reply-To: <877euhtjkj.fsf@gmail.com> Resent-Message-ID: From: m.othacehe@gmail.com Date: Thu, 7 Dec 2017 09:52:45 +0100 Message-Id: <1512636765-3322-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/boards/beaglebone-black.scm: New file returning bbb installer. * gnu/local.mk (GNU_SYSTEM_MODULES): Add new file. --- gnu/bootloader/u-boot.scm | 18 +++++++++++++++++- gnu/local.mk | 4 +++- gnu/system/boards/beaglebone-black.scm | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 gnu/system/boards/beaglebone-black.scm diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index 963b0d7..2169680 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -26,13 +26,23 @@ #: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 + #~(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 +55,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/local.mk b/gnu/local.mk index 434bbb0..53fc04e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -487,7 +487,9 @@ GNU_SYSTEM_MODULES = \ %D%/system/shadow.scm \ %D%/system/uuid.scm \ %D%/system/vm.scm \ - \ + \ + %D%/system/boards/beaglebone-black.scm \ + \ %D%/build/activation.scm \ %D%/build/cross-toolchain.scm \ %D%/build/file-systems.scm \ diff --git a/gnu/system/boards/beaglebone-black.scm b/gnu/system/boards/beaglebone-black.scm new file mode 100644 index 0000000..19ef412 --- /dev/null +++ b/gnu/system/boards/beaglebone-black.scm @@ -0,0 +1,33 @@ +(define-module (gnu system boards beaglebone-black) + #:use-module (gnu) + #:use-module (gnu system install) + #:use-module (gnu bootloader u-boot) + #:use-module (gnu packages bootloaders) + #:use-module (gnu packages linux) + #:export (beaglebone-black-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))))) + +;; Return it here so 'guix system' can consume it directly. +beaglebone-black-installation-os -- 2.7.4