From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id vfZoHIarNmF6hAEAgWs5BA (envelope-from ) for ; Tue, 07 Sep 2021 02:00:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6B1CF4arNmHjXQAAB5/wlQ (envelope-from ) for ; Tue, 07 Sep 2021 00:00:06 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7FB6021FA7 for ; Tue, 7 Sep 2021 02:00:05 +0200 (CEST) Received: from localhost ([::1]:56482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNOWy-0007OR-IT for larch@yhetil.org; Mon, 06 Sep 2021 20:00:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNOW6-0006oF-Kf for help-guix@gnu.org; Mon, 06 Sep 2021 19:59:10 -0400 Received: from mout02.posteo.de ([185.67.36.66]:55321) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNOW3-0004cX-2w for help-guix@gnu.org; Mon, 06 Sep 2021 19:59:10 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 8F784240101 for ; Tue, 7 Sep 2021 01:59:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1630972744; bh=G1JIBQP8marBfuTNfdhTDddaJMOcLbuPM0ZGWPnZ9j8=; h=From:To:Cc:Subject:Date:From; b=f46XMj24KfKtb8ethMaj548K10pCUu136YCUECII/X/ecp/1Dp9MQFB7svzgUuSOF BXDnvLcYbxR+pTcvTO3qhShyxcrGCzf1Y/+ymtGhSmpOsf1dSx/EpXQ3tfEOAcIRl/ 1BKGJ2l7jQRG1lmAy6z1DZVtV4PWc1gkwhPTnSiJJ7+0/VyEx3WU8OMODV6Ry6CmFE Lo48sZF67GwpXdyFFlXLfZ3pDYHZs7SCDruAZyjvwX/gy7M9QEukY6cdOk+XJ3WfTq QWXVuu53h17hlyxXwvZqyLnmGsb1AQU9uwBCsU03xh8H8hyYC7tQmTh1j4VUGXLMEH PNbYmrqscleBA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4H3QNR0ZwZz6tm4; Tue, 7 Sep 2021 01:59:02 +0200 (CEST) From: Fredrik Salomonsson To: Christine Lemmer-Webber Subject: Re: Guix on the MNT Reform In-Reply-To: <87czplcsdw.fsf@dustycloud.org> References: <87ftcaqxer.fsf@dustycloud.org> <874kbogf1h.fsf@dustycloud.org> <877dgjd441.fsf@d2.com> <87mtordcqq.fsf@dustycloud.org> <87h7exd41b.fsf@dustycloud.org> <875yvdh4w7.fsf@posteo.net> <87czplcsdw.fsf@dustycloud.org> Date: Mon, 06 Sep 2021 23:59:01 +0000 Message-ID: <8735qhgssa.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=plattfot@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630972805; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=JviAA2xaKkCLb57WXTL6waZifp9Ppcw4bNB63yeGU+o=; b=gSLnau7oCFfC3JDj4iCV7MlEstSmixuSuEC8/xnyL5ZWM1YwO7KgpH0p1W4mQGcAs+Cq0F 1XxNDKCJs5ZE+b79Q0yHrEJ+Y/M5kcd3cSWK3u5M/b9B+4wmh2778soFYxV4E/YqMkuWWO +iaAF5+f3OEHIjD/apeKn4ma7kPf5hsCgPi2pevQfwWeX/f6mvm/+Scc2pvR7ZM0Fi2uxM 1SLU7LkXFpdCBagB9FVr2Nl/I0qExuXeVuoNI/PLBsmVvsOshZaOqn2CCwaGbKuLtQi+EB Yr7XWbdurayWjkqPK01SS8uN52OYIepk1YP4IYCtBQBeYzHwMCFTDvSF6TfnWQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630972805; a=rsa-sha256; cv=none; b=ANeJNpyx2Dr0ZaXgx0s5ZS8s/EtJfu2woTJsUZld1Es+Z0/gO/Jg6ZNxo1W7Z+VKDvxuXM 4VsybLtNzGYzKK4TPk3Tc3rDqQ0nX7rVXojUmNuja0JVE1BDT2Hq9xq483THoqf+7ouA05 dKkduO2CHLhWaty7POs2SsQ7sm0zDY2SQfckhFbPkjTdmACn598MSQsiVc4N/wnNcIUGTO UfSX3JNCBFrgZbCyZALKraJAMqQ/rEkCJmSlPQI/PmWhX7+4+KcBTtqmEGlUwL9AmnORd8 1T8FLKLNBIg7C34QkmusAmQHxV8fDDn5rycgcCf4WWIXjmnkk0QETK0Vp4MMnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=f46XMj24; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=f46XMj24; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 7FB6021FA7 X-Spam-Score: -3.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: hXcUoAfUP5bO Christine Lemmer-Webber writes: > Ooh! This is a great email. Thank you for your help. Not sure how much of a help I am :). > That seems right. I don't understand the config system that's here to > know what to do. > > I noticed that the source/README directory says the following: > > #+BEGIN_QUOTE > - CONFIG_SYS_MALLOC_SIMPLE > Provides a simple and small malloc() and calloc() for those > boards which do not use the full malloc in SPL (which is > enabled with CONFIG_SYS_SPL_MALLOC_START). > #+END_QUOTE > > Now note that by following their custom instructions, I had set a rule > in the package definition above to copy =3Dmntreform-config=3D to =3D.con= fig=3D > > But I also just noticed something strange. > > The build directory is: > > /tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0/source > > yet the error appears as: > > /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-= checkout/include/malloc.h > > I don't know how common this is, but this surprised me to see that it > was pointing at something from the checkout rather than in the build > directory. > > So, I changed where the copy config step was and put it in the source > section. Then, since the config step incorrectly identified this as not > being a valid board (we're really doing the config step manually) I > deleted it: > > #+BEGIN_SRC scheme > (define-public u-boot-mnt-reform2 > (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu")) > (commit "bdcdce7434b9db19aabd59181014f24d66af0db8")) > (package > (inherit base) > (version "2021.06") > (name "u-boot-mnt-reform2") > (source (origin > (method git-fetch) > (uri (git-reference > (url "https://source.mnt.re/reform/reform-boundary-= uboot.git") > (commit commit))) > (file-name (git-file-name name version)) > (sha256 > (base32 > "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3")) > (snippet > '(copy-file "mntreform-config" ".config")))) > (arguments > (substitute-keyword-arguments (package-arguments base) > ((#:phases phases) > `(modify-phases ,phases > (delete 'configure)))))))) > #+END_SRC > > Now things compile! Nice find! I didn't notice the include coming from the checkout directory so I was comparing the build output from running the #+begin_src sh CROSS_COMPILE=3Daarch64-linux-gnu- ARCH=3Darm make -j$(nproc) #+end_src in the =3Dhttps://source.mnt.re/reform/reform-boundary-uboot.git=3D repo to the output I got from guix build. > Now note that it looks like we need to do two steps, so this probably is > not complete. From the mkuboot.sh mentioned previously: > > #+BEGIN_SRC sh > # build rescue u-boot first (loads kernel from eMMC) > make -j$(nproc) flash.bin KCPPFLAGS=3D'-DMNTREFORM_BOOT_EMMC' > cp flash.bin flash-rescue.bin > > # build normal u-boot second (loads kernel from SD card) > make -j$(nproc) flash.bin > #+END_SRC > > So maybe we need to incorporate that before using this. I'm not sure we need both to get this working. As if you look in the =3Dmkimage.sh=3D script it actually creates two images. One for the eMMC and one for the SD card. To just get this booting using the SD card, what we have should be enough. I'm currently trying to create an image from it but hitting some build issues. This is what I have right now: #+begin_src diff diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index 6cad33b741..7d3f07e8ab 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -34,6 +34,7 @@ u-boot-firefly-rk3399-bootloader u-boot-mx6cuboxi-bootloader u-boot-nintendo-nes-classic-edition-bootloader + u-boot-mnt-reform2-bootloader u-boot-novena-bootloader u-boot-pine64-plus-bootloader u-boot-pine64-lts-bootloader @@ -209,6 +210,11 @@ (inherit u-boot-imx-bootloader) (package u-boot-wandboard))) =20 +(define u-boot-mnt-reform2-bootloader + (bootloader + (inherit u-boot-imx-bootloader) + (package u-boot-mnt-reform2))) + (define u-boot-novena-bootloader (bootloader (inherit u-boot-imx-bootloader) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 5f7dfa0f8f..c365adc93a 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -980,6 +980,30 @@ to Novena upstream, does not load u-boot.img from the = first partition.") `(("firmware" ,arm-trusted-firmware-rk3399) ,@(package-native-inputs base)))))) =20 +(define-public u-boot-mnt-reform2 + (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu")) + (commit "bdcdce7434b9db19aabd59181014f24d66af0db8")) + (package + (inherit base) + (version "2021.06") + (name "u-boot-mnt-reform2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://source.mnt.re/reform/reform-boundary-u= boot.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3")) + (snippet + '(copy-file "mntreform-config" ".config")))) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases) + `(modify-phases ,phases + (delete 'configure)))))))) + (define-public vboot-utils (package (name "vboot-utils") diff --git a/gnu/system/images/mnt-reform2.scm b/gnu/system/images/mnt-refo= rm2.scm new file mode 100644 index 0000000000..1d1df1383e --- /dev/null +++ b/gnu/system/images/mnt-reform2.scm @@ -0,0 +1,66 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 Fredrik Salomonsson +;;; +;;; 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 . + +(define-module (gnu system images mnt-reform2) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader u-boot) + #:use-module (gnu image) + #:use-module (gnu packages linux) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services networking) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system image) + #:use-module (srfi srfi-26) + #:export (mnt-reform2-barebones-os + mnt-reform2-image-type + mnt-reform2-barebones-raw-image)) + +(define mnt-reform2-barebones-os + (operating-system + (host-name "sarimner") + (timezone "Canada/Pacific") + (locale "en_US.utf8") + (bootloader (bootloader-configuration + (bootloader u-boot-mnt-reform2-bootloader) + (targets '("/dev/mmcblk1")))) + (initrd-modules '("sdhci-esdhc-imx")) + (kernel linux-libre-arm64-generic) + (file-systems (cons (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (services (append (list (service dhcp-client-service-type)) + %base-services)))) + +(define mnt-reform2-image-type + (image-type + (name 'mnt-reform2-raw) + (constructor (cut image-with-os + (arm64-disk-image (* 4 (expt 2 20))) ;4MiB + <>)))) + +(define mnt-reform2-barebones-raw-image + (image + (inherit + (os->image mnt-reform2-barebones-os #:type mnt-reform2-image-type)) + (name 'mnt-reform2-barebones-raw-image))) + +mnt-reform2-barebones-raw-image #+end_src And I'm using this config to create the image: #+begin_src scheme (use-modules (gnu) (gnu bootloader u-boot) (gnu packages bootloaders) (gnu packages linux) (gnu packages) (gnu services nfs) (gnu services sddm) (gnu system locale) (gnu system nss) (ice-9 rdelim) (ice-9 format) (srfi srfi-1)) (use-service-modules desktop networking ssh base xorg) (use-package-modules wm certs shells xdisorg display-managers) (define plattfot (user-account (name "plattfot") (group "users") ;; Define a G-Expr to find the path of the zsh binary: ;; https://gitlab.com/rain1/guix-wiki/wikis/FAQ#how-do-i-make-my-login-s= hell-zsh ;;(shell #~(string-append #$zsh "/bin/zsh")) (supplementary-groups '("wheel" "netdev" "audio" "video")) (home-directory "/home/plattfot"))) (define fs-root (file-system (mount-point "/") (type "ext4") (device (file-system-label "my-root")) (needed-for-boot? #t))) (operating-system (host-name "sarimner") (timezone "Canada/Pacific") (locale "en_US.utf8") (locale-definitions (list (locale-definition (name "en_US.utf8") (source "en_US") (charset "UTF-8= ")) (locale-definition (name "sv_SE.utf8") (source "sv_SE") (charset "UTF-8= ")))) (bootloader (bootloader-configuration (targets '("/dev/mmcblk1")) (bootloader u-boot-mnt-reform2-bootloader))) (initrd-modules '("sdhci-esdhc-imx")) ;; (kernel linux-libre-arm64-generic) (file-systems (cons* fs-root %base-file-systems)) ;; (swap-devices '("/swapfile")) (users (cons plattfot %base-user-accounts)) (keyboard-layout (keyboard-layout "eu")) ;; (packages (cons* sway waybar ;; rofi ;; nss-certs ;for HTTPS access ;; %base-packages)) ;; (services ;; (cons* (service openssh-service-type ;; (openssh-configuration ;; (port-number 6060) ;; (password-authentication? #f))) ;; (extra-special-file "/usr/bin/env" (file-append coreutils "/bi= n/env")) ;; (remove (lambda (service) ;; (member (service-kind service) ;; (list ;; gdm-service-type ;; ))) ;; %desktop-services))) ;; Allow resolution of '.local' host names with mDNS. ;; (name-service-switch %mdns-host-lookup-nss) ) #+end_src I'm building the image with: #+begin_src shell guix environment guix ./pre-inst-env guix system image --image-type=3Dmnt-reform2-raw config.scm #+end_src I tried with the =3Dlinux-libre-arm64-generic=3D first but that couldn't find the =3Dsdhci-esdhc-imx=3D module. And now when I'm testing with just the linux-libre kernel I'm running out of space on my =3D/tmp=3D. Is there an easy way of telling the guix-daemon to use another path for building? Or do I need to restart it and change its =3DTMPDIR=3D? > However, I'm actually disturbed by looking at a few things in the > "environment-variables" file spit out in the build file. It says the > following: > > #+BEGIN_SRC sh > export TEMP=3D\ > "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0" > export TEMPDIR=3D\ > "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0" > export TMP=3D\ > "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0" > export TMPDIR=3D\ > "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0" > #+END_SRC > > But here's the weird thing. This is in: > > /tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-4 > > Now wait a minute. Look at that last number. What the hell is going on > here? Is this a bug in Guix? Why is it pointing at -0 in the -4 build > directory? I stumbled upon this when checking how to change the build directory for the guix-daemon [0]: #+begin_quote When the daemon performs a build on behalf of the user, it creates a build directory under =E2=80=98/tmp=E2=80=99 or under the directory specifi= ed by its =E2=80=98TMPDIR=E2=80=99 environment variable. This directory is shared wi= th the container for the duration of the build, though within the container, the build tree is always called =E2=80=98/tmp/guix-build-NAME.drv-0=E2=80= =99. #+end_quote [0] https://guix.gnu.org/manual/en/html_node/Invoking-guix_002ddaemon.html So I don't think it's a bug. --=20 s/Fred[re]+i[ck]+/Fredrik/g