From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wLv2BZilLGOwWgEAbAwnHQ (envelope-from ) for ; Thu, 22 Sep 2022 20:12:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +IL3BZilLGN6HAEA9RJhRA (envelope-from ) for ; Thu, 22 Sep 2022 20:12:40 +0200 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 596C18DEA for ; Thu, 22 Sep 2022 20:12:39 +0200 (CEST) Received: from localhost ([::1]:44020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obQgg-0007NI-EJ for larch@yhetil.org; Thu, 22 Sep 2022 14:12:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obOvi-0001IP-J4 for guix-patches@gnu.org; Thu, 22 Sep 2022 12:20:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39243) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obOvi-0002Wa-1z for guix-patches@gnu.org; Thu, 22 Sep 2022 12:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obOvh-0002nL-SC for guix-patches@gnu.org; Thu, 22 Sep 2022 12:20:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48314] [PATCH v5] Install guix system on Raspberry Pi Resent-From: Stefan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 22 Sep 2022 16:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48314 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48314@debbugs.gnu.org, Vagrant Cascadian , phodina , Danny Milosavljevic Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 48314-submit@debbugs.gnu.org id=B48314.166386356410696 (code B ref 48314); Thu, 22 Sep 2022 16:20:01 +0000 Received: (at 48314) by debbugs.gnu.org; 22 Sep 2022 16:19:24 +0000 Received: from localhost ([127.0.0.1]:38322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obOv6-0002mS-KS for submit@debbugs.gnu.org; Thu, 22 Sep 2022 12:19:24 -0400 Received: from mr6.vodafonemail.de ([145.253.228.166]:42056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obOv4-0002mF-WB for 48314@debbugs.gnu.org; Thu, 22 Sep 2022 12:19:23 -0400 Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr6.vodafonemail.de (Postfix) with ESMTPS id 4MYL846dgKz1xyb; Thu, 22 Sep 2022 16:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-21dec; t=1663863557; bh=X/j2nqwhGe2ikHqBDcW6dH8/THTL56rDrWyiBFyqVng=; h=Content-Type:Subject:From:In-Reply-To:Date:Message-Id:References: To:X-Mailer:From; b=l4rYGVRDnrj8hw2tn0EXWnIfwP9y5eXMeou0mDTSbqr0/F3qpEEjbV2Nl2R6BKFzS BRHum+/IuVePeyRRqrFP0AvJqR6DWw/MdNwAZVEFO6P2QqjLq+uP1i7La/3DP+xgv8 lScLAhVqOsVSgV+/QhNN1Lyxpl12HTrMV9g2aCJc= Received: from macbook-pro.kuh-wiese.my-router.de (aftr-62-216-207-171.dynamic.mnet-online.de [62.216.207.171]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4MYL7q6cTDz9rx7; Thu, 22 Sep 2022 16:19:00 +0000 (UTC) Content-Type: multipart/mixed; boundary="Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3" Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) In-Reply-To: Date: Thu, 22 Sep 2022 18:18:59 +0200 Message-Id: <204332DD-AA02-4A31-9B48-FB3FAB9BD8F3@vodafonemail.de> References: <2IN6BsQe0_wSC9iwf7LHT5LUk7wXLVXytkDtcg7RIYByyYFTsuC9BZPR_wdv4eDMncsZfy17h7z9jIRRSC6kfV2odXkt0hp4Lilq5sGYdVo=@protonmail.com> X-Mailer: Apple Mail (2.3124) X-purgate-type: clean X-purgate: clean X-purgate-size: 144738 X-purgate-ID: 155817::1663863556-E9FFA4F8-A7967074/0/0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Stefan X-ACL-Warn: , Stefan via Guix-patches From: Stefan via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663870359; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=X/j2nqwhGe2ikHqBDcW6dH8/THTL56rDrWyiBFyqVng=; b=On7BNAK+54MlnHkuYN/5uqPA/vF0arNdJLqLQMEsWk5gvXQ514aJuysVQphtiDT9IhBMjt Pwph0yP/viCykyx0efnxks+BTYGqdmmWIYLWsrl9ck05nAWA4jQ0npQ+2COOOn1XTtiH1p 7mZfbroh6xpDgNeGNCK7ut+Ob/bwH2di5nd7chqJJIvB+yBP3kqbfb/Oupb8MhlRmaP8gm 7xWIyCXd/GjC5sg3MeUY0DvROg7SCnJGvwRUuSc/wnTbnWGrKfxGncm0s+U5WwiLIiPQ4M oIP4Gyws/HPXajwIQjNSKW87YKLpvp4IHiNq86Jd6IOOYO1oj/peheM9Jwen5w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663870359; a=rsa-sha256; cv=none; b=eM6nrd4dYwPivsYHcAMcGT85O1X8gKdlDRNbhUtFU0GTFXiGLVJlajf8GnMwQ0ZIvRUeLI X09XmMYCMwt8XOpnM5sRkiTH9ql71iOuSldTp0MApIJWfgbE8LgQ0nFCxwE/UOu7nWPDNq GPu0xHDkMOw6gohX3tYTXADyL3H1dNeK54i/hCf/ItvhXabSSnPrqXkHELiseFeUb8CqJc KTBlRiWu32lsXFU3n6STJ3xGWZPTqNVtT++HZI14lllVIywcgsEN+MaaBw6D55RloOec8Y ESUkMFse0s8ScWNaxpKrMAldMCUsoubXQntc6z7qnIZKyFCZb4VKm3k/gbBjHQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=vodafonemail.de header.s=vfde-mb-mr2-21dec header.b=l4rYGVRD; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.85 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=vodafonemail.de header.s=vfde-mb-mr2-21dec header.b=l4rYGVRD; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 596C18DEA X-Spam-Score: -2.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: CqLkSohPURYK --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi! I did a rebase onto commit 2e8b4f9bfa00489fd3acff305837a79af236e183. Vagrant, there was a comment left about removing "CONFIG_BOOTDELAY=3D1" = for the u-boot, this is now done. I think all review comments have been = applied. There is a new u-boot-rockpro64-rk3399 which I adapted as well to use = the #:configs keyword argument. The function modify-defconfig in guix/build/kconfig.scm no longer = interprets "CONFIG_XY=3D" like "# CONFIG_XY is not set". Bye Stefan --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Disposition: attachment; filename=01-gnu-linux-fix-extra-version.patch Content-Type: application/octet-stream; name="01-gnu-linux-fix-extra-version.patch" Content-Transfer-Encoding: quoted-printable gnu:=20linux:=20Fix=20the=20extra-version=20parameter=20in=20= make-linux-libre*.=0A=0AFrom:=20Stefan=20=0A= =0A*=20gnu/packages/linux.scm=20(make-linux-libre*)=20= ['set-environment]:=20Make=0Athe=20Makefile=20accept=20EXTRAVERSION=20= from=20the=20environment.=20Fix=20the=20usage=20of=0Aan=20empty=20= extra-version=20string.=20Split=20this=20new=20phase=20out=20of=20and=20= adding=0Aif=20before=20=E2=80=A6=0A['configure]:=20=E2=80=A6=20to=20make=20= the=20phases=20more=20hackable.=0A---=0A=20gnu/packages/linux.scm=20|=20=20= =2018=20+++++++++++-------=0A=201=20file=20changed,=2011=20= insertions(+),=207=20deletions(-)=0A=0Adiff=20--git=20= a/gnu/packages/linux.scm=20b/gnu/packages/linux.scm=0Aindex=20= 306c18e398..1a35e857c3=20100644=0A---=20a/gnu/packages/linux.scm=0A+++=20= b/gnu/packages/linux.scm=0A@@=20-64,6=20+64,7=20@@=0A=20;;;=20Copyright=20= =C2=A9=202022=20Artyom=20V.=20Poptsov=20=0A=20= ;;;=20Copyright=20=C2=A9=202022=20Rene=20Saavedra=20= =0A=20;;;=20Copyright=20=C2=A9=202022=20muradm=20= =0A+;;;=20Copyright=20=C2=A9=202022=20Stefan=20= =0A=20=0A=20;;;=0A=20;;;=20This=20file=20is=20= part=20of=20GNU=20Guix.=0A@@=20-824,8=20+825,8=20@@=20for=20ARCH=20and=20= optionally=20VARIANT,=20or=20#f=20if=20there=20is=20no=20such=20= configuration."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (lambda=20_=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (substitute*=20(find-files=20"."=20"^Makefile(\\.include)?$")=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(("/bin/pwd")=20= "pwd"))))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(replace=20= 'configure=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (lambda*=20(#:key=20inputs=20target=20#:allow-other-keys)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(add-before=20'configure=20= 'set-environment=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (lambda*=20(#:key=20target=20#:allow-other-keys)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20Avoid=20introducing=20= timestamps.=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setenv=20"KCONFIG_NOTIMESTAMP"=20"1")=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(setenv=20"KBUILD_BUILD_TIMESTAMP"=0A@@=20= -847,13=20+848,16=20@@=20for=20ARCH=20and=20optionally=20VARIANT,=20or=20= #f=20if=20there=20is=20no=20such=20configuration."=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setenv=20= "CROSS_COMPILE"=20(string-append=20target=20"-"))=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(format=20#t=20= "`CROSS_COMPILE'=20set=20to=20`~a'~%"=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(getenv=20= "CROSS_COMPILE"))))=0A-=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20Allow=20EXTRAVERSION=20to=20be=20set=20via=20the=20= environment.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (substitute*=20"Makefile"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(("^=20*EXTRAVERSION[[:blank:]]*=3D")=20"EXTRAVERSION=20= ?=3D"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setenv=20"EXTRAVERSION"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20#$(and=20extra-version=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(string-append=20"-"=20extra-version)))=0A-=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(not=20(string-null?=20extra-version))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(string-append=20"-"=20extra-version)))))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(replace=20'configure=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(lambda*=20(#:key=20inputs=20= #:allow-other-keys)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(let=20((config=20(assoc-ref=20inputs=20"kconfig")))=0A-=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Use=20a=20= custom=20kernel=20configuration=20file=20or=20a=20default=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20configuration=20= file.=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (if=20config=0A@@=20-871,7=20+875,7=20@@=20for=20ARCH=20and=20optionally=20= VARIANT,=20or=20#f=20if=20there=20is=20no=20such=20configuration."=0A=20=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (invoke=20"make"=20"oldconfig"))))=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(replace=20'install=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(lambda*=20(#:key=20inputs=20native-inputs=20= #:allow-other-keys)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (lambda*=20(#:key=20inputs=20#:allow-other-keys)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(let=20((moddir=20(string-append=20= #$output=20"/lib/modules"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(dtbdir=20(string-append=20#$output=20= "/lib/dtbs")))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20Install=20kernel=20image,=20kernel=20configuration=20and=20= link=20map.=0A= --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Disposition: attachment; filename=02-gnu-bootloader-rework-chaining.patch Content-Type: application/octet-stream; name="02-gnu-bootloader-rework-chaining.patch" Content-Transfer-Encoding: quoted-printable gnu:=20bootloader:=20Rework=20chaining,=20add=20= grub-efi-netboot-removable-bootloader.=0A=0AFrom:=20Stefan=20= =0A=0A*=20doc/guix.texi=20(Bootloader=20= Configuration):=20Describe=20the=20new=0A= =E2=80=98grub-efi-netboot-removable-bootloader=E2=80=99.=20=20Mention=20= used=20sub-directories=20and=0Athat=20the=20UEFI=20Boot=20Manager=20is=20= not=20modified.=20=20Advice=20to=20disable=20write-access=0Aover=20TFTP.=0A= *=20gnu/bootloader.scm=20(efi-bootloader-profile):=20Allow=20a=20list=20= of=20packages=20and=0Acollect=20everything=20directly=20in=20the=20= profile,=20avoiding=20a=20separate=20collection=0Adirectory.=20=20= Renamed=20the=20profile=20from=20"bootloader-profile"=20to=0A= "efi-bootloader-profile".=0A[bootloader-collection]:=20Renamed=20to=20= =E2=80=A6=0A[efi-bootloader-profile-hook]:=20=E2=80=A6=20this=20and=20= removed=20unused=20modules=20and=20the=0Acreation=20of=20the=20now=20= unneeded=20collection=20directory.=0A(efi-bootloader-chain):=20Added=20= packages=20and=20disk-image-installer=20arguments.=0ARemoved=20handling=20= of=20the=20collection=20directory,=20now=20only=20calling=20the=20given=0A= installer=20procedure.=0A*=20gnu/bootloader/grub.scm=20= (make-grub-efi-netboot-installer):=20New=20helper.=0A= (make-grub-configuration):=20New=20helper=20based=20on=20= (grub-configuration-file).=0AAdding=20grub=20argument,=20fixed=20= indentation,=20removend=20code=20to=20get=20grub.=0A= (grub-configuration-file):=20Now=20using=20(make-grub-configuration).=0A= (grub-efi-configuration-file):=20New=20function=20using=20= (make-grub-configuration).=0AInstead=20of=20getting=20the=20grub-efi=20= package=20from=20the=20bootloader-configuration=0Athis=20function=20= refers=20to=20the=20grub-efi=20package=20directly.=0A(grub-cfg):=20New=20= variable=20to=20replace=20"/boot/grub/grub.cfg".=0A= (install-grub-efi-netboot):=20Removed,=20the=20functionality=20got=20= moved.=0A(make-grub-efi-netboot-installer):=20New=20helper=20function=20= to=20return=20a=20customized=0Ainstaller=20for=20a=20certain=20= efi-sub-directory.=20=20The=20installer=20basically=20copies=0Aa=20= pre-installed=20efi-bootloader-profile,=20and=20adds=20needed=20symlinks=20= for=20booting=0Aover=20network,=20or=20=E2=80=93=20on=20an=20ESP=20=E2=80=93= =20an=20intermediate=20grub-cfg=20to=20load=20the=20final=0Agrub-cfg=20= file.=0A(grub-bootloader):=20Now=20using=20the=20grub-cfg=20variable.=0A= (grub-efi-bootloader):=20Now=20using=20the=20grub-cfg=20variable.=20=20= Removed=20inheritance,=0Agiving=20complete=20set=20of=20fields.=0A= (make-grub-efi-netboot-bootloader):=20New=20helper=20function.=0A= (grub-efi-netboot-bootloader):=20Now=20using=20the=20helper.=0A= (grub-efi-netboot-removable-bootloader):=20New=20bootloader=20using=20= the=20helper.=0AIt=20uses=20the=20efi-sub-directory=20"efi/boot"=20for=20= removable=20media.=0A*=20gnu/packages/bootloaders.scm=20= (make-grub-efi-netboot):=20New=20function=20to=20return=0Aa=20grub-efi=20= package=20pre-installed=20via=20grub-mknetdir,=20customized=20for=20an=0A= efi-sub-directory=20and=20able=20to=20boot=20via=20network=20and=20local=20= storage.=0A=0AThe=20rework=20allows=20to=20use=20an=20= (efi-bootloader-chain)=20like=20this,=20which=20is=20able=0Ato=20boot=20= over=20network=20or=20local=20storage,=20depending=20on=20the=20= symlink-support=20at=0Athe=20bootloader-target:=0A=0A(operating-system=0A= =20(bootloader=0A=20=20=20(bootloader-configuration=0A=20=20=20=20=20= (bootloader=0A=20=20=20=20=20=20=20(efi-bootloader-chain=0A=20=20=20=20=20= =20=20=20=20grub-efi-netboot-removable-bootloader=0A=20=20=20=20=20=20=20= =20=20#:packages=20(list=20my-firmware-package=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20my-u-boot-package)=0A= =20=20=20=20=20=20=20=20=20#:files=20(list=20(plain-file=20"config.txt"=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20"kernel=3Du-boot.bin"))=0A=20=20=20=20=20=20= =20=20=20#:hooks=20my-special-bootloader-profile-manipulator))=0A=20=20=20= =20=20(target=20"/booti/efi")=0A=20=20=20=20=20=E2=80=A6))=0A=20=E2=80=A6)= =0A)=0A---=0A=20doc/guix.texi=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20|=20=20=2058=20++++++++---=0A=20gnu/bootloader.scm=20=20=20=20=20=20=20= =20=20=20=20|=20=20104=20++++++++++----------=0A=20= gnu/bootloader/grub.scm=20=20=20=20=20=20|=20=20215=20= ++++++++++++++++++++++++++----------------=0A=20= gnu/packages/bootloaders.scm=20|=20=20=2090=20++++++++++++++++++=0A=204=20= files=20changed,=20318=20insertions(+),=20149=20deletions(-)=0A=0Adiff=20= --git=20a/doc/guix.texi=20b/doc/guix.texi=0Aindex=20= eb12efa85e..17f5ffb431=20100644=0A---=20a/doc/guix.texi=0A+++=20= b/doc/guix.texi=0A@@=20-37308,8=20+37308,9=20@@=20The=20type=20of=20a=20= bootloader=20configuration=20declaration.=0A=20@cindex=20BIOS,=20= bootloader=0A=20The=20bootloader=20to=20use,=20as=20a=20= @code{bootloader}=20object.=20=20For=20now=0A=20@code{grub-bootloader},=20= @code{grub-efi-bootloader},=0A-@code{grub-efi-netboot-bootloader},=20= @code{grub-efi-removable-bootloader},=0A-@code{extlinux-bootloader}=20= and=20@code{u-boot-bootloader}=20are=20supported.=0A= +@code{grub-efi-removable-bootloader},=20= @code{grub-efi-netboot-bootloader},=0A= +@code{grub-efi-netboot-removable-bootloader},=20= @code{extlinux-bootloader}=0A+and=20@code{u-boot-bootloader}=20are=20= supported.=0A=20=0A=20@cindex=20ARM,=20bootloaders=0A=20@cindex=20= AArch64,=20bootloaders=0A@@=20-37318,15=20+37319,29=20@@=20modules.=20=20= In=20particular,=20@code{(gnu=20bootloader=20u-boot)}=20contains=20= definitions=0A=20of=20bootloaders=20for=20a=20wide=20range=20of=20ARM=20= and=20AArch64=20systems,=20using=20the=0A=20= @uref{https://www.denx.de/wiki/U-Boot/,=20U-Boot=20bootloader}.=0A=20=0A= +@vindex=20grub-bootloader=0A+@code{grub-bootloader}=20allows=20you=20to=20= boot=20in=20particular=20Intel-based=20machines=0A+in=20``legacy''=20= BIOS=20mode.=0A+=0A=20@vindex=20grub-efi-bootloader=0A=20= @code{grub-efi-bootloader}=20allows=20to=20boot=20on=20modern=20systems=20= using=20the=0A=20@dfn{Unified=20Extensible=20Firmware=20Interface}=20= (UEFI).=20=20This=20is=20what=20you=20should=0A=20use=20if=20the=20= installation=20image=20contains=20a=20@file{/sys/firmware/efi}=20= directory=0A=20when=20you=20boot=20it=20on=20your=20system.=0A=20=0A= -@vindex=20grub-bootloader=0A-@code{grub-bootloader}=20allows=20you=20to=20= boot=20in=20particular=20Intel-based=20machines=0A-in=20``legacy''=20= BIOS=20mode.=0A+@vindex=20grub-efi-removable-bootloader=0A= +@code{grub-efi-removable-bootloader}=20allows=20you=20to=20boot=20your=20= system=20from=0A+removable=20media=20by=20writing=20the=20GRUB=20file=20= to=20the=20UEFI-specification=20location=20of=0A= +@file{/EFI/BOOT/BOOTX64.efi}=20of=20the=20boot=20directory,=20usually=20= @file{/boot/efi}.=0A+This=20is=20also=20useful=20for=20some=20UEFI=20= firmwares=20that=20``forget''=20their=20configuration=0A+from=20their=20= non-volatile=20storage.=20Like=20@code{grub-efi-bootloader},=20this=20= can=20only=0A+be=20used=20if=20the=20@file{/sys/firmware/efi}=20= directory=20is=20available.=0A+=0A+@quotation=20Note=0A+This=20= @emph{will}=20overwrite=20the=20GRUB=20file=20from=20any=20other=20= operating=20systems=20that=0A+also=20place=20their=20GRUB=20file=20in=20= the=20UEFI-specification=20location;=20making=20them=0A+unbootable.=0A= +@end=20quotation=0A=20=0A=20@vindex=20grub-efi-netboot-bootloader=0A=20= @code{grub-efi-netboot-bootloader}=20allows=20you=20to=20boot=20your=20= system=20over=20network=0A@@=20-37335,9=20+37350,10=20@@=20build=20a=20= diskless=20Guix=20system.=0A=20=0A=20The=20installation=20of=20the=20= @code{grub-efi-netboot-bootloader}=20generates=20the=0A=20content=20of=20= the=20TFTP=20root=20directory=20at=20@code{targets}=20(@pxref{Bootloader=0A= -Configuration,=20@code{targets}}),=20to=20be=20served=20by=20a=20TFTP=20= server.=20=20You=20may=0A-want=20to=20mount=20your=20TFTP=20server=20= directories=20onto=20the=20@code{targets}=20to=0A-move=20the=20required=20= files=20to=20the=20TFTP=20server=20automatically.=0A+Configuration,=20= @code{targets}})=20below=20the=20sub-directory=20@file{efi/Guix},=20to=20= be=0A+served=20by=20a=20TFTP=20server.=20=20You=20may=20want=20to=20= mount=20your=20TFTP=20server=20directories=0A+onto=20the=20= @code{targets}=20to=20move=20the=20required=20files=20to=20the=20TFTP=20= server=0A+automatically=20during=20installation.=0A=20=0A=20If=20you=20= plan=20to=20use=20an=20NFS=20root=20file=20system=20as=20well=20= (actually=20if=20you=20mount=20the=0A=20store=20from=20an=20NFS=20= share),=20then=20the=20TFTP=20server=20needs=20to=20serve=20the=20file=0A= @@=20-37366,25=20+37382,33=20@@=20this=20constellation=20the=20symlinks=20= will=20work.=0A=20For=20other=20constellations=20you=20will=20have=20to=20= program=20your=20own=20bootloader=0A=20installer,=20which=20then=20takes=20= care=20to=20make=20necessary=20files=20from=20the=20store=0A=20= accessible=20through=20TFTP,=20for=20example=20by=20copying=20them=20= into=20the=20TFTP=20root=0A-directory=20to=20your=20@code{targets}.=0A= +directory=20for=20your=20@code{targets}.=0A=20=0A=20It=20is=20important=20= to=20note=20that=20symlinks=20pointing=20outside=20the=20TFTP=20root=20= directory=0A=20may=20need=20to=20be=20allowed=20in=20the=20configuration=20= of=20your=20TFTP=20server.=20=20Further=20the=0A=20store=20link=20= exposes=20the=20whole=20store=20through=20TFTP@.=20=20Both=20points=20= need=20to=20be=0A-considered=20carefully=20for=20security=20aspects.=0A= +considered=20carefully=20for=20security=20aspects.=20=20It=20is=20= advised=20to=20disable=20any=20TFTP=0A+write=20access!=0A+=0A+Please=20= note,=20that=20this=20bootloader=20will=20not=20modify=20the=20=E2=80=98UE= FI=20Boot=20Manager=E2=80=99=20of=0A+the=20system.=0A=20=0A=20Beside=20= the=20@code{grub-efi-netboot-bootloader},=20the=20already=20mentioned=20= TFTP=20and=0A=20NFS=20servers,=20you=20also=20need=20a=20properly=20= configured=20DHCP=20server=20to=20make=20the=20booting=0A=20over=20= netboot=20possible.=20=20For=20all=20this=20we=20can=20currently=20only=20= recommend=20you=20to=20look=0A=20for=20instructions=20about=20= @acronym{PXE,=20Preboot=20eXecution=20Environment}.=0A=20=0A-@vindex=20= grub-efi-removable-bootloader=0A-@code{grub-efi-removable-bootloader}=20= allows=20you=20to=20boot=20your=20system=20from=0A-removable=20media=20= by=20writing=20the=20GRUB=20file=20to=20the=20UEFI-specification=20= location=20of=0A-@file{/EFI/BOOT/BOOTX64.efi}=20of=20the=20boot=20= directory,=20usually=20@file{/boot/efi}.=0A-This=20is=20also=20useful=20= for=20some=20UEFI=20firmwares=20that=20``forget''=20their=20= configuration=0A-from=20their=20non-volatile=20storage.=20Like=20= @code{grub-efi-bootloader},=20this=20can=20only=0A-be=20used=20if=20the=20= @file{/sys/firmware/efi}=20directory=20is=20available.=0A+If=20a=20local=20= EFI=20System=20Partition=20(ESP)=20or=20a=20similar=20partition=20with=20= a=20FAT=20file=0A+system=20is=20mounted=20in=20@code{targets},=20then=20= symlinks=20cannot=20be=20created.=20=20In=20this=0A+case=20everything=20= will=20be=20prepared=20for=20booting=20from=20local=20storage,=20= simialar=20as=20if=0A+using=20@code{grub-efi-bootloader},=20with=20the=20= difference=20that=20all=20GRUB=20binaries=0A+reside=20on=20= @code{targets},=20too,=20like=20needed=20for=20booting=20over=20network.=0A= +=0A+@vindex=20grub-efi-netboot-removable-bootloader=0A= +@code{grub-efi-netboot-removable-bootloader}=20is=20identical=20to=0A= +@code{grub-efi-netboot-bootloader}=20with=20the=20exception=20that=20= the=20sub-directory=0A+@file{efi/boot}=20will=20be=20used=20instead=20of=20= @file{efi/Guix}=20to=20comply=20to=20the=20UEFI=0A+specification=20for=20= removable=20media.=0A=20=0A=20@quotation=20Note=0A=20This=20@emph{will}=20= overwrite=20the=20GRUB=20file=20from=20any=20other=20operating=20systems=20= that=0Adiff=20--git=20a/gnu/bootloader.scm=20b/gnu/bootloader.scm=0A= index=20da65b9d5d5..40c7ea6e8a=20100644=0A---=20a/gnu/bootloader.scm=0A= +++=20b/gnu/bootloader.scm=0A@@=20-322,26=20+322,22=20@@=20instead~%")))=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20(force=20%bootloaders))=0A=20=20=20= =20=20=20=20(leave=20(G_=20"~a:=20no=20such=20bootloader~%")=20name)))=0A= =20=0A-(define=20(efi-bootloader-profile=20files=20bootloader-package=20= hooks)=0A-=20=20"Creates=20a=20profile=20with=20BOOTLOADER-PACKAGE=20and=20= a=20directory=20collection/=20with=0A-links=20to=20additional=20FILES=20= from=20the=20store.=20=20This=20collection=20is=20meant=20to=20be=20used=0A= -by=20the=20bootloader=20installer.=0A+(define=20(efi-bootloader-profile=20= packages=20files=20hooks)=0A+=20=20"Creates=20a=20profile=20from=20the=20= lists=20of=20PACKAGES=20and=20FILES=20from=20the=20store.=0A+This=20= profile=20is=20meant=20to=20be=20used=20by=20the=20bootloader-installer.=0A= =20=0A=20FILES=20is=20a=20list=20of=20file=20or=20directory=20names=20= from=20the=20store,=20which=20will=20be=0A-symlinked=20into=20the=20= collection/=20directory.=20=20If=20a=20directory=20name=20ends=20with=20= '/',=0A-then=20the=20directory=20content=20instead=20of=20the=20= directory=20itself=20will=20be=20symlinked=0A-into=20the=20collection/=20= directory.=0A+symlinked=20into=20the=20profile.=20=20If=20a=20directory=20= name=20ends=20with=20'/',=20then=20the=0A+directory=20content=20instead=20= of=20the=20directory=20itself=20will=20be=20symlinked=20into=20the=0A= +profile.=0A=20=0A-FILES=20may=20contain=20file=20like=20objects=20= produced=20by=20functions=20like=20plain-file,=0A+FILES=20may=20contain=20= file=20like=20objects=20produced=20by=20procedures=20like=20plain-file,=0A= =20local-file,=20etc.,=20or=20package=20contents=20produced=20with=20= file-append.=0A=20=0A=20HOOKS=20lists=20additional=20hook=20functions=20= to=20modify=20the=20profile."=0A-=20=20(define=20(bootloader-collection=20= manifest)=0A+=20=20(define=20(efi-bootloader-profile-hook=20manifest)=0A=20= =20=20=20=20(define=20build=0A-=20=20=20=20=20=20=20=20= (with-imported-modules=20'((guix=20build=20utils)=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(ice-9=20ftw)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(srfi=20srfi-1)=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(srfi=20srfi-26))=0A+=20=20=20=20=20=20=20=20= (with-imported-modules=20'((guix=20build=20utils))=0A=20=20=20=20=20=20=20= =20=20=20=20#~(begin=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= (use-modules=20((guix=20build=20utils)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#:select=20(mkdir-p=20= strip-store-file-name))=0A@@=20-365,7=20+361,7=20@@=20HOOKS=20lists=20= additional=20hook=20functions=20to=20modify=20the=20profile."=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20(define=20(name-is-store-entry?=20name)=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20"Return=20#t=20if=20NAME=20is=20= a=20direct=20store=20entry=20and=20nothing=20inside."=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(not=20(string-index=20(strip-store-file-name=20= name)=20#\/)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20(let*=20= ((collection=20(string-append=20#$output=20"/collection"))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20(let*=20((output=20#$output)=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(files=20'#$files)=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(directories=20(filter=20= name-ends-with-/?=20files))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(names-from-directories=0A@@=20-374,11=20+370,11=20@@=20= HOOKS=20lists=20additional=20hook=20functions=20to=20modify=20the=20= profile."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20directories))=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(names=20(append=20= names-from-directories=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(remove=20= name-ends-with-/?=20files))))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (mkdir-p=20collection)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (mkdir-p=20output)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (every=20file-exists?=20names)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(begin=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(for-each=20(lambda=20(name)=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (symlink-to=20name=20collection=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(symlink-to=20name=20= output=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (name-is-store-entry?=20name)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20strip-store-file-name=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20basename)))=0A@@=20= -386,57=20+382,63=20@@=20HOOKS=20lists=20additional=20hook=20functions=20= to=20modify=20the=20profile."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20#t)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20#f)))))=0A=20=0A-=20=20=20=20(gexp->derivation=20= "bootloader-collection"=0A+=20=20=20=20(gexp->derivation=20= "efi-bootloader-profile"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20build=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20#:local-build?=20#t=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20#:substitutable?=20#f=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#:properties=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= `((type=20.=20profile-hook)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(hook=20.=20bootloader-collection))))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (hook=20.=20efi-bootloader-profile-hook))))=0A=20=0A-=20=20(profile=20= (content=20(packages->manifest=20(list=20bootloader-package)))=0A-=20=20=20= =20=20=20=20=20=20=20=20(name=20"bootloader-profile")=0A-=20=20=20=20=20=20= =20=20=20=20=20(hooks=20(append=20(list=20bootloader-collection)=20= hooks))=0A+=20=20(profile=20(content=20(packages->manifest=20packages))=0A= +=20=20=20=20=20=20=20=20=20=20=20(name=20"efi-bootloader-profile")=0A+=20= =20=20=20=20=20=20=20=20=20=20(hooks=20(cons=20= efi-bootloader-profile-hook=20hooks))=0A=20=20=20=20=20=20=20=20=20=20=20= =20(locales?=20#f)=0A=20=20=20=20=20=20=20=20=20=20=20=20= (allow-collisions?=20#f)=0A=20=20=20=20=20=20=20=20=20=20=20=20= (relative-symlinks?=20#f)))=0A=20=0A-(define*=20(efi-bootloader-chain=20= files=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20final-bootloader=0A+(define*=20= (efi-bootloader-chain=20final-bootloader=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#:key=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(packages=20'())=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(files=20= '())=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(hooks=20'())=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= installer)=0A-=20=20"Define=20a=20bootloader=20chain=20with=20= FINAL-BOOTLOADER=20as=20the=20final=20bootloader=20and=0A-certain=20= directories=20and=20files=20from=20the=20store=20given=20in=20the=20list=20= of=20FILES.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20installer=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= disk-image-installer)=0A+=20=20"Define=20a=20chain=20of=20bootloaders=20= with=20the=20FINAL-BOOTLOADER,=20optional=20PACKAGES,=0A+and=20optional=20= directories=20and=20files=20from=20the=20store=20given=20in=20the=20list=20= of=20FILES.=0A=20=0A-FILES=20may=20contain=20file=20like=20objects=20= produced=20by=20functions=20like=20plain-file,=0A-local-file,=20etc.,=20= or=20package=20contents=20produced=20with=20file-append.=20=20They=20= will=20be=0A-collected=20inside=20a=20directory=20collection/=20inside=20= a=20generated=20bootloader=20profile,=0A-which=20will=20be=20passed=20to=20= the=20INSTALLER.=0A+The=20package=20of=20the=20FINAL-BOOTLOADER=20and=20= all=20PACKAGES=20and=20FILES=20will=20be=20placed=0A+in=20an=20= efi-bootloader-profile,=20which=20will=20be=20passed=20to=20the=20= INSTALLER.=0A+=0A+FILES=20may=20contain=20file=20like=20objects=20= produced=20by=20procedures=20like=20plain-file,=0A+local-file,=20etc.,=20= or=20package=20contents=20produced=20with=20file-append.=0A=20=0A=20If=20= a=20directory=20name=20in=20FILES=20ends=20with=20'/',=20then=20the=20= directory=20content=20instead=0A-of=20the=20directory=20itself=20will=20= be=20symlinked=20into=20the=20collection/=20directory.=0A+of=20the=20= directory=20itself=20will=20be=20symlinked=20into=20the=20= efi-bootloader-profile.=0A=20=0A=20The=20procedures=20in=20the=20HOOKS=20= list=20can=20be=20used=20to=20further=20modify=20the=20bootloader=0A=20= profile.=20=20It=20is=20possible=20to=20pass=20a=20single=20function=20= instead=20of=20a=20list.=0A=20=0A-If=20the=20INSTALLER=20argument=20is=20= used,=20then=20this=20function=20will=20be=20called=20to=20install=0A= -the=20bootloader.=20=20Otherwise=20the=20installer=20of=20the=20= FINAL-BOOTLOADER=20will=20be=20called."=0A-=20=20(let*=20= ((final-installer=20(or=20installer=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (bootloader-installer=20final-bootloader)))=0A-=20=20=20=20=20=20=20=20=20= (profile=20(efi-bootloader-profile=20files=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(bootloader-package=20final-bootloader)=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20(list?=20hooks)=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20hooks=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(list=20= hooks)))))=0A-=20=20=20=20(bootloader=0A-=20=20=20=20=20(inherit=20= final-bootloader)=0A-=20=20=20=20=20(package=20profile)=0A-=20=20=20=20=20= (installer=0A-=20=20=20=20=20=20#~(lambda=20(bootloader=20target=20= mount-point)=0A-=20=20=20=20=20=20=20=20=20=20(#$final-installer=20= bootloader=20target=20mount-point)=0A-=20=20=20=20=20=20=20=20=20=20= (copy-recursively=0A-=20=20=20=20=20=20=20=20=20=20=20(string-append=20= bootloader=20"/collection")=0A-=20=20=20=20=20=20=20=20=20=20=20= (string-append=20mount-point=20target)=0A-=20=20=20=20=20=20=20=20=20=20=20= #:follow-symlinks?=20#t=0A-=20=20=20=20=20=20=20=20=20=20=20#:log=20= (%make-void-port=20"w")))))))=0A+If=20the=20INSTALLER=20argument=20is=20= used,=20then=20this=20gexp=20procedure=20will=20be=20called=20to=0A= +install=20the=20efi-bootloader-profile.=20=20Otherwise=20the=20= installer=20of=20the=0A+FINAL-BOOTLOADER=20will=20be=20called.=0A+=0A+If=20= the=20DISK-IMAGE-INSTALLER=20is=20used,=20then=20this=20gexp=20procedure=20= will=20be=20called=0A+to=20install=20the=20efi-bootloader-profile=20into=20= a=20disk-image.=20=20Otherwise=20the=0A+disk-image-installer=20of=20the=20= FINAL-BOOTLOADER=20will=20be=20called."=0A+=20=20(bootloader=0A+=20=20=20= =20(inherit=20final-bootloader)=0A+=20=20=20=20(name=20= "efi-bootloader-chain")=0A+=20=20=20=20(package=0A+=20=20=20=20=20= (efi-bootloader-profile=20(cons=20(bootloader-package=20= final-bootloader)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20packages)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20files=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(if=20(list?=20hooks)=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= hooks=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(list=20hooks))))=0A+=20=20=20=20= (installer=0A+=20=20=20=20=20(or=20installer=0A+=20=20=20=20=20=20=20=20=20= (bootloader-installer=20final-bootloader)))=0A+=20=20=20=20= (disk-image-installer=0A+=20=20=20=20=20(or=20disk-image-installer=0A+=20= =20=20=20=20=20=20=20=20(bootloader-disk-image-installer=20= final-bootloader)))))=0Adiff=20--git=20a/gnu/bootloader/grub.scm=20= b/gnu/bootloader/grub.scm=0Aindex=207283257354..817dd9552b=20100644=0A= ---=20a/gnu/bootloader/grub.scm=0A+++=20b/gnu/bootloader/grub.scm=0A@@=20= -53,13=20+53,14=20@@=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-theme-gfxmode=0A=20=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= install-grub-efi-removable=0A-=20=20=20=20=20=20=20=20=20=20=20=20= install-grub-efi-netboot=0A+=20=20=20=20=20=20=20=20=20=20=20=20= make-grub-efi-netboot-installer=0A=20=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20grub-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi-removable-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi32-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi-netboot-bootloader=0A+=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi-netboot-removable-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20grub-mkrescue-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-minimal-bootloader=0A=20=0A@@=20-353,7=20+354,7=20@@=20code."=0A=20=20= =20=20=20=20=20=20=20((or=20#f=20(?=20string?))=0A=20=20=20=20=20=20=20=20= =20=20#~(format=20#f=20"search=20--file=20--set=20~a"=20#$file)))))=0A=20= =0A-(define*=20(grub-configuration-file=20config=20entries=0A+(define*=20= (make-grub-configuration=20grub=20config=20entries=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20#:key=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(locale=20#f)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(system=20(%current-system))=0A@@=20-453,9=20+454,7=20= @@=20menuentry=20~s=20{=0A=20=20=20(define=20locale-config=0A=20=20=20=20= =20(let*=20((entry=20(first=20all-entries))=0A=20=20=20=20=20=20=20=20=20= =20=20=20(device=20(menu-entry-device=20entry))=0A-=20=20=20=20=20=20=20=20= =20=20=20(mount-point=20(menu-entry-device-mount-point=20entry))=0A-=20=20= =20=20=20=20=20=20=20=20=20(bootloader=20= (bootloader-configuration-bootloader=20config))=0A-=20=20=20=20=20=20=20=20= =20=20=20(grub=20(bootloader-package=20bootloader)))=0A+=20=20=20=20=20=20= =20=20=20=20=20(mount-point=20(menu-entry-device-mount-point=20entry)))=0A= =20=20=20=20=20=20=20#~(let=20((locale=20#$(and=20locale=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (locale-definition-source=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(locale-name->definition=20= locale))))=0A@@=20-481,8=20+480,6=20@@=20set=20lang=3D~a~%"=0A=20=0A=20=20= =20(define=20keyboard-layout-config=0A=20=20=20=20=20(let*=20((layout=20= (bootloader-configuration-keyboard-layout=20config))=0A-=20=20=20=20=20=20= =20=20=20=20=20(grub=20=20=20(bootloader-package=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20= (bootloader-configuration-bootloader=20config)))=0A=20=20=20=20=20=20=20=20= =20=20=20=20(keymap*=20(and=20layout=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(keyboard-layout-file=20layout=20= #:grub=20grub)))=0A=20=20=20=20=20=20=20=20=20=20=20=20(entry=20(first=20= all-entries))=0A@@=20-533,6=20+530,16=20@@=20fi~%"))))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20#:options=20'(#:local-build?=20#t=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20#:substitutable?=20#f)))=0A=20=0A+(define=20= (grub-configuration-file=20config=20.=20args)=0A+=20=20(let*=20= ((bootloader=20(bootloader-configuration-bootloader=20config))=0A+=20=20=20= =20=20=20=20=20=20(grub=20(bootloader-package=20bootloader)))=0A+=20=20=20= =20(apply=20make-grub-configuration=20grub=20config=20args)))=0A+=0A= +(define=20(grub-efi-configuration-file=20.=20args)=0A+=20=20(apply=20= make-grub-configuration=20grub-efi=20args))=0A+=0A+(define=20grub-cfg=20= "/boot/grub/grub.cfg")=0A+=0A=20=0C=0A=20=0A=20;;;=0A@@=20-674,42=20= +681,31=20@@=20fi~%"))))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((target-arm?)=20= "--target=3Darm-efi"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"--efi-directory"=20target-esp)))))=0A=20=0A= -(define=20(install-grub-efi-netboot=20subdir)=0A-=20=20"Define=20a=20= grub-efi-netboot=20bootloader=20installer=20for=20installation=20in=20= SUBDIR,=0A-which=20is=20usually=20efi/Guix=20or=20efi/boot."=0A-=20=20= (let*=20((system=20(string-split=20(nix-system->gnu-triplet=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(or=20(%current-target-system)=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(%current-system)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#\-))=0A-=20=20=20=20=20=20=20= =20=20(arch=20(first=20system))=0A-=20=20=20=20=20=20=20=20=20= (boot-efi-link=20(match=20system=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20;;=20These=20are=20the=20= supportend=20systems=20and=20the=20names=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20defined=20by=20the=20= UEFI=20standard=20for=20removable=20media.=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(("i686"=20_=20...)=20= =20=20=20=20=20=20=20"/bootia32.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(("x86_64"=20_=20...)=20=20=20= =20=20=20"/bootx64.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(("arm"=20_=20...)=20=20=20=20=20=20=20=20= =20"/bootarm.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(("aarch64"=20_=20...)=20=20=20=20=20= "/bootaa64.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(("riscv"=20_=20...)=20=20=20=20=20=20=20= "/bootriscv32.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(("riscv64"=20_=20...)=20=20=20=20=20= "/bootriscv64.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20Other=20systems=20are=20not=20supported,=20= although=20defined.=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20(("riscv128"=20_=20...)=20= "/bootriscv128.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20(("ia64"=20_=20...)=20=20=20=20=20= "/bootia64.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20((_=20...)=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20#f)))=0A-=20=20=20=20=20=20=20=20=20(core-efi=20(string-append=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20This=20is=20= the=20arch=20dependent=20file=20name=20of=20GRUB,=20e.g.=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20i368-efi/core.efi=20or=20= arm64-efi/core.efi.=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(match=20arch=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20("i686"=20=20=20=20"i386")=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20("aarch64"=20"arm64")=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20("riscv"=20=20=20= "riscv32")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(_=20=20=20=20=20=20=20=20=20arch))=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20"-efi/core.efi")))=0A-=20=20=20=20= (with-imported-modules=0A-=20=20=20=20=20'((guix=20build=20union))=0A-=20= =20=20=20=20#~(lambda=20(bootloader=20target=20mount-point)=0A-=20=20=20=20= =20=20=20=20=20"Install=20the=20BOOTLOADER,=20which=20must=20be=20the=20= package=20grub,=20as=20e.g.=0A-bootx64.efi=20or=20bootaa64.efi=20into=20= SUBDIR,=20which=20is=20usually=20efi/Guix=20or=20efi/boot,=0A-below=20= the=20directory=20TARGET=20for=20the=20system=20whose=20root=20is=20= mounted=20at=20MOUNT-POINT.=0A+(define*=20= (make-grub-efi-netboot-installer=20grub-efi=20grub-cfg=20subdir)=0A+=20=20= "Make=20a=20bootloader-installer=20for=20a=20grub-efi-netboot=20= bootloader,=20which=20expects=0A+its=20files=20in=20SUBDIR=20and=20its=20= configuration=20file=20in=20GRUB-CFG.=0A+=0A+As=20a=20grub-efi-netboot=20= package=20is=20already=20preinstalled=20by=20'grub-mknetdir',=20the=0A= +installer=20basically=20copies=20all=20files=20from=20the=20= bootloader-package=20(or=20profile)=0A+into=20the=20bootloader-target=20= directory.=0A+=0A+Additionally=20for=20network=20booting=20over=20TFTP,=20= two=20relative=20symlinks=20to=20the=20store=0A+and=20to=20the=20= GRUB-CFG=20file=20are=20necessary.=20=20Due=20to=20this=20a=20TFTP=20= root=20directory=20must=0A+not=20be=20located=20on=20a=20FAT=20= file-system.=0A+=0A+If=20the=20bootloader-target=20does=20not=20support=20= symlinks,=20then=20it=20is=20assumed=20to=20be=20a=0A+kind=20of=20EFI=20= System=20Partition=20(ESP).=20=20In=20this=20case=20an=20intermediate=20= configuration=0A+file=20is=20created=20with=20the=20help=20of=20GRUB-EFI=20= to=20load=20the=20GRUB-CFG.=0A+=0A+The=20installer=20is=20usable=20for=20= any=20efi-bootloader-chain,=20which=20prepares=20the=0A= +bootloader-profile=20in=20a=20way=20ready=20for=20copying.=0A+=0A+The=20= installer=20does=20not=20manipulate=20the=20system's=20'UEFI=20Boot=20= Manager'."=0A+=20=20(with-imported-modules=20'((guix=20build=20union))=0A= +=20=20=20=20#~(lambda=20(bootloader=20target=20mount-point)=0A+=20=20=20= =20=20=20=20=20"Copy=20the=20BOOTLOADER,=20which=20must=20be=20a=20= preinstalled=20grub-efi-netboot=0A+package=20with=20a=20SUBDIR=20like=20= efi/boot=20or=20efi/Guix,=20below=20the=20directory=0A+TARGET=20for=20= the=20system=20whose=20root=20is=20mounted=20at=20MOUNT-POINT.=0A=20=0A=20= MOUNT-POINT=20is=20the=20last=20argument=20in=20'guix=20system=20init=20= /etc/config.scm=20mnt/point'=0A=20or=20'/'=20for=20other=20'guix=20= system'=20commands.=0A@@=20-719,17=20+715,18=20@@=20= bootloader-configuration=20in:=0A=20=0A=20(operating-system=0A=20=20= (bootloader=20(bootloader-configuration=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(targets=20'(\"/boot\"))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(targets=20'(\"/boot/efi\"))=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=E2=80=A6))=0A=20=20=E2=80=A6)=0A=20=0A=20TARGET=20is=20= required=20to=20be=20an=20absolute=20directory=20name,=20usually=20= mounted=20via=20NFS,=0A=20and=20finally=20needs=20to=20be=20provided=20= by=20a=20TFTP=20server=20as=20the=20TFTP=20root=20directory.=0A=20=0A= +Usually=20the=20installer=20will=20be=20used=20to=20prepare=20network=20= booting=20over=20TFTP.=20=20Then=0A=20GRUB=20will=20load=20= tftp://server/SUBDIR/grub.cfg=20and=20this=20file=20will=20instruct=20it=20= to=0A=20load=20more=20files=20from=20the=20store=20like=20= tftp://server/gnu/store/=E2=80=A6-linux=E2=80=A6/Image.=0A=20=0A-To=20= make=20this=20possible=20two=20symlinks=20will=20be=20created.=20The=20= first=20symlink=20points=0A+To=20make=20this=20possible=20two=20symlinks=20= will=20be=20created.=20=20The=20first=20symlink=20points=0A=20relatively=20= form=20MOUNT-POINT/TARGET/SUBDIR/grub.cfg=20to=0A=20= MOUNT-POINT/boot/grub/grub.cfg,=20and=20the=20second=20symlink=20points=20= relatively=20from=0A=20MOUNT-POINT/TARGET/%store-prefix=20to=20= MOUNT-POINT/%store-prefix.=0A@@=20-739,34=20+736,78=20@@=20paths=20on=20= the=20TFTP=20server=20side=20are=20unknown.=0A=20=0A=20It=20is=20also=20= important=20to=20note=20that=20both=20symlinks=20will=20point=20outside=20= the=20TFTP=20root=0A=20directory=20and=20that=20the=20= TARGET/%store-prefix=20symlink=20makes=20the=20whole=20store=0A= -accessible=20via=20TFTP.=20Possibly=20the=20TFTP=20server=20must=20be=20= configured=0A-to=20allow=20accesses=20outside=20its=20TFTP=20root=20= directory.=20This=20may=20need=20to=20be=0A-considered=20for=20security=20= aspects."=0A-=20=20=20=20=20=20=20=20=20(use-modules=20((guix=20build=20= union)=20#:select=20(symlink-relative)))=0A-=20=20=20=20=20=20=20=20=20= (let*=20((net-dir=20(string-append=20mount-point=20target=20"/"))=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(sub-dir=20(string-append=20= net-dir=20#$subdir=20"/"))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(store=20(string-append=20mount-point=20(%store-prefix)))=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(store-link=20(string-append=20= net-dir=20(%store-prefix)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(grub-cfg=20(string-append=20mount-point=20"/boot/grub/grub.cfg"))=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(grub-cfg-link=20= (string-append=20sub-dir=20(basename=20grub-cfg)))=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(boot-efi-link=20(string-append=20sub-dir=20= #$boot-efi-link)))=0A-=20=20=20=20=20=20=20=20=20=20=20;;=20Prepare=20= the=20symlink=20to=20the=20store.=0A-=20=20=20=20=20=20=20=20=20=20=20= (mkdir-p=20(dirname=20store-link))=0A-=20=20=20=20=20=20=20=20=20=20=20= (false-if-exception=20(delete-file=20store-link))=0A-=20=20=20=20=20=20=20= =20=20=20=20(symlink-relative=20store=20store-link)=0A-=20=20=20=20=20=20= =20=20=20=20=20;;=20Prepare=20the=20symlink=20to=20the=20grub.cfg,=20= which=20points=20into=20the=20store.=0A-=20=20=20=20=20=20=20=20=20=20=20= (mkdir-p=20(dirname=20grub-cfg-link))=0A-=20=20=20=20=20=20=20=20=20=20=20= (false-if-exception=20(delete-file=20grub-cfg-link))=0A-=20=20=20=20=20=20= =20=20=20=20=20(symlink-relative=20grub-cfg=20grub-cfg-link)=0A-=20=20=20= =20=20=20=20=20=20=20=20;;=20Install=20GRUB,=20which=20refers=20to=20the=20= grub.cfg,=20with=20support=20for=0A-=20=20=20=20=20=20=20=20=20=20=20;;=20= encrypted=20partitions,=0A-=20=20=20=20=20=20=20=20=20=20=20(setenv=20= "GRUB_ENABLE_CRYPTODISK"=20"y")=0A-=20=20=20=20=20=20=20=20=20=20=20= (invoke/quiet=20(string-append=20bootloader=20"/bin/grub-mknetdir")=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-append=20"--net-directory=3D"=20net-dir)=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(string-append=20= "--subdir=3D"=20#$subdir))=0A-=20=20=20=20=20=20=20=20=20=20=20;;=20= Prepare=20the=20bootloader=20symlink,=20which=20points=20to=20core.efi=20= of=20GRUB.=0A-=20=20=20=20=20=20=20=20=20=20=20(false-if-exception=20= (delete-file=20boot-efi-link))=0A-=20=20=20=20=20=20=20=20=20=20=20= (symlink=20#$core-efi=20boot-efi-link))))))=0A+accessible=20via=20TFTP.=20= =20Possibly=20the=20TFTP=20server=20must=20be=20configured=20to=20allow=0A= +accesses=20outside=20its=20TFTP=20root=20directory.=20=20This=20all=20= may=20need=20to=20be=20considered=0A+for=20security=20aspects.=20=20It=20= is=20advised=20to=20disable=20any=20TFTP=20write=20access!=0A+=0A+The=20= installer=20can=20also=20be=20used=20to=20prepare=20booting=20from=20= local=20storages,=20if=20the=0A+underlying=20file-system,=20like=20FAT=20= on=20an=20EFI=20System=20Partition=20(ESP),=20does=20not=0A+support=20= symlinks.=20=20In=20this=20case=20the=20= MOUNT-POINT/TARGET/SUBDIR/grub.cfg=20will=20be=0A+created=20with=20the=20= help=20of=20GRUB-EFI=20to=20load=20the=20/boot/grub/grub.cfg=20file.=20=20= A=0A+symlink=20to=20the=20store=20is=20not=20needed=20in=20this=20case."=0A= +=20=20=20=20=20=20=20=20;;=20In=20context=20of=20a=20disk=20image=20= creation=20TARGET=20will=20be=20#f=20and=20an=0A+=20=20=20=20=20=20=20=20= ;;=20installer=20is=20expected=20to=20do=20necessary=20installations=20= on=20MOUNT-POINT,=0A+=20=20=20=20=20=20=20=20;;=20which=20will=20become=20= the=20root=20file=20system.=0A+=20=20=20=20=20=20=20=20;;=20If=20TARGET=20= is=20#f,=20this=20installer=20has=20nothing=20to=20do,=20as=20it=20only=20= cares=0A+=20=20=20=20=20=20=20=20;;=20about=20the=20EFI=20System=20= Partition=20(ESP).=0A+=20=20=20=20=20=20=20=20(when=20target=0A+=20=20=20= =20=20=20=20=20=20=20(use-modules=20((guix=20build=20union)=20#:select=20= (symlink-relative))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(ice-9=20popen)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(ice-9=20rdelim))=0A+=20=20=20=20=20=20=20= =20=20=20(let*=20((mount-point/target=20(string-append=20mount-point=20= target=20"/"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= When=20installing=20Guix,=20it=20is=20common=20to=20mount=20TARGET=20= below=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= MOUNT-POINT=20rather=20than=20the=20root=20directory.=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(bootloader-target=20(if=20= (file-exists?=20mount-point/target)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20mount-point/target=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20target))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(store=20= (string-append=20mount-point=20(%store-prefix)))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(store-link=20(string-append=20= bootloader-target=20(%store-prefix)))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(grub-cfg=20(string-append=20mount-point=20= #$grub-cfg))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (grub-cfg-link=20(string-append=20bootloader-target=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#$subdir=20"/"=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(basename=20= grub-cfg))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20Copy=20the=20= bootloader=20into=20the=20bootloader-target=20directory.=0A+=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Should=20we=20beforehand=20recursively=20= delete=20any=20existing=20file?=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (copy-recursively=20bootloader=20bootloader-target=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= #:follow-symlinks?=20#t=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20#:log=20(%make-void-port=20= "w"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20For=20TFTP=20we=20need=20= to=20install=20additional=20relative=20symlinks.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20;;=20If=20we=20install=20on=20an=20EFI=20System=20= Partition=20(ESP)=20or=20some=20other=20FAT=0A+=20=20=20=20=20=20=20=20=20= =20=20=20;;=20file-system,=20then=20symlinks=20cannot=20be=20created=20= and=20are=20not=20needed.=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20= Therefore=20we=20ignore=20exceptions=20when=20trying.=0A+=20=20=20=20=20=20= =20=20=20=20=20=20;;=20Prepare=20the=20symlink=20to=20the=20grub.cfg.=0A= +=20=20=20=20=20=20=20=20=20=20=20=20(mkdir-p=20(dirname=20= grub-cfg-link))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (false-if-exception=20(delete-file=20grub-cfg-link))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20(if=20(unspecified?=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(false-if-exception=20(symlink-relative=20grub-cfg=20= grub-cfg-link)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= Symlinks=20are=20supported.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (begin=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Prepare=20= the=20symlink=20to=20the=20store.=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(mkdir-p=20(dirname=20store-link))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(false-if-exception=20(delete-file=20= store-link))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (symlink-relative=20store=20store-link))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20Creating=20symlinks=20does=20not=20seem=20to=20be=20= supported.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Probably=20= an=20ESP=20is=20used.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= Instead=20we=20can=20script=20to=20search=20and=20load=20the=20actual=20= grub.cfg.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(let*=20((probe=20= #$(file-append=20grub-efi=20"/sbin/grub-probe"))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(port=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(open-pipe*=20OPEN_READ=20= probe=20"--target=3Dfs_uuid"=20grub-cfg))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(search-root=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(match=20(read-line=20port)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20((?=20eof-object?)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20There=20is=20no=20UUID=20= available.=20As=20a=20fallback=20search=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20everywhere=20for=20= the=20grub.cfg.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(string-append=20"search=20--file=20--set=20"=20= #$grub-cfg))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(fs-uuid=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20The=20UUID=20to=20load=20the=20= grub.cfg=20from=20is=20known.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(string-append=20"search=20= --fs-uuid=20--set=20"=20fs-uuid))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(load-grub-cfg=20(string-append=20"configfile=20= "=20#$grub-cfg)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (close-pipe=20port)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (with-output-to-file=20grub-cfg-link=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(lambda=20()=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(display=20(string-join=20(list=20search-root=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= load-grub-cfg)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "\n")))))))))))=0A=20=0A=20=0C=0A=20=0A@@=20-784,7=20+825,7=20@@=20= considered=20for=20security=20aspects."=0A=20=20=20=20(package=20grub)=0A= =20=20=20=20(installer=20install-grub)=0A=20=20=20=20= (disk-image-installer=20install-grub-disk-image)=0A-=20=20=20= (configuration-file=20"/boot/grub/grub.cfg")=0A+=20=20=20= (configuration-file=20grub-cfg)=0A=20=20=20=20= (configuration-file-generator=20grub-configuration-file)))=0A=20=0A=20= (define=20grub-minimal-bootloader=0A@@=20-794,11=20+835,12=20@@=20= considered=20for=20security=20aspects."=0A=20=0A=20(define=20= grub-efi-bootloader=0A=20=20=20(bootloader=0A-=20=20=20(inherit=20= grub-bootloader)=0A+=20=20=20(name=20'grub-efi)=0A+=20=20=20(package=20= grub-efi)=0A=20=20=20=20(installer=20install-grub-efi)=0A=20=20=20=20= (disk-image-installer=20#f)=0A-=20=20=20(name=20'grub-efi)=0A-=20=20=20= (package=20grub-efi)))=0A+=20=20=20(configuration-file=20grub-cfg)=0A+=20= =20=20(configuration-file-generator=20grub-configuration-file)))=0A=20=0A= =20(define=20grub-efi-removable-bootloader=0A=20=20=20(bootloader=0A@@=20= -813,11=20+855,22=20@@=20considered=20for=20security=20aspects."=0A=20=20= =20=20(name=20'grub-efi32)=0A=20=20=20=20(package=20grub-efi32)))=0A=20=0A= -(define=20grub-efi-netboot-bootloader=0A+(define=20= (make-grub-efi-netboot-bootloader=20name=20subdir)=0A=20=20=20= (bootloader=0A-=20=20=20(inherit=20grub-efi-bootloader)=0A-=20=20=20= (name=20'grub-efi-netboot-bootloader)=0A-=20=20=20(installer=20= (install-grub-efi-netboot=20"efi/Guix"))))=0A+=20=20=20(name=20name)=0A+=20= =20=20(package=20(make-grub-efi-netboot=20(symbol->string=20name)=20= subdir))=0A+=20=20=20(installer=20(make-grub-efi-netboot-installer=20= grub-efi=20grub-cfg=20subdir))=0A+=20=20=20(disk-image-installer=20#f)=0A= +=20=20=20(configuration-file=20grub-cfg)=0A+=20=20=20= (configuration-file-generator=20grub-efi-configuration-file)))=0A+=0A= +(define=20grub-efi-netboot-bootloader=0A+=20=20= (make-grub-efi-netboot-bootloader=20'grub-efi-netboot-bootloader=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"efi/Guix"))=0A+=0A+(define=20= grub-efi-netboot-removable-bootloader=0A+=20=20= (make-grub-efi-netboot-bootloader=20= 'grub-efi-netboot-removable-bootloader=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "efi/boot"))=0A=20=0A=20(define=20grub-mkrescue-bootloader=0A=20=20=20= (bootloader=0Adiff=20--git=20a/gnu/packages/bootloaders.scm=20= b/gnu/packages/bootloaders.scm=0Aindex=20210bc30536..658de5a808=20100644=0A= ---=20a/gnu/packages/bootloaders.scm=0A+++=20= b/gnu/packages/bootloaders.scm=0A@@=20-16,6=20+16,7=20@@=0A=20;;;=20= Copyright=20=C2=A9=202021=20Vincent=20Legoll=20= =0A=20;;;=20Copyright=20=C2=A9=202021=20Brice=20= Waegeneire=20=0A=20;;;=20Copyright=20=C2=A9=202022=20= Denis=20'GNUtoo'=20Carikli=20=0A+;;;=20= Copyright=20=C2=A9=202021=20Stefan=20=0A=20= ;;;=0A=20;;;=20This=20file=20is=20part=20of=20GNU=20Guix.=0A=20;;;=0A@@=20= -67,13=20+68,17=20@@=0A=20=20=20#:use-module=20(gnu=20packages=20= virtualization)=0A=20=20=20#:use-module=20(gnu=20packages=20xorg)=0A=20=20= =20#:use-module=20(guix=20build-system=20gnu)=0A+=20=20#:use-module=20= (guix=20build-system=20trivial)=0A=20=20=20#:use-module=20(guix=20= download)=0A+=20=20#:use-module=20(guix=20gexp)=0A=20=20=20#:use-module=20= (guix=20git-download)=0A=20=20=20#:use-module=20((guix=20licenses)=20= #:prefix=20license:)=0A=20=20=20#:use-module=20(guix=20packages)=0A=20=20= =20#:use-module=20(guix=20utils)=0A=20=20=20#:use-module=20(srfi=20= srfi-1)=0A=20=20=20#:use-module=20(srfi=20srfi-26)=0A+=20=20#:use-module=20= (ice-9=20match)=0A+=20=20#:use-module=20(ice-9=20optargs)=0A=20=20=20= #:use-module=20(ice-9=20regex))=0A=20=0A=20(define=20unifont=0A@@=20= -392,6=20+397,91=20@@=20menu=20to=20select=20one=20of=20the=20installed=20= operating=20systems.")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(scandir=20input-dir))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20#t)))))))))=0A=20=0A+(define-public=20= (make-grub-efi-netboot=20name=20subdir)=0A+=20=20"Make=20a=20= grub-efi-netboot=20package=20named=20NAME,=20which=20will=20be=20able=20= to=20boot=20over=0A+network=20via=20TFTP=20by=20accessing=20its=20files=20= in=20the=20SUBDIR=20of=20a=20TFTP=20root=20directory.=0A+This=20package=20= is=20also=20able=20to=20boot=20from=20local=20storage=20devices.=0A+=0A= +A=20bootloader-installer=20basically=20needs=20to=20copy=20the=20= package=20content=20into=20the=0A+bootloader-target=20directory,=20which=20= will=20usually=20be=20the=20TFTP=20root,=20as=0A+'grub-mknetdir'=20will=20= be=20invoked=20already=20during=20the=20package=20creation.=0A+=0A= +Alternatively=20the=20bootloader-target=20directory=20can=20be=20a=20= mounted=20EFI=20System=0A+Partition=20(ESP),=20or=20a=20similar=20= partition=20with=20a=20FAT=20file=20system,=20for=20booting=0A+from=20= local=20storage=20devices.=0A+=0A+The=20name=20of=20the=20GRUB=20EFI=20= binary=20will=20conform=20to=20the=20UEFI=20specification=20for=0A= +removable=20media.=20=20Depending=20on=20the=20system=20it=20will=20be=20= e.g.=20bootx64.efi=20or=0A+bootaa64.efi=20below=20SUBDIR.=0A+=0A+The=20= SUBDIR=20argument=20needs=20to=20be=20set=20to=20\"efi/boot\"=20to=20= create=20a=20package=20which=0A+conforms=20to=20the=20UEFI=20= specification=20for=20removable=20media.=0A+=0A+The=20SUBDIR=20argument=20= defaults=20to=20\"efi/Guix\",=20as=20it=20is=20also=20the=20case=20for=0A= +'grub-efi-bootloader'."=0A+=20=20(package=0A+=20=20=20=20(name=20name)=0A= +=20=20=20=20(version=20(package-version=20grub-efi))=0A+=20=20=20=20;;=20= Source=20is=20not=20needed,=20but=20it=20cannot=20be=20omitted.=0A+=20=20= =20=20(source=20#f)=0A+=20=20=20=20(build-system=20trivial-build-system)=0A= +=20=20=20=20(arguments=0A+=20=20=20=20=20(let*=20((system=20= (string-split=20(nix-system->gnu-triplet=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (or=20(%current-target-system)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (%current-system)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#\-))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20(arch=20(first=20system))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20(boot-efi=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(match=20= system=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20These=20are=20= the=20supportend=20systems=20and=20the=20names=20defined=20by=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20the=20UEFI=20standard=20for=20= removable=20media.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (("i686"=20_=20...)=20=20=20=20=20=20=20=20"/bootia32.efi")=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(("x86_64"=20_=20...)=20=20=20=20=20=20= "/bootx64.efi")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(("arm"=20= _=20...)=20=20=20=20=20=20=20=20=20"/bootarm.efi")=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(("aarch64"=20_=20...)=20=20=20=20=20= "/bootaa64.efi")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (("riscv"=20_=20...)=20=20=20=20=20=20=20"/bootriscv32.efi")=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(("riscv64"=20_=20...)=20=20=20=20=20= "/bootriscv64.efi")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= Other=20systems=20are=20not=20supported,=20although=20defined.=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20(("riscv128"=20_=20...)=20= "/bootriscv128.efi")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= (("ia64"=20_=20...)=20=20=20=20=20"/bootia64.efi")=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20((_=20...)=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20#f)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20(core-efi=20= (string-append=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20This=20is=20the=20arch=20dependent=20file=20name=20of=20= GRUB,=20e.g.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20i368-efi/core.efi=20or=20arm64-efi/core.efi.=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(match=20= arch=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20("i686"=20=20=20=20"i386")=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20("aarch64"=20"arm64")=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ("riscv"=20=20=20"riscv32")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(_=20=20=20=20=20=20=20=20=20arch))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "-efi/core.efi")))=0A+=20=20=20=20=20=20=20`(#:modules=20((guix=20build=20= utils))=0A+=20=20=20=20=20=20=20=20=20#:builder=0A+=20=20=20=20=20=20=20=20= =20(begin=0A+=20=20=20=20=20=20=20=20=20=20=20(use-modules=20(guix=20= build=20utils))=0A+=20=20=20=20=20=20=20=20=20=20=20(let*=20((bootloader=20= (assoc-ref=20%build-inputs=20"grub-efi"))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(net-dir=20(assoc-ref=20%outputs=20"out"))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(sub-dir=20= (string-append=20net-dir=20"/"=20,subdir=20"/"))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(boot-efi=20(string-append=20sub-dir=20= ,boot-efi))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (core-efi=20(string-append=20sub-dir=20,core-efi)))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Install=20GRUB,=20which=20refers=20to=20the=20= grub.cfg,=20with=20support=20for=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20encrypted=20partitions,=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (setenv=20"GRUB_ENABLE_CRYPTODISK"=20"y")=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20(invoke/quiet=20(string-append=20bootloader=20= "/bin/grub-mknetdir")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(string-append=20"--net-directory=3D"=20= net-dir)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(string-append=20"--subdir=3D"=20,subdir)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= These=20modules=20must=20be=20preloaded=20to=20allow=20booting=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20from=20an=20ESP=20or=20a=20similar=20partition=20with=20a=20FAT=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20file=20system.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(string-append=20"--modules=3Dpart_msdos=20= part_gpt=20fat"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Move=20= GRUB's=20core.efi=20to=20the=20removable=20media=20name.=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20(false-if-exception=20(delete-file=20boot-efi))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20(rename-file=20core-efi=20= boot-efi))))))=0A+=20=20=20=20(inputs=20`(("grub-efi"=20,grub-efi)))=0A+=20= =20=20=20(synopsis=20(package-synopsis=20grub-efi))=0A+=20=20=20=20= (description=20(package-description=20grub-efi))=0A+=20=20=20=20= (home-page=20(package-home-page=20grub-efi))=0A+=20=20=20=20(license=20= (package-license=20grub-efi))))=0A+=0A=20(define-public=20syslinux=0A=20=20= =20(let=20((commit=20"bb41e935cc83c6242de24d2271e067d76af3585c"))=0A=20=20= =20=20=20(package=0A= --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Disposition: attachment; filename=03-build-kconfig-add-new-module.patch Content-Type: application/octet-stream; name="03-build-kconfig-add-new-module.patch" Content-Transfer-Encoding: quoted-printable build:=20kconfig:=20Add=20new=20module=20to=20modify=20defconfig=20= files.=0A=0AFrom:=20Stefan=20=0A=0A*=20= guix/build/kconfig.scm=20(config-string->pair,=20(pair->config-string,=0A= defconfig->alist,=20modify-defconfig,=20verify-config):=20New=20file=20= with=0Afunctions=20for=20handling=20of=20defconfig=20and=20.config=20= files.=0A*=20gnu/packages/bootloaders.scm=20(make-u-boot-package,=0A= make-u-boot-sunxi64-package):=20Adding=20new=20keyword=20arguments=20to=20= pass=20and/=0Aor=20modify=20a=20defconfig=20file.=0A= (u-boot-{am335x-boneblack,pinebook,u-boot-novena,rockpro64-rk3399}):=0A= Simplify=20packages=20by=20using=20the=20new=20keyword=20arguments=20of=20= the=20former=0Afunctions.=0A*=20Makefile.am:=20Adding=20= guix/build/kconfig.scm=20to=20MODULES.=0A---=0A=20Makefile.am=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=20=20=201=20=0A=20= gnu/packages/bootloaders.scm=20|=20=20111=20+++++++++++--------------=0A=20= guix/build/kconfig.scm=20=20=20=20=20=20=20|=20=20185=20= ++++++++++++++++++++++++++++++++++++++++++=0A=203=20files=20changed,=20= 234=20insertions(+),=2063=20deletions(-)=0A=20create=20mode=20100644=20= guix/build/kconfig.scm=0A=0Adiff=20--git=20a/Makefile.am=20b/Makefile.am=0A= index=2022dcc43f99..92ba939ab4=20100644=0A---=20a/Makefile.am=0A+++=20= b/Makefile.am=0A@@=20-235,6=20+235,7=20@@=20MODULES=20=3D=09=09=09=09=09= \=0A=20=20=20guix/build/waf-build-system.scm=09=09\=0A=20=20=20= guix/build/haskell-build-system.scm=09=09\=0A=20=20=20= guix/build/julia-build-system.scm=09=09\=0A+=20=20guix/build/kconfig.scm=09= =09=09\=0A=20=20=20guix/build/linux-module-build-system.scm=09\=0A=20=20=20= guix/build/store-copy.scm=09=09=09\=0A=20=20=20guix/build/json.scm=09=09=09= =09\=0Adiff=20--git=20a/gnu/packages/bootloaders.scm=20= b/gnu/packages/bootloaders.scm=0Aindex=20658de5a808..1f00c9a041=20100644=0A= ---=20a/gnu/packages/bootloaders.scm=0A+++=20= b/gnu/packages/bootloaders.scm=0A@@=20-778,8=20+778,9=20@@=20def=20= test_ctrl_c"))=0A=20also=20initializes=20the=20boards=20(RAM=20etc).=20=20= This=20package=20provides=20its=0A=20board-independent=20tools.")))=0A=20= =0A-(define-public=20(make-u-boot-package=20board=20triplet)=0A-=20=20= "Returns=20a=20u-boot=20package=20for=20BOARD=20cross-compiled=20for=20= TRIPLET."=0A+(define*-public=20(make-u-boot-package=20board=20triplet=20= #:key=20defconfig=20configs)=0A+=20=20"Returns=20a=20u-boot=20package=20= for=20BOARD=20cross-compiled=20for=20TRIPLET=20with=20the=0A+optional=20= DEFCONFIG=20file=20and=20optional=20configuration=20changes=20from=20= CONFIGS."=0A=20=20=20(let=20((same-arch?=20(lambda=20()=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(string=3D?=20= (%current-system)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(gnu-triplet->nix-system=20= triplet)))))=0A@@=20-797,8=20+798,11=20@@=20board-independent=20= tools.")))=0A=20=20=20=20=20=20=20(arguments=0A=20=20=20=20=20=20=20=20= `(#:modules=20((ice-9=20ftw)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(srfi=20srfi-1)=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(guix=20build=20utils)=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(guix=20build=20= gnu-build-system))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(guix=20build=20gnu-build-system)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(guix=20build=20kconfig)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(guix=20build=20utils))=0A= +=20=20=20=20=20=20=20=20=20#:imported-modules=20= (,@%gnu-build-system-modules=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(guix=20build=20kconfig))=0A= =20=20=20=20=20=20=20=20=20=20#:test-target=20"test"=0A=20=20=20=20=20=20= =20=20=20=20#:make-flags=0A=20=20=20=20=20=20=20=20=20=20(list=20= "HOSTCC=3Dgcc"=0A@@=20-809,9=20+813,19=20@@=20board-independent=20= tools.")))=0A=20=20=20=20=20=20=20=20=20=20(modify-phases=20= %standard-phases=0A=20=20=20=20=20=20=20=20=20=20=20=20(replace=20= 'configure=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda*=20(#:key=20= outputs=20make-flags=20#:allow-other-keys)=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(let=20((config-name=20(string-append=20,board=20= "_defconfig")))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (if=20(file-exists?=20(string-append=20"configs/"=20config-name))=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(apply=20invoke=20= "make"=20`(,@make-flags=20,config-name))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(let*=20((config-name=20(string-append=20,board=20= "_defconfig"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(config-file=20(string-append=20"configs/"=20config-name))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (defconfig=20,defconfig)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(configs=20',configs))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(when=20defconfig=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20Replace=20the=20board-specific=20= defconfig=20with=20the=20given=20one.=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(copy-file=20defconfig=20config-file))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20(file-exists?=20= config-file)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(begin=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(when=20configs=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(modify-defconfig=20config-file=20= configs))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(apply=20invoke=20"make"=20`(,@make-flags=20,config-name))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (verify-config=20".config"=20config-file))=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(begin=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(display=20"Invalid=20board=20= name.=20Valid=20board=20names=20are:"=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (current-error-port))=0A@@=20-865,7=20+879,11=20@@=20board-independent=20= tools.")))=0A=20=20=20(make-u-boot-package=20"malta"=20= "mips64el-linux-gnuabi64"))=0A=20=0A=20(define-public=20= u-boot-am335x-boneblack=0A-=20=20(let=20((base=20(make-u-boot-package=20= "am335x_evm"=20"arm-linux-gnueabihf")))=0A+=20=20(let=20((base=20= (make-u-boot-package=20"am335x_evm"=20"arm-linux-gnueabihf"=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20Patch=20out=20other=20device=20= trees=20to=20build=20image=20small=20enough=20to=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20fit=20within=20typical=20partitioning=20= schemes=20where=20the=20first=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20partition=20begins=20at=20sector=202048.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20#:configs=20'("CONFIG_OF_LIST=3D\"am335x-evm=20= am335x-boneblack\""))))=0A=20=20=20=20=20(package=0A=20=20=20=20=20=20=20= (inherit=20base)=0A=20=20=20=20=20=20=20(name=20= "u-boot-am335x-boneblack")=0A@@=20-874,25=20+892,13=20@@=20also=20= initializes=20the=20boards=20(RAM=20etc).=0A=20=0A=20This=20U-Boot=20is=20= built=20for=20the=20BeagleBone=20Black,=20which=20was=20removed=20= upstream,=0A=20adjusted=20from=20the=20am335x_evm=20build=20with=20= several=20device=20trees=20removed=20so=20that=0A-it=20fits=20within=20= common=20partitioning=20schemes.")=0A-=20=20=20=20=20=20(arguments=0A-=20= =20=20=20=20=20=20(substitute-keyword-arguments=20(package-arguments=20= base)=0A-=20=20=20=20=20=20=20=20=20((#:phases=20phases)=0A-=20=20=20=20=20= =20=20=20=20=20`(modify-phases=20,phases=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20(add-after=20'unpack=20'patch-defconfig=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20Patch=20out=20other=20devicetrees=20to=20= build=20image=20small=20enough=20to=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20fit=20within=20typical=20partitioning=20schemes=20where=20= the=20first=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= partition=20begins=20at=20sector=202048.=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(lambda=20_=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(substitute*=20"configs/am335x_evm_defconfig"=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(("CONFIG_OF_LIST=3D.*$")=20= "CONFIG_OF_LIST=3D\"am335x-evm=20am335x-boneblack\"\n"))=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20#t)))))))))=0A+it=20fits=20within=20= common=20partitioning=20schemes."))))=0A=20=0A=20(define-public=20= u-boot-am335x-evm=0A=20=20=20(make-u-boot-package=20"am335x_evm"=20= "arm-linux-gnueabihf"))=0A=20=0A-(define-public=20= (make-u-boot-sunxi64-package=20board=20triplet)=0A-=20=20(let=20((base=20= (make-u-boot-package=20board=20triplet)))=0A+(define*-public=20= (make-u-boot-sunxi64-package=20board=20triplet=20#:key=20defconfig=20= configs)=0A+=20=20(let=20((base=20(make-u-boot-package=20board=20triplet=20= #:defconfig=20defconfig=20#:configs=20configs)))=0A=20=20=20=20=20= (package=0A=20=20=20=20=20=20=20(inherit=20base)=0A=20=20=20=20=20=20=20= (arguments=0A@@=20-922,20=20+928,10=20@@=20it=20fits=20within=20common=20= partitioning=20schemes.")=0A=20=20=20(make-u-boot-sunxi64-package=20= "pine64-lts"=20"aarch64-linux-gnu"))=0A=20=0A=20(define-public=20= u-boot-pinebook=0A-=20=20(let=20((base=20(make-u-boot-sunxi64-package=20= "pinebook"=20"aarch64-linux-gnu")))=0A-=20=20=20=20(package=0A-=20=20=20=20= =20=20(inherit=20base)=0A-=20=20=20=20=20=20(arguments=0A-=20=20=20=20=20= =20=20(substitute-keyword-arguments=20(package-arguments=20base)=0A-=20=20= =20=20=20=20=20=20=20((#:phases=20phases)=0A-=20=20=20=20=20=20=20=20=20=20= `(modify-phases=20,phases=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= (add-after=20'unpack=20'patch-pinebook-config=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Fix=20regression=20with=20LCD=20video=20output=20= introduced=20in=202020.01=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20https://patchwork.ozlabs.org/patch/1225130/=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(lambda=20_=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(substitute*=20"configs/pinebook_defconfig"=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (("CONFIG_VIDEO_BRIDGE_ANALOGIX_ANX6345=3Dy")=20= "CONFIG_VIDEO_BRIDGE_ANALOGIX_ANX6345=3Dy\nCONFIG_VIDEO_BPP32=3Dy"))=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#t)))))))))=0A+=20=20= (make-u-boot-sunxi64-package=20"pinebook"=20"aarch64-linux-gnu"=0A+=20=20= =20;;=20Fix=20regression=20with=20LCD=20video=20output=20introduced=20in=20= 2020.01=0A+=20=20=20;;=20https://patchwork.ozlabs.org/patch/1225130/=0A+=20= =20=20#:configs=20'("CONFIG_VIDEO_BPP32=3Dy")))=0A=20=0A=20= (define-public=20u-boot-bananapi-m2-ultra=0A=20=20=20= (make-u-boot-package=20"Bananapi_M2_Ultra"=20"arm-linux-gnueabihf"))=0A= @@=20-986,25=20+982,17=20@@=20device=20while=20it's=20being=20turned=20= on=20(and=20a=20while=20longer).")=0A=20=20=20(make-u-boot-package=20= "mx6cuboxi"=20"arm-linux-gnueabihf"))=0A=20=0A=20(define-public=20= u-boot-novena=0A-=20=20(let=20((base=20(make-u-boot-package=20"novena"=20= "arm-linux-gnueabihf")))=0A+=20=20(let=20((base=20(make-u-boot-package=20= "novena"=20"arm-linux-gnueabihf"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20;;=20Patch=20configuration=20to=20disable=20loading=20u-boot.img=20= from=20FAT=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= partition,=20allowing=20it=20to=20be=20installed=20at=20a=20device=20= offset.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#:configs=20'("#=20= CONFIG_SPL_FS_FAT=20is=20not=20set"))))=0A=20=20=20=20=20(package=0A=20=20= =20=20=20=20=20(inherit=20base)=0A=20=20=20=20=20=20=20(description=20= "U-Boot=20is=20a=20bootloader=20used=20mostly=20for=20ARM=20boards.=20=20= It=0A=20also=20initializes=20the=20boards=20(RAM=20etc).=0A=20=0A=20This=20= U-Boot=20is=20built=20for=20Novena.=20=20Be=20advised=20that=20this=20= version,=20contrary=0A-to=20Novena=20upstream,=20does=20not=20load=20= u-boot.img=20from=20the=20first=20partition.")=0A-=20=20=20=20=20=20= (arguments=0A-=20=20=20=20=20=20=20(substitute-keyword-arguments=20= (package-arguments=20base)=0A-=20=20=20=20=20=20=20=20=20((#:phases=20= phases)=0A-=20=20=20=20=20=20=20=20=20=20`(modify-phases=20,phases=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20(add-after=20'unpack=20= 'patch-novena-defconfig=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20Patch=20configuration=20to=20disable=20loading=20u-boot.img=20from=20= FAT=20partition,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= allowing=20it=20to=20be=20installed=20at=20a=20device=20offset.=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(lambda=20_=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(substitute*=20"configs/novena_defconfig"=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (("CONFIG_SPL_FS_FAT=3Dy")=20"#=20CONFIG_SPL_FS_FAT=20is=20not=20set"))=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#t)))))))))=0A+to=20= Novena=20upstream,=20does=20not=20load=20u-boot.img=20from=20the=20first=20= partition."))))=0A=20=0A=20(define-public=20u-boot-cubieboard=0A=20=20=20= (make-u-boot-package=20"Cubieboard"=20"arm-linux-gnueabihf"))=0A@@=20= -1092,7=20+1080,15=20@@=20to=20Novena=20upstream,=20does=20not=20load=20= u-boot.img=20from=20the=20first=20partition.")=0A=20=20=20=20=20=20=20=20= =20=20,@(package-native-inputs=20base))))))=0A=20=0A=20(define-public=20= u-boot-rockpro64-rk3399=0A-=20=20(let=20((base=20(make-u-boot-package=20= "rockpro64-rk3399"=20"aarch64-linux-gnu")))=0A+=20=20(let=20((base=20= (make-u-boot-package=20"rockpro64-rk3399"=20"aarch64-linux-gnu"=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20#:configs=20'("CONFIG_USB=3Dy"=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20"CONFIG_AHCI=3Dy"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20"CONFIG_AHCI_PCI=3Dy"=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "CONFIG_SATA=3Dy"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"CONFIG_SATA_SIL=3Dy"=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "CONFIG_SCSI=3Dy"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"CONFIG_SCSI_AHCI=3Dy"=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "CONFIG_DM_SCSI=3Dy"))))=0A=20=20=20=20=20(package=0A=20=20=20=20=20=20=20= (inherit=20base)=0A=20=20=20=20=20=20=20(arguments=0A@@=20-1103,19=20= +1099,8=20@@=20to=20Novena=20upstream,=20does=20not=20load=20u-boot.img=20= from=20the=20first=20partition.")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(lambda*=20(#:key=20inputs=20#:allow-other-keys)=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setenv=20"BL31"=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (search-input-file=20inputs=20"/bl31.elf"))))=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(add-after=20'unpack=20'patch-config=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(add-after=20'unpack=20'patch-header=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda=20_=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(substitute*=20= "configs/rockpro64-rk3399_defconfig"=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(("CONFIG_USB=3Dy")=20"\=0A-CONFIG_USB=3Dy=0A= -CONFIG_AHCI=3Dy=0A-CONFIG_AHCI_PCI=3Dy=0A-CONFIG_SATA=3Dy=0A= -CONFIG_SATA_SIL=3Dy=0A-CONFIG_SCSI=3Dy=0A-CONFIG_SCSI_AHCI=3Dy=0A= -CONFIG_DM_SCSI=3Dy=0A-"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(substitute*=20"include/config_distro_bootcmd.h"=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (("\"scsi_need_init=3Dfalse")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20"\"setenv=20scsi_need_init=20false")=0Adiff=20= --git=20a/guix/build/kconfig.scm=20b/guix/build/kconfig.scm=0Anew=20file=20= mode=20100644=0Aindex=200000000000..0cfaffe056=0A---=20/dev/null=0A+++=20= b/guix/build/kconfig.scm=0A@@=20-0,0=20+1,185=20@@=0A+;;;=20GNU=20Guix=20= ---=20Functional=20package=20management=20for=20GNU=0A+;;;=20Copyright=20= =C2=A9=202020=20Stefan=20=0A+;;;=0A+;;;=20= This=20file=20is=20part=20of=20GNU=20Guix.=0A+;;;=0A+;;;=20GNU=20Guix=20= is=20free=20software;=20you=20can=20redistribute=20it=20and/or=20modify=20= it=0A+;;;=20under=20the=20terms=20of=20the=20GNU=20General=20Public=20= License=20as=20published=20by=0A+;;;=20the=20Free=20Software=20= Foundation;=20either=20version=203=20of=20the=20License,=20or=20(at=0A= +;;;=20your=20option)=20any=20later=20version.=0A+;;;=0A+;;;=20GNU=20= Guix=20is=20distributed=20in=20the=20hope=20that=20it=20will=20be=20= useful,=20but=0A+;;;=20WITHOUT=20ANY=20WARRANTY;=20without=20even=20the=20= implied=20warranty=20of=0A+;;;=20MERCHANTABILITY=20or=20FITNESS=20FOR=20= A=20PARTICULAR=20PURPOSE.=20=20See=20the=0A+;;;=20GNU=20General=20Public=20= License=20for=20more=20details.=0A+;;;=0A+;;;=20You=20should=20have=20= received=20a=20copy=20of=20the=20GNU=20General=20Public=20License=0A+;;;=20= along=20with=20GNU=20Guix.=20=20If=20not,=20see=20= .=0A+=0A+(define-module=20(guix=20build=20= kconfig)=0A+=20=20#:use-module=20=20(ice-9=20rdelim)=0A+=20=20= #:use-module=20=20(ice-9=20regex)=0A+=20=20#:use-module=20=20(srfi=20= srfi-1)=0A+=20=20#:use-module=20=20(srfi=20srfi-26)=0A+=20=20#:export=20= (modify-defconfig=0A+=20=20=20=20=20=20=20=20=20=20=20=20verify-config))=0A= +=0A+;;=20Commentary:=0A+;;=0A+;;=20Builder-side=20code=20to=20modify=20= configurations=20for=20the=20Kconfig=20build=20system=20as=0A+;;=20used=20= by=20Linux=20and=20U-Boot.=0A+;;=0A+;;=20Code:=0A+=0A+(define=20= (config-string->pair=20config-string)=0A+=20=20"Parse=20a=20= configuration=20string=20like=20\"CONFIG_EXAMPLE=3Dm\"=20into=20a=20= key-value=20pair.=0A+An=20error=20is=20thrown=20for=20invalid=20= configurations.=0A+=0A+\"CONFIG_A=3Dy\"=20=20=20=20=20=20=20=20=20=20=20=20= ->=20'(\"CONFIG_A\"=20.=20\"y\")=0A+\"CONFIG_B=3D\\\"\\\"\"=20=20=20=20=20= =20=20=20=20->=20'(\"CONFIG_B\"=20.=20\"\\\"\\\"\")=0A+\"CONFIG_C=3D\"=20= =20=20=20=20=20=20=20=20=20=20=20=20->=20'(\"CONFIG_C\"=20.=20\"\")=0A= +\"#=20CONFIG_E=20is=20not=20set\"=20->=20'(\"CONFIG_E\"=20.=20#f)=0A= +\"CONFIG_D\"=20=20=20=20=20=20=20=20=20=20=20=20=20=20->=20= '(\"CONFIG_D\"=20.=20#f)=0A+\"#=20Any=20comment\"=20=20=20=20=20=20=20=20= =20->=20'(#f=20.=20\"#=20Any=20comment\")=0A+\"\"=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20->=20'(#f=20.=20\"\")=0A+\"#=20= CONFIG_E=3Dy\"=20=20=20=20=20=20=20=20=20=20->=20(error=20\"Invalid=20= configuration\")=0A+\"CONFIG_E=20is=20not=20set\"=20=20=20->=20(error=20= \"Invalid=20configuration\")=0A+\"Anything=20else\"=20=20=20=20=20=20=20=20= =20->=20(error=20\"Invalid=20configuration\")"=0A+=20=20(define=20= config-regexp=0A+=20=20=20=20(make-regexp=0A+=20=20=20=20=20;;=20= (match:substring=20(string-match=20"=3D(.*)"=20"=3D")=201)=20returns=20= "",=20but=20the=0A+=20=20=20=20=20;;=20pattern=20"=3D(.+)?"=20makes=20it=20= return=20#f=20instead.=20=20=46rom=20a=20"CONFIG_A=3D"=20we=20like=0A+=20= =20=20=20=20;;=20to=20get=20"",=20which=20later=20emits=20"CONFIG_A=3D"=20= again.=0A+=20=20=20=20=20"^=20*(#[\\t=20]*)?(CONFIG_[a-zA-Z0-9_]+)([\\t=20= ]*=3D[\\t=20]*(.*)|([\\t=20]+is[\\t=20]+not[\\t=20]+set))?$"))=0A+=0A+=20= =20(define=20config-comment-regexp=0A+=20=20=20=20(make-regexp=20"^([\\t=20= ]*(#.*)?)$"))=0A+=0A+=20=20(let=20((match=20(regexp-exec=20config-regexp=20= (string-trim-right=20config-string))))=0A+=20=20=20=20(if=20match=0A+=20=20= =20=20=20=20=20=20(let*=20((comment=20(match:substring=20match=201))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(key=20(match:substring=20= match=202))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(unset=20= (match:substring=20match=205))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(value=20(and=20(not=20comment)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20unset)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (match:substring=20match=204))))=0A+=20=20=20=20=20=20=20=20=20=20(if=20= (eq?=20(not=20comment)=20(not=20unset))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20The=20key=20is=20uncommented=20and=20set=20or=20= commented=20and=20unset.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cons=20key=20value)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= The=20key=20is=20set=20or=20unset=20ambigiously.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(error=20(format=20#f=20"Invalid=20configuration,=20= did=20you=20mean=20\"~a\"?"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(pair->config-string=20= (cons=20key=20#f)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20config-string)))=0A+=20=20=20=20=20=20=20=20;;=20This=20is=20= not=20a=20valid=20or=20ambigious=20config-string,=20but=20mayby=20a=20= comment.=0A+=20=20=20=20=20=20=20=20(if=20(regexp-exec=20= config-comment-regexp=20config-string)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20;;=20We=20keep=20valid=20comments.=0A+=20=20=20=20=20=20=20=20=20=20=20= =20(cons=20#f=20config-string)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (error=20"Invalid=20configuration"=20config-string)))))=0A+=0A+(define=20= (pair->config-string=20pair)=0A+=20=20"Convert=20a=20PAIR=20back=20to=20= a=20config-string."=0A+=20=20(let*=20((key=20(first=20pair))=0A+=20=20=20= =20=20=20=20=20=20(value=20(cdr=20pair)))=0A+=20=20=20=20(if=20(string?=20= key)=0A+=20=20=20=20=20=20=20=20(if=20(string?=20value)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20(string-append=20key=20"=3D"=20value)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20(string-append=20"#=20"=20key=20"=20is=20not=20= set"))=0A+=20=20=20=20=20=20=20=20value)))=0A+=0A+(define=20= (defconfig->alist=20defconfig)=0A+=20=20"Convert=20the=20content=20of=20= a=20DEFCONFIG=20(or=20.config)=20file=20into=20an=20alist."=0A+=20=20= (with-input-from-file=20defconfig=0A+=20=20=20=20(lambda=20()=0A+=20=20=20= =20=20=20(let=20loop=20((alist=20'())=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(line=20(read-line)))=0A+=20=20=20=20=20=20=20=20(if=20= (eof-object?=20line)=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20= Building=20the=20alist=20is=20done,=20now=20check=20for=20duplicates.=0A= +=20=20=20=20=20=20=20=20=20=20=20=20(let=20loop=20((keys=20(map=20first=20= (filter=20first=20alist)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(duplicates=20'()))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(if=20(null?=20keys)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20;;=20The=20search=20for=20duplicates=20is=20done.=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Return=20the=20= alist=20or=20throw=20an=20error=20on=20duplicates.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(if=20(null?=20duplicates)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20alist=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(error=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(format=20#f=20= "Duplicate=20configurations=20in=20~a"=20defconfig)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20duplicates))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Continue=20the=20= search=20for=20duplicates.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(loop=20(cdr=20keys)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(if=20(member=20(first=20keys)=20(cdr=20= keys)=20equal?)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(cons=20(first=20keys)=20duplicates)=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20duplicates))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20Build=20= the=20alist.=0A+=20=20=20=20=20=20=20=20=20=20=20=20(loop=20(cons=20= (config-string->pair=20line)=20alist)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(read-line)))))))=0A+=0A+(define=20= (modify-defconfig=20defconfig=20configs)=0A+=20=20"This=20function=20can=20= modify=20a=20given=20DEFCONFIG=20(or=20.config)=20file=20by=20adding,=0A= +changing=20or=20removing=20the=20list=20of=20strings=20in=20CONFIGS.=20=20= This=20allows=20customization=0A+of=20Kconfig=20based=20projects=20like=20= the=20kernel=20Linux=20or=20the=20bootloader=20'Das=20U-Boot'.=0A+=0A= +These=20are=20examples=20for=20CONFIGS=20to=20add,=20change=20or=20= remove=20configurations=20to/from=0A+DEFCONFIG:=0A+=0A= +'(\"CONFIG_A=3D\\\"a\\\"\"=0A+=20=20\"CONFIG_B=3D0\"=0A+=20=20= \"CONFIG_C=3Dy\"=0A+=20=20\"CONFIG_D=3Dm\"=0A+=20=20\"CONFIG_E=3D\"=0A+=20= =20\"#=20CONFIG_G=20is=20not=20set\"=0A+=20=20;;=20For=20convinience=20= this=20abbrevation=20can=20be=20used=20for=20not=20set=20configurations.=0A= +=20=20\"CONFIG_F\")=0A+=0A+Instead=20of=20a=20list,=20CONFGIS=20can=20= be=20a=20string=20with=20one=20configuration=20per=20line."=0A+=20=20= (let*=20(;;=20Split=20the=20configs=20into=20a=20list=20of=20single=20= configuations.=0A+=20=20=20=20=20=20=20=20=20;;=20To=20minimize=20= mistakes,=20we=20support=20a=20string=20and=20a=20list=20of=20strings,=0A= +=20=20=20=20=20=20=20=20=20;;=20each=20with=20newlines=20to=20separate=20= configurations.=0A+=20=20=20=20=20=20=20=20=20(config-pairs=20(map=20= config-string->pair=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(append-map=20(cut=20string-split=20<>=20= =20#\newline)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (string?=20configs)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(list=20configs)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20configs))))=0A+=20=20=20=20=20=20=20=20=20;;=20Generate=20a=20= blocklist=20from=20all=20valid=20keys=20in=20config-pairs.=0A+=20=20=20=20= =20=20=20=20=20(blocklist=20(delete=20#f=20(map=20first=20= config-pairs)))=0A+=20=20=20=20=20=20=20=20=20;;=20Generate=20an=20alist=20= from=20the=20defconifg=20without=20the=20keys=20in=20blocklist.=0A+=20=20= =20=20=20=20=20=20=20(filtered-defconfig-pairs=20(remove=20(lambda=20= (pair)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (member=20(first=20pair)=20blocklist))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(defconfig->alist=20defconfig))))=0A+=20=20=20=20= (with-output-to-file=20defconfig=0A+=20=20=20=20=20=20(lambda=20()=0A+=20= =20=20=20=20=20=20=20(for-each=0A+=20=20=20=20=20=20=20=20=20=20=20= (lambda=20(pair)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(display=20= (pair->config-string=20pair))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (newline))=0A+=20=20=20=20=20=20=20=20=20=20=20(append=20= filtered-defconfig-pairs=20config-pairs))))))=0A+=0A+(define=20= (verify-config=20config=20defconfig)=0A+=20=20"Verify=20that=20the=20= CONFIG=20file=20contains=20all=20configurations=20from=20the=20DEFCONFIG=0A= +file=20and=20return=20#t=20in=20this=20case.=20Otherwise=20throw=20an=20= error=20with=20the=20mismatching=0A+keys=20and=20their=20values."=0A+=20=20= (let*=20((config-pairs=20(defconfig->alist=20config))=0A+=20=20=20=20=20=20= =20=20=20(defconfig-pairs=20(defconfig->alist=20defconfig))=0A+=20=20=20=20= =20=20=20=20=20(mismatching-pairs=0A+=20=20=20=20=20=20=20=20=20=20= (remove=20(lambda=20(pair)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Remove=20all=20configurations,=20whose=20values=20= are=20#f=20and=20whose=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20keys=20are=20not=20in=20config-pairs,=20as=20not=20in=20= config-pairs=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20means=20unset,=20=E2=80=A6=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(and=20(not=20(cdr=20pair))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20= (assoc-ref=20config-pairs=20(first=20pair)))))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20;;=20=E2=80=A6=20from=20the=20= defconfig-pairs=20different=20to=20config-pairs.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(lset-difference=20equal?=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20;;=20Remove=20comments=20by=20filtering=20with=20= first.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(filter=20first=20= defconfig-pairs)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20config-pairs))))=0A+=20= =20=20=20(if=20(null?=20mismatching-pairs)=0A+=20=20=20=20=20=20=20=20#t=0A= +=20=20=20=20=20=20=20=20(error=20(format=20#f=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"Mismatching=20= configurations=20in=20~a=20and=20~a"=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20config=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20defconfig)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(map=20(lambda=20(mismatching-pair)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(let*=20((key=20= (first=20mismatching-pair))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(defconfig-value=20(cdr=20= mismatching-pair))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(config-value=20(assoc-ref=20= config-pairs=20key)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(cons=20key=20(list=20(list=20config-value=20= defconfig-value)))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20mismatching-pairs)))))=0A= --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Disposition: attachment; filename=04-gnu-bootloader-add-u-boot.patch Content-Type: application/octet-stream; name="04-gnu-bootloader-add-u-boot.patch" Content-Transfer-Encoding: 7bit gnu: bootloader: Add U-Boot packages for Raspberry Pi models. From: Stefan * gnu/packages/bootloader.scm (make-u-boot-package): Add keyword parameters 'name-suffix' and 'append-description'. (make-u-boot-bin-package): New function to make minimal packages. (%u-boot-rpi-efi-configs): New helper list with config strings. (%u-boot-rpi-description-32-bit, %u-boot-rpi-description-64-bit, %u-boot-rpi-efi-description, %u-boot-rpi-efi-description-32-bit): New helper strings. (u-boot-rpi-2{,-efi,-bin,-efi-bin}, u-boot-rpi-3-32b{,-efi,-bin,-efi-bin}, u-boot-rpi-4-32b{,-efi,-bin,-efi-bin}, u-boot-rpi-arm64{,-efi,-bin,-efi-bin}): New packages. (u-boot-tools): Reuse the description of u-boot. (u-boot-{am335x-boneblack,am335x-evm,nintendo-nes-classic-edition, novena}): Make use of new keyword parameters of make-u-boot-package. --- gnu/packages/bootloaders.scm | 201 +++++++++++++++++++++++++++++++++--------- 1 file changed, 157 insertions(+), 44 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 1f00c9a041..5a35d3cb04 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -635,7 +635,7 @@ tree binary files. These are board description files used by Linux and BSD.") (name "u-boot") (version "2022.04") (source (origin - (patches + (patches (list %u-boot-rockchip-inno-usb-patch %u-boot-allow-disabling-openssl-patch %u-boot-sifive-prevent-relocating-initrd-fdt @@ -774,13 +774,21 @@ def test_ctrl_c")) (setenv "PAGER" "cat") (apply invoke "make" test-target make-flags)))) '())))) - (description "U-Boot is a bootloader used mostly for ARM boards. It -also initializes the boards (RAM etc). This package provides its -board-independent tools."))) - -(define*-public (make-u-boot-package board triplet #:key defconfig configs) - "Returns a u-boot package for BOARD cross-compiled for TRIPLET with the -optional DEFCONFIG file and optional configuration changes from CONFIGS." + (description (string-append (package-description u-boot) + " This package provides board-independent +tools of U-Boot.")))) + +(define*-public (make-u-boot-package board + triplet + #:key + defconfig + configs + name-suffix + append-description) + "Returns a U-Boot package for BOARD cross-compiled for TRIPLET with the +optional DEFCONFIG file and optional configuration changes from CONFIGS. +A NAME-SUFFIX will be appended to the package name. An APPEND-DESCRIPTION +string will be appended to the package description." (let ((same-arch? (lambda () (string=? (%current-system) (gnu-triplet->nix-system triplet))))) @@ -788,7 +796,12 @@ optional DEFCONFIG file and optional configuration changes from CONFIGS." (inherit u-boot) (name (string-append "u-boot-" (string-replace-substring (string-downcase board) - "_" "-"))) + "_" "-") + (or name-suffix ""))) + (description (if append-description + (string-append (package-description u-boot) + "\n\n" append-description) + (package-description u-boot))) (native-inputs `(,@(if (not (same-arch?)) `(("cross-gcc" ,(cross-gcc triplet)) @@ -879,20 +892,15 @@ optional DEFCONFIG file and optional configuration changes from CONFIGS." (make-u-boot-package "malta" "mips64el-linux-gnuabi64")) (define-public u-boot-am335x-boneblack - (let ((base (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf" - ;; Patch out other device trees to build image small enough to - ;; fit within typical partitioning schemes where the first - ;; partition begins at sector 2048. - #:configs '("CONFIG_OF_LIST=\"am335x-evm am335x-boneblack\"")))) - (package - (inherit base) - (name "u-boot-am335x-boneblack") - (description "U-Boot is a bootloader used mostly for ARM boards. It -also initializes the boards (RAM etc). - -This U-Boot is built for the BeagleBone Black, which was removed upstream, -adjusted from the am335x_evm build with several device trees removed so that -it fits within common partitioning schemes.")))) + (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf" + ;; Patch out other device trees to build an image small enough to fit within + ;; typical partitioning schemes where the first partition begins at sector + ;; 2048. + #:configs '("CONFIG_OF_LIST=\"am335x-evm am335x-boneblack\"") + #:name-suffix "-boneblack" + #:append-description "This U-Boot is built for the BeagleBone Black, which +was removed upstream, adjusted from the am335x_evm build with several device +trees removed so that it fits within common partitioning schemes.")) (define-public u-boot-am335x-evm (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf")) @@ -947,7 +955,14 @@ it fits within common partitioning schemes.")))) (define-public u-boot-nintendo-nes-classic-edition (let ((base (make-u-boot-package "Nintendo_NES_Classic_Edition" - "arm-linux-gnueabihf"))) + "arm-linux-gnueabihf" + #:append-description "This version is for +the Nintendo NES Classic Edition. It is assumed that you have added a serial +port to pins PB0 and PB1 as described on +@url{https://linux-sunxi.org/Nintendo_NES_Classic_Edition}. + +In order to use FEL mode on the device, hold the Reset button on the +device while it's being turned on (and a while longer)."))) (package (inherit base) ;; Starting with 2019.01, FEL doesn't work anymore on A33. @@ -962,15 +977,6 @@ it fits within common partitioning schemes.")))) "0znkwljfwwn4y7j20pzz4ilqw8znphrfxns0x1lwdzh3xbr96z3k")) (patches (search-patches "u-boot-nintendo-nes-serial.patch")))) - (description "U-Boot is a bootloader used mostly for ARM boards. It -also initializes the boards (RAM etc). - -This version is for the Nintendo NES Classic Edition. It is assumed that -you have added a serial port to pins PB0 and PB1 as described on -@url{https://linux-sunxi.org/Nintendo_NES_Classic_Edition}. - -In order to use FEL mode on the device, hold the Reset button on the -device while it's being turned on (and a while longer).") (native-inputs `(("python" ,python-2) ,@(package-native-inputs base)))))) @@ -982,17 +988,13 @@ device while it's being turned on (and a while longer).") (make-u-boot-package "mx6cuboxi" "arm-linux-gnueabihf")) (define-public u-boot-novena - (let ((base (make-u-boot-package "novena" "arm-linux-gnueabihf" - ;; Patch configuration to disable loading u-boot.img from FAT - ;; partition, allowing it to be installed at a device offset. - #:configs '("# CONFIG_SPL_FS_FAT is not set")))) - (package - (inherit base) - (description "U-Boot is a bootloader used mostly for ARM boards. It -also initializes the boards (RAM etc). - -This U-Boot is built for Novena. Be advised that this version, contrary -to Novena upstream, does not load u-boot.img from the first partition.")))) + (make-u-boot-package "novena" "arm-linux-gnueabihf" + ;; Patch configuration to disable loading u-boot.img from FAT partition, + ;; allowing it to be installed at a device offset. + #:configs '("# CONFIG_SPL_FS_FAT is not set") + #:append-description "This U-Boot is built for Novena. Be advised that this +version, contrary to Novena upstream, does not load u-boot.img from the first +partition.")) (define-public u-boot-cubieboard (make-u-boot-package "Cubieboard" "arm-linux-gnueabihf")) @@ -1145,6 +1147,117 @@ BOOT_TARGET_NVME(func) \\ `(("firmware" ,arm-trusted-firmware-rk3399) ,@(package-native-inputs base)))))) +(define*-public (make-u-boot-bin-package u-boot-package + #:key + (u-boot-bin "u-boot.bin")) + "Return a package with a single U-BOOT-BIN file from the U-BOOT-PACKAGE. +The package name will be that of the U-BOOT package suffixed with \"-bin\"." + (package + (name (string-append (package-name u-boot-package) "-bin")) + (version (package-version u-boot-package)) + (source #f) + (build-system trivial-build-system) + (arguments + `(#:builder + (begin + (let ((out (assoc-ref %outputs "out"))) + (mkdir out) + (symlink (string-append (assoc-ref %build-inputs "u-boot") + "/libexec/" + ,u-boot-bin) + (string-append out "/" ,u-boot-bin)))))) + (inputs `(("u-boot" ,u-boot-package))) + (home-page (package-home-page u-boot-package)) + (synopsis (package-synopsis u-boot-package)) + (description (string-append + (package-description u-boot-package) + "\n\n" + (format #f + "This package only contains the file ~a." + u-boot-bin))) + (license (package-license u-boot-package)))) + +(define-public %u-boot-rpi-efi-configs + '("CONFIG_OF_EMBED" + "CONFIG_OF_BOARD=y")) + +(define %u-boot-rpi-description-32-bit + "This is a 32-bit build of U-Boot.") + +(define %u-boot-rpi-description-64-bit + "This is a common 64-bit build of U-Boot for all 64-bit capable Raspberry Pi +variants.") + +(define %u-boot-rpi-efi-description + "It allows network booting and uses the device-tree from the firmware, +allowing the usage of overlays. It can act as an EFI firmware for the +grub-efi-netboot-removable-bootloader.") + +(define %u-boot-rpi-efi-description-32-bit + (string-append %u-boot-rpi-efi-description " " + %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-2 + (make-u-boot-package "rpi_2" "arm-linux-gnueabihf" + #:append-description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-3-32b + (make-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf" + #:append-description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-4-32b + (make-u-boot-package "rpi_4_32b" "arm-linux-gnueabihf" + #:append-description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-arm64 + (make-u-boot-package "rpi_arm64" "aarch64-linux-gnu" + #:append-description %u-boot-rpi-description-64-bit)) + +(define-public u-boot-rpi-2-efi + (make-u-boot-package "rpi_2" "arm-linux-gnueabihf" + #:name-suffix "-efi" + #:configs %u-boot-rpi-efi-configs + #:append-description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-3-32b-efi + (make-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf" + #:name-suffix "-efi" + #:configs %u-boot-rpi-efi-configs + #:append-description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-4-32b-efi + (make-u-boot-package "rpi_4_32b" "arm-linux-gnueabihf" + #:name-suffix "-efi" + #:configs %u-boot-rpi-efi-configs + #:append-description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-arm64-efi + (make-u-boot-package "rpi_arm64""aarch64-linux-gnu" + #:name-suffix "-efi" + #:configs %u-boot-rpi-efi-configs + #:append-description (string-append + %u-boot-rpi-efi-description " " + %u-boot-rpi-description-64-bit))) + +(define-public u-boot-rpi-2-bin (make-u-boot-bin-package u-boot-rpi-2)) + +(define-public u-boot-rpi-3_32b-bin (make-u-boot-bin-package u-boot-rpi-3-32b)) + +(define-public u-boot-rpi-4_32b-bin (make-u-boot-bin-package u-boot-rpi-4-32b)) + +(define-public u-boot-rpi-arm64-bin (make-u-boot-bin-package u-boot-rpi-arm64)) + +(define-public u-boot-rpi-2-efi-bin (make-u-boot-bin-package u-boot-rpi-2-efi)) + +(define-public u-boot-rpi-3-32b-efi-bin + (make-u-boot-bin-package u-boot-rpi-3-32b-efi)) + +(define-public u-boot-rpi-4-32b-efi-bin + (make-u-boot-bin-package u-boot-rpi-4-32b-efi)) + +(define-public u-boot-rpi-arm64-efi-bin + (make-u-boot-bin-package u-boot-rpi-arm64-efi)) + (define-public vboot-utils (package (name "vboot-utils") --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Disposition: attachment; filename=05-gnu-linux-new-function-to.patch Content-Type: application/octet-stream; name="05-gnu-linux-new-function-to.patch" Content-Transfer-Encoding: quoted-printable gnu:=20linux:=20New=20function=20to=20modify=20the=20configuration=20of=20= a=20Linux=20kernel.=0A=0AFrom:=20Stefan=20=0A= =0A*=20gnu/packages/linux.scm=20(system->linux-srcarch):=20New=20= function=20to=20return=20the=0Arelevent=20folder=20name=20below=20arch/=20= in=20the=20Linux=20source=20code.=0A(modify-linux):=20New=20function=20= to=20make=20a=20customized=20Linux=20package=20inherited=0Afrom=20= another=20Linux=20package,=20which=20will=20be=20build=20with=20an=20own=20= defconfig=20or=0Aconfiguration=20changes.=0A(make-defconfig):=20Function=20= to=20get=20a=20defconfig=20from=20an=20uri.=0A---=0A=20= gnu/packages/linux.scm=20|=20=20123=20= ++++++++++++++++++++++++++++++++++++++++++++++++=0A=201=20file=20= changed,=20123=20insertions(+)=0A=0Adiff=20--git=20= a/gnu/packages/linux.scm=20b/gnu/packages/linux.scm=0Aindex=20= 1a35e857c3..33bc168074=20100644=0A---=20a/gnu/packages/linux.scm=0A+++=20= b/gnu/packages/linux.scm=0A@@=20-186,8=20+186,27=20@@=0A=20=20=20= #:use-module=20(srfi=20srfi-2)=0A=20=20=20#:use-module=20(srfi=20= srfi-26)=0A=20=20=20#:use-module=20(ice-9=20match)=0A+=20=20#:use-module=20= (ice-9=20optargs)=0A=20=20=20#:use-module=20(ice-9=20regex))=0A=20=0A= +(define-public=20(linux-srcarch)=0A+=20=20"Return=20the=20linux=20= SRCARCH=20name,=20which=20is=20set=20in=20the=20toplevel=20Makefile=20of=0A= +Linux=20and=20denotes=20the=20architecture=20specific=20directory=20= name=20below=20arch/=20in=20its=0A+source=20code.=20=20Some=20few=20= architectures=20share=20a=20common=20folder.=20=20It=20resembles=20the=0A= +definition=20of=20SRCARCH=20based=20on=20ARCH=20in=20the=20Makefile=20= and=20may=20be=20used=20to=20place=20a=0A+defconfig=20file=20in=20the=20= proper=20path."=0A+=20=20(let=20((linux-arch=20= (platform-linux-architecture=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(lookup-platform-by-target-or-system=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20= (%current-target-system)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(%current-system))))))=0A+=20=20=20= =20(match=20linux-arch=0A+=20=20=20=20=20=20("i386"=20=20=20=20"x86")=0A= +=20=20=20=20=20=20("x86_64"=20=20"x86")=0A+=20=20=20=20=20=20("sparc32"=20= "sparc")=0A+=20=20=20=20=20=20("sparc64"=20"sparc")=0A+=20=20=20=20=20=20= ("sh64"=20=20=20=20"sh")=0A+=20=20=20=20=20=20(_=20=20=20=20=20=20=20=20=20= linux-arch))))=0A+=0A=20(define-public=20(system->defconfig=20system)=0A=20= =20=20"Some=20systems=20(notably=20powerpc-linux)=20require=20a=20= special=20target=20for=20kernel=0A=20defconfig.=20=20Return=20the=20= appropriate=20make=20target=20if=20applicable,=20otherwise=20return=0A@@=20= -1179,6=20+1198,110=20@@=20It=20has=20been=20modified=20to=20remove=20= all=20non-free=20binary=20blobs.")=0A=20=20=20=20=20=20=20(inputs=20= (modify-inputs=20(package-inputs=20base-linux-libre)=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(prepend=20cpio))))))=0A=20=0A+=0C=0A= +;;;=0A+;;;=20Linux=20kernel=20customization=20functions.=0A+;;;=0A+=0A= +(define*-public=20(modify-linux=20#:key=20name=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(linux=20linux-libre)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= source=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20defconfig=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(configs=20"")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= extra-version)=0A+=20=20"Make=20a=20Linux=20package=20NAME=20as=20a=20= modification=20of=20another=20LINUX=20package.=0A+=0A+If=20NAME=20is=20= not=20given,=20then=20it=20defaults=20to=20the=20same=20name=20as=20the=20= LINUX=20package.=0A+=0A+Unless=20SOURCE=20is=20given=20the=20source=20of=20= LINUX=20is=20used.=0A+=0A+A=20DEFCONFIG=20file=20to=20be=20used=20can=20= be=20given=20as=20an=20origin,=20as=20a=20file=20like=20object=0A= +(file-append,=20local-file=20etc.),=20or=20as=20a=20string=20with=20the=20= name=20of=20a=20defconfig=20file=0A+available=20in=20the=20Linux=20= sources.=20=20If=20DEFCONFIG=20is=20not=20given,=20then=20a=20defconfig=0A= +file=20will=20be=20saved=20from=20the=20LINUX=20package=20= configuration.=0A+=0A+Additional=20CONFIGS=20will=20be=20used=20to=20= modify=20the=20given=20or=20saved=20defconfig,=20which=0A+will=20finally=20= be=20used=20to=20build=20Linux.=0A+=0A+CONFIGS=20can=20be=20a=20list=20= of=20strings,=20with=20one=20configuration=20per=20line.=20=20The=20= usual=0A+defconfig=20syntax=20has=20to=20be=20used,=20but=20there=20is=20= a=20special=20extension=20to=20ease=20the=0A+removal=20of=20= configurations.=20=20Comment=20lines=20are=20supported=20as=20well.=0A+=0A= +Here=20is=20an=20explaining=20usage=20example:=0A+=0A+=20=20'(;;=20This=20= string=20defines=20the=20version=20tail=20in=20'uname=20-r'.=0A+=20=20=20= =20\"CONFIG_LOCALVERSION=3D\\\"-handcrafted\\\"=0A+=20=20=20=20;;=20This=20= '#=20CONFIG_=E2=80=A6=20is=20not=20set'=20syntax=20has=20to=20match=20= exactly!=0A+=20=20=20=20\"#=20CONFIG_BOOT_CONFIG=20is=20not=20set\"=0A+=20= =20=20=20\"CONFIG_NFS_SWAP=3Dy\"=0A+=20=20=20=20;;=20This=20is=20a=20= multiline=20configuration:=0A+=20=20=20=20\"CONFIG_E1000=3Dy=0A+#=20This=20= is=20a=20comment,=20below=20follows=20an=20extension=20to=20unset=20a=20= configuration:=0A+CONFIG_CMDLINE_EXTEND\")=0A+=0A+A=20string=20of=20= configurations=20instead=20of=20a=20list=20of=20configuration=20strings=20= is=20also=0A+possible.=0A+=0A+EXTRA-VERSION=20can=20be=20a=20string=20= overwriting=20the=20EXTRAVERSION=20setting=20of=20the=20LINUX=0A= +package,=20after=20being=20prepended=20by=20a=20hyphen.=20=20It=20will=20= be=20visible=20in=20the=20output=0A+of=20'uname=20-r'=20behind=20the=20= Linux=20version=20numbers."=0A+=20=20(package=0A+=20=20=20=20(inherit=20= linux)=0A+=20=20=20=20(name=20(or=20name=20(package-name=20linux)))=0A+=20= =20=20=20(source=20(or=20source=20(package-source=20linux)))=0A+=20=20=20= =20(arguments=0A+=20=20=20=20=20(substitute-keyword-arguments=0A+=20=20=20= =20=20=20=20=20=20(package-arguments=20linux)=0A+=20=20=20=20=20=20=20= ((#:imported-modules=20imported-modules=20%gnu-build-system-modules)=0A+=20= =20=20=20=20=20=20=20`((guix=20build=20kconfig)=20,@imported-modules))=0A= +=20=20=20=20=20=20=20((#:modules=20modules)=0A+=20=20=20=20=20=20=20=20= `((guix=20build=20kconfig)=20,@modules))=0A+=20=20=20=20=20=20=20= ((#:phases=20phases)=0A+=20=20=20=20=20=20=20=20#~(modify-phases=20= #$phases=0A+=20=20=20=20=20=20=20=20=20=20=20=20(replace=20'configure=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda*=20(#:key=20inputs=20= #:allow-other-keys=20#:rest=20arguments)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(setenv=20"EXTRAVERSION"=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#$(and=20extra-version=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(not=20(string-null?=20extra-version))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-append=20"-"=20extra-version)))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(let*=20((configs=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(string-append=20"arch/"=20= #$(linux-srcarch)=20"/configs/"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(guix_defconfig=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(string-append=20= configs=20"guix_defconfig")))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20#$(cond=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20((not=20defconfig)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20#~(begin=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Call=20the=20original=20= 'configure=20phase.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(apply=20(assoc-ref=20#$phases=20'configure)=20= arguments)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Save=20a=20defconfig=20file.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(invoke=20"make"=20= "savedefconfig")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Move=20the=20saved=20defconfig=20to=20the=20= proper=20location.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(rename-file=20"defconfig"=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20guix_defconfig)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20((string?=20defconfig)=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Use=20another=20= existing=20defconfig=20from=20the=20Linux=20sources.=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#~(rename-file=20= (string-append=20configs=20#$defconfig)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20guix_defconfig))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(else=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Copy=20the=20defconfig=20input=20to=20the=20proper=20= location.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20#~(copy-file=20(assoc-ref=20inputs=20"guix_defconfig")=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20guix_defconfig)))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(chmod=20guix_defconfig=20#o644)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(modify-defconfig=20guix_defconfig=20= '#$configs)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (invoke=20"make"=20"guix_defconfig")=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(verify-config=20".config"=20guix_defconfig))))))))=0A= +=20=20=20=20(native-inputs=0A+=20=20=20=20=20(append=20(if=20(or=20(not=20= defconfig)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(string?=20defconfig))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20'()=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20The=20= defconfig=20should=20be=20an=20origin=20or=20file-like=20object.=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20`(("guix_defconfig"=20= ,defconfig)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (package-native-inputs=20linux)))))=0A+=0A+(define-public=20= (make-defconfig=20uri=20sha256-as-base32)=0A+=20=20(origin=20(method=20= url-fetch)=0A+=20=20=20=20=20=20=20=20=20=20(uri=20uri)=0A+=20=20=20=20=20= =20=20=20=20=20(sha256=20(base32=20sha256-as-base32))))=0A=20=0A=20=0C=0A= =20;;;=0A= --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Disposition: attachment; filename=06-gnu-raspberry-pi-add-defconfig.patch Content-Type: application/octet-stream; name="06-gnu-raspberry-pi-add-defconfig.patch" Content-Transfer-Encoding: quoted-printable gnu:=20raspberry-pi:=20Add=20defconfig=20objects=20to=20build=20= customized=20Linux=20kernels.=0A=0AFrom:=20Stefan=20= =0A=0Agnu/packages/raspberry-pi.scm=20= (make-raspi-defconig):=20New=20function=20to=20make=0Adownloaded=20= defconfig=20objects=20from=20the=20Linux=20repository=20of=20the=20= Raspberry=20Pi=0AFoundation.=0A(%bcm2709-defconfig,=20= %bcm2711-defconfig,=20%bcm2711-defconfig-64,=0A%bcmrpi3-defconfig):=20= New=20variables=20containing=20defconfig=20objects=20to=20build=0ALinux=20= kernels=20customized=20for=20Raspberry=20Pi=20single=20board=20= computers.=0A---=0A=20gnu/packages/raspberry-pi.scm=20|=20=20=2037=20= ++++++++++++++++++++++++++++++++++++-=0A=201=20file=20changed,=2036=20= insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/gnu/packages/raspberry-pi.scm=20b/gnu/packages/raspberry-pi.scm=0A= index=20bb38b8b218..8949d2237a=20100644=0A---=20= a/gnu/packages/raspberry-pi.scm=0A+++=20b/gnu/packages/raspberry-pi.scm=0A= @@=20-1,5=20+1,6=20@@=0A=20;;;=20GNU=20Guix=20---=20Functional=20package=20= management=20for=20GNU=0A=20;;;=20Copyright=20=C2=A9=202020=20Danny=20= Milosavljevic=20=0A+;;;=20Copyright=20=C2=A9=20= 2021=20Stefan=20=0A=20;;;=0A=20;;;=20This=20= file=20is=20part=20of=20GNU=20Guix.=0A=20;;;=0A@@=20-25,9=20+26,10=20@@=0A= =20=20=20#:use-module=20(gnu=20packages=20commencement)=0A=20=20=20= #:use-module=20(gnu=20packages=20cross-base)=0A=20=20=20#:use-module=20= (gnu=20packages=20documentation)=0A+=20=20#:use-module=20(gnu=20packages=20= embedded)=0A=20=20=20#:use-module=20(gnu=20packages=20file)=0A=20=20=20= #:use-module=20(gnu=20packages=20gcc)=0A-=20=20#:use-module=20(gnu=20= packages=20embedded)=0A+=20=20#:use-module=20(gnu=20packages=20linux)=0A=20= =20=20#:use-module=20(guix=20build-system=20gnu)=0A=20=20=20#:use-module=20= (guix=20download)=0A=20=20=20#:use-module=20(guix=20git-download)=0A@@=20= -235,3=20+237,36=20@@=20Raspberry=20Pi.=20=20Note:=20It=20does=20not=20= work=20on=20Raspberry=20Pi=201.")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(install-file=20"arm64.bin"=20libexec)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20#t))))))))=0A=20=20=20=20=20(supported-systems=20= '("aarch64-linux"))))=0A+=0A+(define=20(make-raspi-defconfig=20arch=20= defconfig=20sha256-as-base32)=0A+=20=20"Make=20for=20the=20architecture=20= ARCH=20a=20file-like=20object=20from=20the=20DEFCONFIG=20file=0A+with=20= the=20hash=20SHA256-AS-BASE32.=20=20This=20object=20can=20be=20used=20as=20= the=20#:defconfig=0A+argument=20of=20the=20function=20(modify-linux)."=0A= +=20=20(make-defconfig=0A+=20=20=20(string-append=0A+=20=20=20=20;;=20= This=20is=20from=20commit=207838840=20on=20branch=20rpi-5.18.y,=0A+=20=20= =20=20;;=20see=20https://github.com/raspberrypi/linux/tree/rpi-5.18.y/=0A= +=20=20=20=20;;=20and=20= https://github.com/raspberrypi/linux/commit/7838840b5606a2051b31da4c598466= df7b1c3005=0A+=20=20=20=20= "https://raw.githubusercontent.com/raspberrypi/linux/7838840b5606a2051b31d= a4c598466df7b1c3005/arch/"=0A+=20=20=20=20arch=20"/configs/"=20= defconfig)=0A+=20=20=20sha256-as-base32))=0A+=0A+(define-public=20= %bcm2709-defconfig=0A+=20=20(make-raspi-defconfig=0A+=20=20=20"arm"=20= "bcm2709_defconfig"=0A+=20=20=20= "1hcxmsr131f92ay3bfglrggds8ajy904yj3vw7c42i4c66256a79"))=0A+=0A= +(define-public=20%bcm2711-defconfig=0A+=20=20(make-raspi-defconfig=0A+=20= =20=20"arm"=20"bcm2711_defconfig"=0A+=20=20=20= "1n7g5yq0hdp8lh0x6bfxph2ff8yn8zisdj3qg0gbn83j4v8i1zbd"))=0A+=0A= +(define-public=20%bcm2711-defconfig-64=0A+=20=20(make-raspi-defconfig=0A= +=20=20=20"arm64"=20"bcm2711_defconfig"=0A+=20=20=20= "0k9q7qvw826v2hrp49xnxnw93pnnkicwx869chvlf7i57461n4i7"))=0A+=0A= +(define-public=20%bcmrpi3-defconfig=0A+=20=20(make-raspi-defconfig=0A+=20= =20=20"arm64"=20"bcmrpi3_defconfig"=0A+=20=20=20= "1bfnl4p0ddx3200dg91kmh2pln36w95y05x1asc312kixv0jgd81"))=0A= --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Disposition: attachment; filename=07-gnu-raspberry-pi-add-helpers.patch Content-Type: application/octet-stream; name="07-gnu-raspberry-pi-add-helpers.patch" Content-Transfer-Encoding: 7bit gnu: raspberry-pi: Add helpers for config.txt file generation. From: Stefan * gnu/packages/raspberry-pi.scm (raspi-config-file, raspi-custom-txt): New functions. (%raspi-config-txt, %raspi-bcm27-dtb-txt, %raspi-bcm28-dtb-txt %raspi-u-boot-bootloader-txt): New variables. --- gnu/packages/raspberry-pi.scm | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gnu/packages/raspberry-pi.scm b/gnu/packages/raspberry-pi.scm index 8949d2237a..12a919d5c6 100644 --- a/gnu/packages/raspberry-pi.scm +++ b/gnu/packages/raspberry-pi.scm @@ -238,6 +238,59 @@ Raspberry Pi. Note: It does not work on Raspberry Pi 1.") #t)))))))) (supported-systems '("aarch64-linux")))) +(define-public (raspi-config-file name content) + "Make a configuration file like config.txt for the Raspberry Pi firmware. +CONTENT can be a list of strings, which are concatenated with a newline +character. Alternatively CONTENT can be a string with the full file content." + (plain-file + name + (if (list? content) + (string-join content "\n" 'suffix) + content))) + +(define-public %raspi-config-txt + ;; A config.txt file to start the ARM cores up in 64-bit mode if necessary + ;; and to include a dtb.txt, bootloader.txt, and a custom.txt, each with + ;; separated configurations for the Raspberry Pi firmware. + (raspi-config-file + "config.txt" + `("# See https://www.raspberrypi.org/documentation/configuration/config-txt/README.md for details." + "" + ,(string-append "arm_64bit=" (if (target-aarch64?) "1" "0")) + "include dtb.txt" + "include bootloader.txt" + "include custom.txt"))) + +(define-public %raspi-bcm27-dtb-txt + ;; A dtb.txt file to be included by the config.txt to ensure that the + ;; downstream device tree files bcm27*.dtb will be used. + (raspi-config-file + "dtb.txt" + "upstream_kernel=0")) + +(define-public %raspi-bcm28-dtb-txt + ;; A dtb.txt file to be included by the config.txt to ensure that the + ;; upstream device tree files bcm28*.dtb will be used. + ;; This also implies the use of the dtoverlay=upstream. + (raspi-config-file + "dtb.txt" + "upstream_kernel=1")) + +(define-public %raspi-u-boot-bootloader-txt + ;; A bootloader.txt file to be included by the config.txt to load the + ;; U-Boot bootloader. + (raspi-config-file + "bootloader.txt" + '("dtoverlay=upstream" + "enable_uart=1" + "kernel=u-boot.bin"))) + +(define-public (raspi-custom-txt content) + "Make a custom.txt file for the Raspberry Pi firmware. +CONTENT can be a list of strings, which are concatenated with a newline +character. Alternatively CONTENT can be a string with the full file content." + (raspi-config-file "custom.txt" content)) + (define (make-raspi-defconfig arch defconfig sha256-as-base32) "Make for the architecture ARCH a file-like object from the DEFCONFIG file with the hash SHA256-AS-BASE32. This object can be used as the #:defconfig --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Disposition: attachment; filename=08-gnu-raspberry-pi-new-function.patch Content-Type: application/octet-stream; name="08-gnu-raspberry-pi-new-function.patch" Content-Transfer-Encoding: 7bit gnu: raspberry-pi: New function to make a package with device-tree files. From: Stefan * gnu/packages/raspberry-pi.scm (make-raspi-bcm28-dtbs): New function to make a package with device-tree files for Raspberry Pi models from the kernel given as argument. --- gnu/packages/raspberry-pi.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/raspberry-pi.scm b/gnu/packages/raspberry-pi.scm index 12a919d5c6..92f5d22677 100644 --- a/gnu/packages/raspberry-pi.scm +++ b/gnu/packages/raspberry-pi.scm @@ -30,6 +30,7 @@ #:use-module (gnu packages file) #:use-module (gnu packages gcc) #:use-module (gnu packages linux) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix download) #:use-module (guix git-download) @@ -291,6 +292,26 @@ CONTENT can be a list of strings, which are concatenated with a newline character. Alternatively CONTENT can be a string with the full file content." (raspi-config-file "custom.txt" content)) +(define-public (make-raspi-bcm28-dtbs linux) + "Make a package with the device-tree files for Raspberry Pi models from the +kernel LINUX." + (package + (inherit linux) + (name "raspi-bcm28-dtbs") + (source #f) + (build-system copy-build-system) + (arguments + `(#:phases (modify-phases %standard-phases (delete 'unpack)) + #:install-plan + (list (list (string-append (assoc-ref %build-inputs "linux") + "/lib/dtbs/broadcom/") + "." #:include-regexp '("/bcm....-rpi.*\\.dtb"))))) + (inputs `(("linux" ,linux))) + (synopsis "Device-tree files for a Raspberry Pi") + (description + (simple-format #f "The device-tree files for Raspberry Pi models from ~a." + (package-name linux))))) + (define (make-raspi-defconfig arch defconfig sha256-as-base32) "Make for the architecture ARCH a file-like object from the DEFCONFIG file with the hash SHA256-AS-BASE32. This object can be used as the #:defconfig --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3 Content-Disposition: attachment; filename=09-gnu-raspberry-pi-add-a.patch Content-Type: application/octet-stream; name="09-gnu-raspberry-pi-add-a.patch" Content-Transfer-Encoding: 7bit gnu: raspberry-pi: Add a bootloader-chain for the Raspberry Pi and os examples. From: Stefan * gnu/packages/raspberry-pi.scm (grub-efi-bootloader-chain-raspi-64): New bootloader variable, capable to boot a Raspberry Pi over network or from a local storage. * gnu/system/examples/raspberry-pi-64.tmpl: New operating-system example. * gnu/system/examples/raspberry-pi-64-nfs-root.tmpl: New operating-system example for booting over network. --- gnu/packages/raspberry-pi.scm | 19 +++++ gnu/system/examples/raspberry-pi-64-nfs-root.tmpl | 74 ++++++++++++++++++++ gnu/system/examples/raspberry-pi-64.tmpl | 78 +++++++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 gnu/system/examples/raspberry-pi-64-nfs-root.tmpl create mode 100644 gnu/system/examples/raspberry-pi-64.tmpl diff --git a/gnu/packages/raspberry-pi.scm b/gnu/packages/raspberry-pi.scm index 92f5d22677..3d62b028ba 100644 --- a/gnu/packages/raspberry-pi.scm +++ b/gnu/packages/raspberry-pi.scm @@ -18,11 +18,14 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages raspberry-pi) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages algebra) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages bootloaders) #:use-module (gnu packages commencement) #:use-module (gnu packages cross-base) #:use-module (gnu packages documentation) @@ -312,6 +315,22 @@ kernel LINUX." (simple-format #f "The device-tree files for Raspberry Pi models from ~a." (package-name linux))))) +(define-public grub-efi-bootloader-chain-raspi-64 + ;; A bootloader capable to boot a Raspberry Pi over network via TFTP or from + ;; a local storage like a micro SD card. + ;; It neither installs firmware nor device-tree files for the Raspberry Pi. + ;; It just assumes them to be existing in boot/efi in the same way that some + ;; UEFI firmware with ACPI data is usually assumed to be existing on PCs. + ;; It creates firmware configuration files and a bootloader-chain with U-Boot + ;; to provide an EFI API for the final GRUB bootloader. + ;; It also serves as a blue-print to create an own bootloader-chain with + ;; firmwre and device-tree packages or files. + (efi-bootloader-chain grub-efi-netboot-removable-bootloader + #:packages (list u-boot-rpi-arm64-efi-bin) + #:files (list %raspi-config-txt + %raspi-bcm27-dtb-txt + %raspi-u-boot-bootloader-txt))) + (define (make-raspi-defconfig arch defconfig sha256-as-base32) "Make for the architecture ARCH a file-like object from the DEFCONFIG file with the hash SHA256-AS-BASE32. This object can be used as the #:defconfig diff --git a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl new file mode 100644 index 0000000000..c635f8e323 --- /dev/null +++ b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl @@ -0,0 +1,74 @@ +;; This is an operating-system configuration template of a +;; 64-bit minimal system for a Raspberry Pi with an NFS root file-system. + +;; It neither installs firmware nor device-tree files for the Raspberry Pi. +;; It just assumes them to be existing in boot/efi in the same way that some +;; UEFI firmware with ACPI data is usually assumed to be existing on PCs. + +;; It expects the boot/efi directory to be served via TFTP and the root +;; file-system to be served via NFS. See the grub-efi-netboot-bootloader +;; description in the manual for more details. + +(use-modules (gnu) + (gnu artwork) + (gnu system nss)) +(use-service-modules admin + avahi + networking + ssh) +(use-package-modules certs + linux + raspberry-pi + ssh) + +(define %my-public-key + (local-file (string-append (getenv "HOME") "/.ssh/id_ecdsa.pub"))) + +(define-public raspberry-pi-64-nfs-root + (operating-system + (host-name "raspberrypi-guix") + (timezone "Europe/Berlin") + (bootloader (bootloader-configuration + (bootloader grub-efi-bootloader-chain-raspi-64) + (targets (list "/boot/efi")) + (theme (grub-theme (resolution '(1920 . 1080)) + (image (file-append + %artwork-repository + "/grub/GuixSD-fully-black-16-9.svg")))))) + (kernel-arguments '("ip=dhcp")) + (kernel (modify-linux #:linux linux-libre-arm64-generic + #:extra-version "arm64-generic-netboot" + #:configs '("CONFIG_NFS_SWAP=y" + "CONFIG_USB_USBNET=y" + "CONFIG_USB_LAN78XX=y" + "CONFIG_USB_NET_SMSC95XX=y"))) + (initrd-modules '()) + (file-systems (cons* (file-system + (mount-point "/") + (type "nfs") + (device ":/export/raspberrypi/guix") + (options "addr=10.20.30.40,vers=4.1")) + %base-file-systems)) + (swap-devices (list (swap-space + (target "/run/swapfile")))) + (users (cons* (user-account + (name "pi") + (group "users") + (supplementary-groups '("wheel" "netdev" "audio" "video")) + (home-directory "/home/pi")) + %base-user-accounts)) + (packages (cons* nss-certs + openssh + %base-packages)) + (services (cons* (service avahi-service-type) + (service dhcp-client-service-type) + (service ntp-service-type) + (service openssh-service-type + (openssh-configuration + (x11-forwarding? #t) + (authorized-keys + `(("pi" ,%my-public-key))))) + %base-services)) + (name-service-switch %mdns-host-lookup-nss))) + +raspberry-pi-64-nfs-root diff --git a/gnu/system/examples/raspberry-pi-64.tmpl b/gnu/system/examples/raspberry-pi-64.tmpl new file mode 100644 index 0000000000..dd933252c5 --- /dev/null +++ b/gnu/system/examples/raspberry-pi-64.tmpl @@ -0,0 +1,78 @@ +;; This is an operating-system configuration template of a +;; 64-bit minimal system for a Raspberry Pi with local storage. + +;; It neither installs firmware nor device-tree files for the Raspberry Pi. +;; It just assumes them to be existing in boot/efi in the same way that some +;; UEFI firmware with ACPI data is usually assumed to be existing on PCs. + +;; It expects the boot-partition to be mounted as boot/efi in the same way +;; as it is usually expeted on PCs with UEFI firmware. + +(use-modules (gnu) + (gnu artwork) + (gnu system nss)) +(use-service-modules admin + avahi + networking + ssh) +(use-package-modules certs + linux + raspberry-pi + ssh) + +(define %my-public-key + (local-file (string-append (getenv "HOME") "/.ssh/id_ecdsa.pub"))) + +(define-public raspberry-pi-64 + (operating-system + (host-name "raspberrypi-guix") + (timezone "Europe/Berlin") + (bootloader (bootloader-configuration + (bootloader grub-efi-bootloader-chain-raspi-64) + (targets (list "/boot/efi")) + (theme (grub-theme (resolution '(1920 . 1080)) + (image (file-append + %artwork-repository + "/grub/GuixSD-fully-black-16-9.svg")))))) + (kernel (modify-linux #:linux linux-libre-arm64-generic + #| It is possible to use a specific defconfig file, + for example the "bcmrpi3_defconfig" with the + variable shown below. Unfortunately the kernel + build from the linux-libre sources with this + defconfig file does not boot. + #:extra-version "gnu-bcmrpi3" + #:defconfig %bcmrpi3-defconfig + |#)) + (initrd-modules '()) + (file-systems (cons* (file-system + (mount-point "/") + (type "ext4") + (device (file-system-label "Guix"))) + (file-system + (mount-point "/boot/efi") + (type "vfat") + (device (file-system-label "EFI"))) + %base-file-systems)) + (swap-devices (list (swap-space + (target "/run/swapfile")))) + (users (cons* (user-account + (name "pi") + (group "users") + (supplementary-groups '("wheel" "netdev" "audio" "video")) + (home-directory "/home/pi")) + %base-user-accounts)) + (packages (cons* nss-certs + openssh + %base-packages)) + (services (cons* (service avahi-service-type) + (service dhcp-client-service-type) + (service ntp-service-type) + (service openssh-service-type + (openssh-configuration + (x11-forwarding? #t) + (authorized-keys + `(("pi" ,%my-public-key))))) + %base-services)) + (name-service-switch %mdns-host-lookup-nss))) + +raspberry-pi-64 --Apple-Mail=_399177BD-9940-46EF-A69B-140091BA80A3--