From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 31 18:07:35 2021 Received: (at 48314) by debbugs.gnu.org; 31 Oct 2021 22:07:35 +0000 Received: from localhost ([127.0.0.1]:33243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhIzH-0005Sf-Ok for submit@debbugs.gnu.org; Sun, 31 Oct 2021 18:07:35 -0400 Received: from smtpout2.vodafonemail.de ([145.253.239.133]:34068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhIzF-0005SO-T5 for 48314@debbugs.gnu.org; Sun, 31 Oct 2021 18:07:34 -0400 Received: from smtp.vodafone.de (smtpa07.fra-mediabeam.com [10.2.0.38]) by smtpout2.vodafonemail.de (Postfix) with ESMTP id C397A616E2; Sun, 31 Oct 2021 23:07:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-smtpout-mb-15sep; t=1635718031; bh=gr6sMolYwftUkWc7AIKLt3y7TrXMj+TNDKOb67LKOHg=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=BHCUdqv5FxG9SYdybjiXxO5HsDiKVDpERKJ+RlNHDmnnKUtOVattmtamO1HgKdBWe OG6Y2mGEZMLsGdryxT2Vn3wGZWBRa4FDYXPGfttkJMu5yPCLMmOOs+PpCmGqiS97nm /TS/LDKO7v7CAnEjNW5vvDzqgLoT3FIpvgihahy0= Received: from macbook-pro.kuh-wiese.my-router.de (dialin-145-254-041-056.pools.arcor-ip.net [145.254.41.56]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4Hj9Hz0zM0zFpVS; Sun, 31 Oct 2021 22:07:10 +0000 (UTC) Content-Type: multipart/mixed; boundary="Apple-Mail=_B617970F-0E65-4178-8B28-B9F0969B3830" Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [bug#48314] Patches to install guix system on Raspberry Pi From: Stefan In-Reply-To: Date: Sun, 31 Oct 2021 23:07:09 +0100 Message-Id: References: <20210619211026.5eb44073@scratchpost.org> <897B7FF7-24C1-4B96-8441-415596267E99@vodafonemail.de> To: 48314@debbugs.gnu.org X-Mailer: Apple Mail (2.3124) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 128468 X-purgate-ID: 149169::1635718031-000039E6-967F771E/0/0 X-Debbugs-Envelope-To: 48314 Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" --Apple-Mail=_B617970F-0E65-4178-8B28-B9F0969B3830 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi! I did a rebase of the patch series to avoid bit-rotting. One patch got = obsolete meanwhile. This series applies on GIT commit = 1a80b8909a521b91d30649a011b0257d0fadc18c. Bye Stefan --Apple-Mail=_B617970F-0E65-4178-8B28-B9F0969B3830 Content-Disposition: attachment; filename=01-gnu-bootloader-rework-chaining Content-Type: application/octet-stream; name="01-gnu-bootloader-rework-chaining" 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=2024=20+++-=0A=20gnu/bootloader.scm=20=20=20=20=20=20=20=20=20= =20=20|=20=20104=20+++++++++---------=0A=20gnu/bootloader/grub.scm=20=20=20= =20=20=20|=20=20241=20++++++++++++++++++++++++++----------------=0A=20= gnu/packages/bootloaders.scm=20|=20=20=2090=20++++++++++++++++=0A=204=20= files=20changed,=20308=20insertions(+),=20151=20deletions(-)=0A=0Adiff=20= --git=20a/doc/guix.texi=20b/doc/guix.texi=0Aindex=20= ea1973f02c..1dad33cfae=20100644=0A---=20a/doc/guix.texi=0A+++=20= b/doc/guix.texi=0A@@=20-33853,8=20+33853,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{extlinux-bootloader}=20and=0A-@code{u-boot-bootloader}=20are=20= supported.=0A+@code{grub-efi-netboot-bootloader},=0A= +@code{grub-efi-netboot-removable-bootloader},=0A= +@code{extlinux-bootloader}=20and=20@code{u-boot-bootloader}=20are=20= supported.=0A=20=0A=20@cindex=20ARM,=20bootloaders=0A=20@cindex=20= AArch64,=20bootloaders=0A@@=20-33880,9=20+33881,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-33916,13=20+33918,23=20@@=20directory=20to=20your=20= @code{targets}.=0A=20It=20is=20important=20to=20note=20that=20symlinks=20= pointing=20outside=20the=20TFTP=20root=20directory=0A=20may=20need=20to=20= be=20allowed=20in=20the=20configuration=20of=20your=20TFTP=20server.=20=20= Further=20the=0A=20store=20link=20exposes=20the=20whole=20store=20= through=20TFTP@.=20=20Both=20points=20need=20to=20be=0A-considered=20= carefully=20for=20security=20aspects.=0A+considered=20carefully=20for=20= security=20aspects.=20=20It=20is=20advised=20to=20disable=20any=20TFTP=0A= +write=20access!=0A+=0A+Please=20note,=20that=20this=20bootloader=20will=20= not=20modify=20the=20=E2=80=98UEFI=20Boot=20Manager=E2=80=99=20of=0A+the=20= system.=0A=20=0A=20Beside=20the=20@code{grub-efi-netboot-bootloader},=20= the=20already=20mentioned=20TFTP=20and=0A=20NFS=20servers,=20you=20also=20= need=20a=20properly=20configured=20DHCP=20server=20to=20make=20the=20= booting=0A=20over=20netboot=20possible.=20=20For=20all=20this=20we=20can=20= currently=20only=20recommend=20you=20to=20look=0A=20for=20instructions=20= about=20@acronym{PXE,=20Preboot=20eXecution=20Environment}.=0A=20=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+=0A=20@item=20@code{targets}=0A=20This=20is=20a=20= list=20of=20strings=20denoting=20the=20targets=20onto=20which=20to=20= install=20the=0A=20bootloader.=0Adiff=20--git=20a/gnu/bootloader.scm=20= b/gnu/bootloader.scm=0Aindex=20d1c72c0c85..cddb8daf93=20100644=0A---=20= a/gnu/bootloader.scm=0A+++=20b/gnu/bootloader.scm=0A@@=20-261,26=20= +261,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=20= such=20bootloader~%")=20name)))=0A=20=0A-(define=20= (efi-bootloader-profile=20files=20bootloader-package=20hooks)=0A-=20=20= "Creates=20a=20profile=20with=20BOOTLOADER-PACKAGE=20and=20a=20directory=20= collection/=20with=0A-links=20to=20additional=20FILES=20from=20the=20= store.=20=20This=20collection=20is=20meant=20to=20be=20used=0A-by=20the=20= bootloader=20installer.=0A+(define=20(efi-bootloader-profile=20packages=20= files=20hooks)=0A+=20=20"Creates=20a=20profile=20from=20the=20lists=20of=20= PACKAGES=20and=20FILES=20from=20the=20store.=0A+This=20profile=20is=20= meant=20to=20be=20used=20by=20the=20bootloader-installer.=0A=20=0A=20= FILES=20is=20a=20list=20of=20file=20or=20directory=20names=20from=20the=20= store,=20which=20will=20be=0A-symlinked=20into=20the=20collection/=20= directory.=20=20If=20a=20directory=20name=20ends=20with=20'/',=0A-then=20= the=20directory=20content=20instead=20of=20the=20directory=20itself=20= will=20be=20symlinked=0A-into=20the=20collection/=20directory.=0A= +symlinked=20into=20the=20profile.=20=20If=20a=20directory=20name=20ends=20= with=20'/',=20then=20the=0A+directory=20content=20instead=20of=20the=20= directory=20itself=20will=20be=20symlinked=20into=20the=0A+profile.=0A=20= =0A-FILES=20may=20contain=20file=20like=20objects=20produced=20by=20= functions=20like=20plain-file,=0A+FILES=20may=20contain=20file=20like=20= objects=20produced=20by=20procedures=20like=20plain-file,=0A=20= local-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-304,7=20+300,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-313,11=20+309,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= -325,57=20+321,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=20d8e888ff40..2235363c6d=20100644=0A= ---=20a/gnu/bootloader/grub.scm=0A+++=20b/gnu/bootloader/grub.scm=0A@@=20= -50,11=20+50,12=20@@=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-theme-color-highlight=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= 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-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-346,7=20+347,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-376,27=20= +377,27=20@@=20when=20booting=20a=20root=20file=20system=20on=20a=20= Btrfs=20subvolume."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (initrd=20(normalize-file=20(menu-entry-initrd=20entry)=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=20device-mount-point=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=20store-directory-prefix)))=0A-=20=20=20=20=20=20= =20=20=20;;=20Here=20DEVICE=20is=20the=20store=20and=20= DEVICE-MOUNT-POINT=20is=20its=20mount=20point.=0A-=20=20=20=20=20=20=20=20= =20;;=20Use=20the=20right=20file=20names=20for=20LINUX=20and=20INITRD=20= in=20case=0A-=20=20=20=20=20=20=20=20=20;;=20DEVICE-MOUNT-POINT=20is=20= not=20"/",=20meaning=20that=20the=20store=20is=20on=20a=0A-=20=20=20=20=20= =20=20=20=20;;=20separate=20partition.=0A-=0A-=20=20=20=20=20=20=20=20=20= ;;=20When=20BTRFS-SUBVOLUME-FILE-NAME=20is=20defined,=20prepend=20it=20= the=20linux=20and=0A-=20=20=20=20=20=20=20=20=20;;=20initrd=20paths,=20= to=20allow=20booting=20from=20a=20Btrfs=20subvolume.=0A-=20=20=20=20=20=20= =20=20=20#~(format=20port=20"menuentry=20~s=20{=0A+=20=20=20=20=20=20=20=20= =20=20=20=20;;=20Here=20DEVICE=20is=20the=20store=20and=20= DEVICE-MOUNT-POINT=20is=20its=20mount=20point.=0A+=20=20=20=20=20=20=20=20= =20=20=20=20;;=20Use=20the=20right=20file=20names=20for=20LINUX=20and=20= INITRD=20in=20case=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20= DEVICE-MOUNT-POINT=20is=20not=20"/",=20meaning=20that=20the=20store=20is=20= on=20a=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20separate=20partition.=0A= +=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20When=20= BTRFS-SUBVOLUME-FILE-NAME=20is=20defined,=20prepend=20it=20the=20linux=20= and=0A+=20=20=20=20=20=20=20=20=20=20=20=20;;=20initrd=20paths,=20to=20= allow=20booting=20from=20a=20Btrfs=20subvolume.=0A+=20=20=20=20=20=20=20=20= =20=20=20=20#~(format=20port=20"menuentry=20~s=20{=0A=20=20=20~a=0A=20=20= =20linux=20~a=20~a=0A=20=20=20initrd=20~a=0A=20}~%"=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20#$label=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20#$(grub-root-search=20device=20linux)=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#$linux=20= (string-join=20(list=20#$@arguments))=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20#$initrd))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20#$label=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20#$(grub-root-search=20device=20linux)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= #$linux=20(string-join=20(list=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#$initrd))=0A=20=20=20=20=20=20= =20=20=20=20=20(let=20((kernel=20(menu-entry-multiboot-kernel=20entry))=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(arguments=20= (menu-entry-multiboot-arguments=20entry))=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(modules=20(menu-entry-multiboot-modules=20entry))=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(root-index=201))=20=20= =20=20=20=20=20=20=20=20=20=20;=20XXX=20EFI=20will=20need=20root-index=20= 2=0A-=20=20=20=20=20=20=20=20#~(format=20port=20"=0A+=20=20=20=20=20=20=20= =20=20=20=20=20#~(format=20port=20"=0A=20menuentry=20~s=20{=0A=20=20=20= multiboot=20~a=20root=3Ddevice:hd0s~a~a~a=0A=20}~%"=0A@@=20-434,9=20= +435,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=20= entry))=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-462,8=20+461,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-514,6=20+511,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-607,42=20= +614,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"--bootloader-id=3DGuix"=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"=20= target-esp)))))=0A=20=0A-(define=20(install-grub-efi-netboot=20subdir)=0A= -=20=20"Define=20a=20grub-efi-netboot=20bootloader=20installer=20for=20= installation=20in=20SUBDIR,=0A-which=20is=20usually=20efi/Guix=20or=20= efi/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-652,17=20+648,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-672,34=20+669,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-717,7=20+758,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-727,17=20+768,29=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= -(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=20706ddf0207..601912011b=20100644=0A= ---=20a/gnu/packages/bootloaders.scm=0A+++=20= b/gnu/packages/bootloaders.scm=0A@@=20-15,6=20+15,7=20@@=0A=20;;;=20= Copyright=20=C2=A9=202020,=202021=20Pierre=20Langlois=20= =0A=20;;;=20Copyright=20=C2=A9=202021=20Vincent=20= Legoll=20=0A=20;;;=20Copyright=20=C2=A9=202021=20= Brice=20Waegeneire=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-66,13=20+67,17=20@@=0A= =20=20=20#:use-module=20(gnu=20packages=20virtualization)=0A=20=20=20= #:use-module=20(gnu=20packages=20xorg)=0A=20=20=20#:use-module=20(guix=20= build-system=20gnu)=0A+=20=20#:use-module=20(guix=20build-system=20= trivial)=0A=20=20=20#:use-module=20(guix=20download)=0A+=20=20= #:use-module=20(guix=20gexp)=0A=20=20=20#:use-module=20(guix=20= git-download)=0A=20=20=20#:use-module=20((guix=20licenses)=20#:prefix=20= license:)=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=20srfi-1)=0A= =20=20=20#:use-module=20(srfi=20srfi-26)=0A+=20=20#:use-module=20(ice-9=20= match)=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-366,6=20+371,91=20= @@=20menu=20to=20select=20one=20of=20the=20installed=20operating=20= systems.")=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=20= name=20subdir)=0A+=20=20"Make=20a=20grub-efi-netboot=20package=20named=20= NAME,=20which=20will=20be=20able=20to=20boot=20over=0A+network=20via=20= TFTP=20by=20accessing=20its=20files=20in=20the=20SUBDIR=20of=20a=20TFTP=20= root=20directory.=0A+This=20package=20is=20also=20able=20to=20boot=20= from=20local=20storage=20devices.=0A+=0A+A=20bootloader-installer=20= basically=20needs=20to=20copy=20the=20package=20content=20into=20the=0A= +bootloader-target=20directory,=20which=20will=20usually=20be=20the=20= TFTP=20root,=20as=0A+'grub-mknetdir'=20will=20be=20invoked=20already=20= during=20the=20package=20creation.=0A+=0A+Alternatively=20the=20= bootloader-target=20directory=20can=20be=20a=20mounted=20EFI=20System=0A= +Partition=20(ESP),=20or=20a=20similar=20partition=20with=20a=20FAT=20= file=20system,=20for=20booting=0A+from=20local=20storage=20devices.=0A+=0A= +The=20name=20of=20the=20GRUB=20EFI=20binary=20will=20conform=20to=20the=20= UEFI=20specification=20for=0A+removable=20media.=20=20Depending=20on=20= the=20system=20it=20will=20be=20e.g.=20bootx64.efi=20or=0A+bootaa64.efi=20= below=20SUBDIR.=0A+=0A+The=20SUBDIR=20argument=20needs=20to=20be=20set=20= to=20\"efi/boot\"=20to=20create=20a=20package=20which=0A+conforms=20to=20= the=20UEFI=20specification=20for=20removable=20media.=0A+=0A+The=20= SUBDIR=20argument=20defaults=20to=20\"efi/Guix\",=20as=20it=20is=20also=20= the=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;;=20Source=20is=20not=20needed,=20but=20it=20cannot=20be=20= omitted.=0A+=20=20=20=20(source=20#f)=0A+=20=20=20=20(build-system=20= trivial-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=20system=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= These=20are=20the=20supportend=20systems=20and=20the=20names=20defined=20= by=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20the=20UEFI=20= standard=20for=20removable=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=_B617970F-0E65-4178-8B28-B9F0969B3830 Content-Disposition: attachment; filename=02-build-kconfig-add-new-module Content-Type: application/octet-stream; name="02-build-kconfig-add-new-module" Content-Transfer-Encoding: quoted-printable build:=20kconfig:=20Add=20new=20module=20to=20modify=20a=20defconfig=20= file.=0A=0AFrom:=20Stefan=20=0A=0A*=20= guix/build/kconfig.scm=20(modify-defconfig):=20New=20file=20with=20a=20= new=20function.=0A*=20gnu/packages/bootloaders.scm=20= (make-u-boot-package,=0Amake-u-boot-sunxi64-package):=20Adding=20new=20= key=20arguments=20to=20pass=20and/or=20modify=0Aa=20defconfig=20file.=0A= (u-boot-am335x-boneblack,=20u-boot-pinebook,=20u-boot-novena):=20= Simplify=20functions=0Aby=20using=20the=20new=20key=20arguments=20of=20= the=20former=20functions.=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=20=2087=20+++++++++++--------------=0A= =20guix/build/kconfig.scm=20=20=20=20=20=20=20|=20=20148=20= ++++++++++++++++++++++++++++++++++++++++++=0A=203=20files=20changed,=20= 186=20insertions(+),=2050=20deletions(-)=0A=20create=20mode=20100644=20= guix/build/kconfig.scm=0A=0Adiff=20--git=20a/Makefile.am=20b/Makefile.am=0A= index=20d608b08899..06cceebf07=20100644=0A---=20a/Makefile.am=0A+++=20= b/Makefile.am=0A@@=20-221,6=20+221,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=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=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=20601912011b..3bc5600c7c=20100644=0A= ---=20a/gnu/packages/bootloaders.scm=0A+++=20= b/gnu/packages/bootloaders.scm=0A@@=20-733,8=20+733,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-752,8=20+753,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-764,9=20+768,18=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(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=20name.=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-820,7=20+833,11=20@@=20= board-independent=20tools.")))=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-829,25=20+846,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-877,20=20+882,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-941,25=20+936,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= '("CONFIG_SPL_FS_FAT=3D"))))=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=20= a=20bootloader=20used=20mostly=20for=20ARM=20boards.=20It=0A=20also=20= initializes=20the=20boards=20(RAM=20etc).=0A=20=0A=20This=20U-Boot=20is=20= built=20for=20Novena.=20=20Be=20advised=20that=20this=20version,=20= contrary=0A-to=20Novena=20upstream,=20does=20not=20load=20u-boot.img=20= from=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=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-novena-defconfig=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20;;=20Patch=20configuration=20to=20disable=20= loading=20u-boot.img=20from=20FAT=20partition,=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20allowing=20it=20to=20be=20installed=20at=20a=20= device=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=20= not=20set"))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= #t)))))))))=0A+to=20Novena=20upstream,=20does=20not=20load=20u-boot.img=20= from=20the=20first=20partition."))))=0A=20=0A=20(define-public=20= u-boot-cubieboard=0A=20=20=20(make-u-boot-package=20"Cubieboard"=20= "arm-linux-gnueabihf"))=0Adiff=20--git=20a/guix/build/kconfig.scm=20= b/guix/build/kconfig.scm=0Anew=20file=20mode=20100644=0Aindex=20= 0000000000..09ddf59dd0=0A---=20/dev/null=0A+++=20= b/guix/build/kconfig.scm=0A@@=20-0,0=20+1,148=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+=0A+;;=20Commentary:=0A+;;=0A+;;=20Builder-side=20= code=20to=20modify=20configurations=20for=20the=20Kconfig=20build=20= system=20as=0A+;;=20used=20by=20Linux=20and=20U-Boot.=0A+;;=0A+;;=20= Code:=0A+=0A+(define=20(modify-defconfig=20defconfig=20configs)=0A+=20=20= "This=20function=20can=20modify=20a=20given=20DEFCONFIG=20file=20by=20= adding,=20changing=20or=0A+removing=20the=20list=20of=20strings=20in=20= CONFIGS.=20=20This=20allows=20an=20easy=20customization=20of=0A+Kconfig=20= based=20projects=20like=20the=20kernel=20Linux=20or=20the=20bootloader=20= 'Das=20U-Boot'.=0A+=0A+These=20are=20examples=20for=20CONFIGS=20to=20add=20= or=20change=20or=20remove=0A+configurations=20to/from=20DEFCONFIG:=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\"CONFIG_F\"=0A+=20=20\"#=20CONFIG_G=20is=20not=20set\")=0A+=0A= +Instead=20of=20a=20list,=20CONFGIS=20can=20be=20a=20string=20with=20one=20= configuration=20per=20line."=0A+=20=20(define=20config-rx=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;;=20= pattern=20"=3D(.+)?"=20makes=20it=20return=20#f=20instead.=20=20For=20a=20= "CONFIG_A=3D"=20we=20like=0A+=20=20=20=20=20;;=20to=20get=20#f,=20which=20= as=20a=20value=20emits=20"#=20=E2=80=A6=20is=20not=20set".=0A+=20=20=20=20= =20"^(#[\\t=20]*)?(CONFIG_[A-Z0-9_]+)([\\t=20]*=3D[\\t=20]*(.+)?|([\\t=20= ]+is[\\t=20]+not[\\t=20]+set))?$"))=0A+=0A+=20=20(define=20= (config-string->pair=20config-string)=0A+=20=20=20=20"Parse=20a=20= config-string=20like=20\"CONFIG_EXAMPLE=3Dy\"=20into=20a=20key-value=20= pair.=0A+Spaces=20get=20trimmed.=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#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+\"#=20CONFIG_E=20is=20not=20= set\"=20->=20'(\"CONFIG_E\"=20.=20#f)=0A+\"#=20Anything=20else\"=20=20=20= =20=20=20=20->=20'(\"#=20Anything=20else\"=20.=20\"\")"=0A+=20=20=20=20= (let=20((match=20(regexp-exec=20config-rx=20(string-trim-both=20= config-string))))=0A+=20=20=20=20=20=20(if=20(not=20match)=0A+=20=20=20=20= =20=20=20=20=20=20;;=20This=20is=20some=20unparsable=20config-string.=0A= +=20=20=20=20=20=20=20=20=20=20;;=20We=20keep=20it=20as=20it=20is.=0A+=20= =20=20=20=20=20=20=20=20=20(cons=20config-string=20"")=0A+=20=20=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=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=20=20(unset=20= (match:substring=20match=205))=0A+=20=20=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=20=20(not=20= unset)=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(match:substring=20match=204))))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20(if=20(or=20(and=20comment=20(not=20unset))=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= comment)=20unset))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= This=20is=20just=20some=20comment=20or=20strange=20line,=20which=20we=20= keep=20as=20is.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cons=20= config-string=20"")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cons=20key=20value))))))=0A+=0A+=20=20(define=20(pair->config-string=20= pair)=0A+=20=20=20=20"Convert=20a=20PAIR=20back=20to=20a=20= config-string."=0A+=20=20=20=20(let*=20((key=20(car=20pair))=0A+=20=20=20= =20=20=20=20=20=20=20=20(value=20(cdr=20pair)))=0A+=20=20=20=20=20=20(if=20= (string?=20value)=0A+=20=20=20=20=20=20=20=20=20=20(if=20(string-null?=20= value)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20key=0A+=20=20=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(string-append=20"#=20"=20key=20"=20is=20not=20= set"))))=0A+=0A+=20=20(define=20(remove-pair=20pair=20blacklist)=0A+=20=20= =20=20"Turn=20a=20key-value=20PAIR=20into=20'(""=20.=20""),=20if=20its=20= key=20is=20listed=20in=20BLACKLIST."=0A+=20=20=20=20(let*=20((key=20= (first=20pair)))=0A+=20=20=20=20=20=20(if=20(member=20key=20blacklist)=0A= +=20=20=20=20=20=20=20=20=20=20'(""=20.=20"")=0A+=20=20=20=20=20=20=20=20= =20=20pair)))=0A+=0A+=20=20(define=20(remove-config-string=20= config-string=20blacklist)=0A+=20=20=20=20"Remove=20the=20CONFIG-STRING,=20= if=20its=20key=20is=20listed=20in=20BLACKLIST."=0A+=20=20=20=20= (pair->config-string=20(remove-pair=20(config-string->pair=20= config-string)=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=20blacklist)))=0A= +=0A+=20=20(define*=20(write-lines=20input=20#:key=20(line-modifier=20= identity))=0A+=20=20=20=20"Write=20all=20lines=20from=20the=20INPUT=20= after=20applying=20the=20LINE-MODIFIER=20to=20the=0A+=20= current-output-port."=0A+=20=20=20=20(let=20loop=20((line=20(read-line=20= input)))=0A+=20=20=20=20=20=20(when=20(not=20(eof-object?=20line))=0A+=20= =20=20=20=20=20=20=20(display=20(line-modifier=20line))=0A+=20=20=20=20=20= =20=20=20(newline)=0A+=20=20=20=20=20=20=20=20(loop=20(read-line=20= input)))))=0A+=0A+=20=20(let*=20((modified-defconfig=20(string-append=20= defconfig=20".mod"))=0A+=20=20=20=20=20=20=20=20=20;;=20Split=20the=20= configs=20into=20a=20list=20of=20single=20configuations.=0A+=20=20=20=20=20= =20=20=20=20;;=20To=20minimize=20mistakes,=20we=20support=20a=20string=20= and=20a=20list=20of=20strings,=0A+=20=20=20=20=20=20=20=20=20;;=20each=20= with=20newlines=20to=20separate=20configurations.=0A+=20=20=20=20=20=20=20= =20=20(config-list=20(fold-right=20append=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(map=20(lambda=20(s)=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= (string-split=20s=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(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(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=20configs))))=0A+=20=20=20=20=20=20=20=20=20;;=20Generate=20= key-value=20pairs=20from=20the=20config-list.=0A+=20=20=20=20=20=20=20=20= =20(pairs=20(map=20(lambda=20(config-string)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(config-string->pair=20= config-string))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20config-list))=0A+=20=20=20=20=20=20=20=20=20;;=20Generate=20a=20= blacklist=20of=20config=20keys=20from=20pairs.=0A+=20=20=20=20=20=20=20=20= =20(blacklist=20(map=20(lambda=20(config-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(first=20= config-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=20pairs))=0A+=20=20=20=20=20=20=20=20=20= (remove-config-string=20(cut=20remove-config-string=20<>=20blacklist)))=0A= +=20=20=20=20;;=20Write=20to=20the=20modified-defconfig=20file=20first=20= the=20content=20of=20the=20defconfig=0A+=20=20=20=20;;=20file=20with=20= removed=20lines,=20and=20afterwards=20the=20configs.=0A+=20=20=20=20= (call-with-output-file=20modified-defconfig=0A+=20=20=20=20=20=20(lambda=20= (output)=0A+=20=20=20=20=20=20=20=20(with-output-to-port=20output=0A+=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(call-with-input-file=20defconfig=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(lambda=20(input)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(write-lines=20input=20#:=20line-modifier=20remove-config-string)))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20(call-with-input-string=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(string-join=20(map=20= pair->config-string=20pairs)=20"\n")=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(lambda=20(input)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(write-lines=20input)))))))=0A+=20=20=20=20;;=20Ensure=20the=20= modified-defconfig=20file=20is=20used.=0A+=20=20=20=20(delete-file=20= defconfig)=0A+=20=20=20=20(rename-file=20modified-defconfig=20= defconfig)))=0A= --Apple-Mail=_B617970F-0E65-4178-8B28-B9F0969B3830 Content-Disposition: attachment; filename=03-gnu-bootloader-add-u-boot Content-Type: application/octet-stream; name="03-gnu-bootloader-add-u-boot" 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' and 'description'. (make-preinstalled-u-boot-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-0-w, u-boot-rpi, u-boot-rpi-2, u-boot-rpi-3, u-boot-rpi-4, u-boot-rpi-64, u-boot-rpi-0-w-efi, u-boot-rpi-efi, u-boot-rpi-2-efi, u-boot-rpi-3-efi, u-boot-rpi-4-efi, u-boot-rpi-efi-64): New packages. --- gnu/packages/bootloaders.scm | 172 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 168 insertions(+), 4 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 3bc5600c7c..5121f3a6ea 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -733,17 +733,30 @@ def test_ctrl_c")) also initializes the boards (RAM etc). This package provides its board-independent tools."))) -(define*-public (make-u-boot-package board triplet #:key defconfig configs) +(define*-public (make-u-boot-package board + triplet + #:key + defconfig + configs + name + description) "Returns a u-boot package for BOARD cross-compiled for TRIPLET with the -optional DEFCONFIG file and optional configuration changes from CONFIGS." +optional DEFCONFIG file and optional configuration changes from CONFIGS. +Either NAME, if used, or otherwise BOARD will be part of the package name. +DESCRIPTION will be appended to the package description." (let ((same-arch? (lambda () (string=? (%current-system) (gnu-triplet->nix-system triplet))))) (package (inherit u-boot) (name (string-append "u-boot-" - (string-replace-substring (string-downcase board) - "_" "-"))) + (string-replace-substring + (string-downcase (or name board)) + "_" "-"))) + (description (if description + (string-append (package-description u-boot) + "\n" description) + (package-description u-boot))) (native-inputs `(,@(if (not (same-arch?)) `(("cross-gcc" ,(cross-gcc triplet)) @@ -1071,6 +1084,157 @@ to Novena upstream, does not load u-boot.img from the first partition.")))) `(("firmware" ,arm-trusted-firmware-rk3399) ,@(package-native-inputs base)))))) +(define*-public (make-preinstalled-u-boot-package board + triplet + #:key + defconfig + configs + name + description + (u-boot-file "u-boot.bin")) + "Returns a package with a single U-BOOT-FILE for BOARD cross-compiled for +TRIPLET with the optional DEFCONFIG file and optional configuration changes +from CONFIGS. Either NAME, if used, or otherwise BOARD will be part of the +package name. DESCRIPTION will be appended to the package description." + (let* ((name-suffix "-complete") + (u-boot-package (make-u-boot-package board + triplet + #:defconfig defconfig + #:configs configs + #:name (string-append + (or name board) + name-suffix) + #:description description))) + (package + (name (string-drop-right (package-name u-boot-package) + (string-length name-suffix))) + (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-file) + (string-append out "/" ,u-boot-file)))))) + (inputs `(("u-boot" ,u-boot-package))) + (home-page (package-home-page u-boot-package)) + (synopsis (package-synopsis u-boot-package)) + (description (package-description u-boot-package)) + (license (package-license u-boot-package))))) + +(define-public %u-boot-rpi-efi-configs + '("CONFIG_OF_EMBED=" + "CONFIG_OF_BOARD=y" + "CONFIG_BOOTDELAY=0")) + +(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-0-w + (make-preinstalled-u-boot-package + "rpi_0_w" + "arm-linux-gnueabihf" + #:description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi + (make-preinstalled-u-boot-package + "rpi" + "arm-linux-gnueabihf" + #:description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-2 + (make-preinstalled-u-boot-package + "rpi_2" + "arm-linux-gnueabihf" + #:description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-3 + (make-preinstalled-u-boot-package + "rpi_3_32b" + "arm-linux-gnueabihf" + #:name "rpi-3" + #:description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-4 + (make-preinstalled-u-boot-package + "rpi_4_32b" + "arm-linux-gnueabihf" + #:name "rpi-4" + #:description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-64 + (make-preinstalled-u-boot-package + "rpi_arm64" + "aarch64-linux-gnu" + #:name "rpi-64" + #:description %u-boot-rpi-description-64-bit)) + +(define-public u-boot-rpi-0-w-efi + (make-preinstalled-u-boot-package + "rpi_0_w" + "arm-linux-gnueabihf" + #:name "rpi-0-w-efi" + #:configs %u-boot-rpi-efi-configs + #:description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-efi + (make-preinstalled-u-boot-package + "rpi" + "arm-linux-gnueabihf" + #:name "rpi-efi" + #:configs %u-boot-rpi-efi-configs + #:description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-2-efi + (make-preinstalled-u-boot-package + "rpi_2" + "arm-linux-gnueabihf" + #:name "rpi-2-efi" + #:configs %u-boot-rpi-efi-configs + #:description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-3-efi + (make-preinstalled-u-boot-package + "rpi_3_32b" + "arm-linux-gnueabihf" + #:name "rpi-3-efi" + #:configs %u-boot-rpi-efi-configs + #:description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-4-efi + (make-preinstalled-u-boot-package + "rpi_4_32b" + "arm-linux-gnueabihf" + #:name "rpi-4-efi" + #:configs %u-boot-rpi-efi-configs + #:description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-efi-64 + (make-preinstalled-u-boot-package + "rpi_arm64" + "aarch64-linux-gnu" + #:name "rpi-efi-64" + #:configs %u-boot-rpi-efi-configs + #:description (string-append %u-boot-rpi-efi-description " " + %u-boot-rpi-description-64-bit))) + (define-public vboot-utils (package (name "vboot-utils") --Apple-Mail=_B617970F-0E65-4178-8B28-B9F0969B3830 Content-Disposition: attachment; filename=04-gnu-linux-new-function-to Content-Type: application/octet-stream; name="04-gnu-linux-new-function-to" 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(make-linux-libre*)=20= ['set-environment]:=20Splitted=20this=20new=20phase=20out=20of=20and=0A= adding=20it=20before=20=E2=80=A6=0A['configure]:=20=E2=80=A6=20to=20= allow=20a=20replacement=20and=20reuse=20from=20(modify-linux).=0A= (modify-linux):=20New=20function=20to=20make=20a=20customized=20Linux=20= package=20inherited=0Afrom=20another=20Linux=20package,=20which=20will=20= be=20build=20with=20an=20own=20defconfig=20or=0Aconfiguration=20changes.=0A= (make-defconfig):=20Function=20to=20get=20a=20defconfig=20from=20an=20= uri.=0A---=0A=20gnu/packages/linux.scm=20|=20=20130=20= +++++++++++++++++++++++++++++++++++++++++++++++-=0A=201=20file=20= changed,=20127=20insertions(+),=203=20deletions(-)=0A=0Adiff=20--git=20= a/gnu/packages/linux.scm=20b/gnu/packages/linux.scm=0Aindex=20= f4c1867c5d..d8ff747d20=20100644=0A---=20a/gnu/packages/linux.scm=0A+++=20= b/gnu/packages/linux.scm=0A@@=20-53,6=20+53,7=20@@=0A=20;;;=20Copyright=20= =C2=A9=202021=20B.=20Wilson=20=0A=20;;;=20= Copyright=20=C2=A9=202021=20Ivan=20Gankevich=20=0A=20= ;;;=20Copyright=20=C2=A9=202021=20Olivier=20Dion=20= =0A+;;;=20Copyright=20=C2=A9=202021=20Stefan=20= =0A=20;;;=0A=20;;;=20This=20file=20is=20= part=20of=20GNU=20Guix.=0A=20;;;=0A@@=20-166,6=20+167,7=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=20= (define-public=20(system->linux-architecture=20arch)=0A@@=20-182,6=20= +184,21=20@@=0A=20=20=20=20=20=20=20=20=20=20=20((string-prefix?=20= "riscv"=20arch)=20"riscv")=0A=20=20=20=20=20=20=20=20=20=20=20(else=20= arch))))=0A=20=0A+(define-public=20(system->linux-srcarch=20arch)=0A+=20=20= "Return=20for=20a=20Guix=20system=20ARCH=20name=20the=20SRCARCH=20name,=20= which=20is=20set=20in=20the=0A+toplevel=20Makefile=20of=20Linux=20and=20= denotes=20the=20architecture=20specific=20directory=20name=0A+below=20= arch/=20in=20its=20source=20code.=20=20Some=20few=20architectures=20= share=20a=20common=20folder.=0A+It=20resembles=20the=20definition=20of=20= SRCARCH=20based=20on=20ARCH=20in=20the=20Makefile=20and=20may=0A+be=20= used=20to=20place=20a=20defconfig=20file=20in=20the=20proper=20path."=0A= +=20=20(let=20((linux-arch=20(system->linux-architecture=20arch)))=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=20linux-arch))))=0A+=0A=20(define-public=20(system->defconfig=20= system)=0A=20=20=20"Some=20systems=20(notably=20powerpc-linux)=20require=20= a=20special=20target=20for=20kernel=0A=20defconfig.=20=20Return=20the=20= appropriate=20make=20target=20if=20applicable,=20otherwise=20return=0A@@=20= -811,8=20+828,8=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(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(("/bin/pwd")=20"pwd"))=0A=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(replace=20'configure=0A-=20=20=20=20=20= =20=20=20=20=20=20(lambda*=20(#:key=20inputs=20native-inputs=20target=20= #:allow-other-keys)=0A+=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= (lambda*=20(#:key=20target=20#:allow-other-keys)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20;;=20Avoid=20introducing=20timestamps=0A=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(setenv=20"KBUILD_BUILD_TIMESTAMP"=20= (getenv=20"SOURCE_DATE_EPOCH"))=0A@@=20-831,7=20+848,9=20@@=20for=20ARCH=20= and=20optionally=20VARIANT,=20or=20#f=20if=20there=20is=20no=20such=20= configuration."=0A=20=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setenv=20"EXTRAVERSION"=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=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#t))=0A+=20=20=20=20=20=20=20= =20=20(replace=20'configure=0A+=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(let=20((build=20=20(assoc-ref=20= %standard-phases=20'build))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(config=20(assoc-ref=20(or=20native-inputs=20inputs)=20= "kconfig")))=0A=20=0A@@=20-1163,6=20+1182,111=20@@=20It=20has=20been=20= modified=20to=20remove=20all=20non-free=20binary=20blobs.")=0A=20=20=20=20= =20=20=20(inherit=20base-linux-libre)=0A=20=20=20=20=20=20=20(inputs=20= `(("cpio"=20,cpio)=20,@(package-inputs=20base-linux-libre))))))=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=20a=20package,=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=20follow=20two=20special=20removal=20= extensions:=0A+CONFIG_CMDLINE_EXTEND=0A+CONFIG_CMDLINE_FORCE=3D\")=0A+=0A= +A=20string=20of=20configurations=20instead=20of=20a=20list=20of=20= configuration=20strings=20is=20also=0A+possible.=0A+=0A+EXTRA-VERSION=20= can=20be=20a=20string=20overwriting=20the=20EXTRAVERSION=20setting=20of=20= the=20LINUX=0A+package,=20after=20being=20prepended=20by=20a=20hyphen.=20= =20It=20will=20be=20visible=20in=20the=20output=0A+of=20'uname=20-r'=20= behind=20the=20Linux=20version=20numbers."=0A+=20=20(package=0A+=20=20=20= =20(inherit=20linux)=0A+=20=20=20=20(name=20(or=20name=20(package-name=20= linux)))=0A+=20=20=20=20(source=20(or=20source=20(package-source=20= linux)))=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=20= imported-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=20= kconfig)=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(replace=20'configure=0A+=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(let*=20((srcarch=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ,(system->linux-srcarch=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=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(configs=20(string-append=20"arch/"=20srcarch=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(guix_defconfig=20(string-append=20configs=20= "guix_defconfig")))=0A+=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((not=20= defconfig)=0A+=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;;=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(apply=20= (assoc-ref=20,phases=20'configure)=20arguments)=0A+=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=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= =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;;=20Move=20the=20saved=20defconfig=20= to=20the=20proper=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(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=20guix_defconfig)))=0A+=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;;=20Use=20another=20existing=20defconfig=20= from=20the=20Linux=20sources.=0A+=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=20guix_defconfig))=0A+=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;;=20Copy=20the=20defconfig=20input=20to=20= the=20proper=20location.=0A+=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=20guix_defconfig)))=0A+=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,@(if=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`((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=20=20=20=20=20,(string-append=20"-"=20= extra-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'())=0A+=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#t))))))=0A+=20=20=20=20(native-inputs=0A+=20=20=20=20=20= (append=20(if=20(or=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(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=20defconfig=20should=20be=20a=20package=20= or=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=_B617970F-0E65-4178-8B28-B9F0969B3830 Content-Disposition: attachment; filename=05-gnu-raspberry-pi-add-defconfig Content-Type: application/octet-stream; name="05-gnu-raspberry-pi-add-defconfig" 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= %bcm2710-defconfig,=20%bcm2711-defconfig,=0A%bcm2835-defconfig,=20= %bcmrpi-defconfig,=20%bcm2711-defconfig-64,=0A%bcmrpi3-defconfig):=20New=20= variables=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=2044=20= ++++++++++++++++++++++++++++++++++++++++-=0A=201=20file=20changed,=2043=20= insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/gnu/packages/raspberry-pi.scm=20b/gnu/packages/raspberry-pi.scm=0A= index=20bb38b8b218..a2ab300531=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,43=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= "https://raw.githubusercontent.com/raspberrypi/linux/raspberrypi-kernel_1.= 20210430-1/arch/"=0A+=20=20=20=20arch=20"/configs/"=20defconfig)=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= "0yvrmid2jakl929d1mv00gidnqbf91ffhj61c9gl75f7km48811c"))=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= "19hb6nwna7sk3b4rn5yjfhldrs3c1lv24q08w4gpa4xzh1byv7jj"))=0A+=0A= +(define-public=20%bcm2835-defconfig=0A+=20=20(make-raspi-defconfig=0A+=20= =20=20"arm"=20"bcm2835_defconfig"=0A+=20=20=20= "17dmvabqvxwqn6lgv1x8rfh2wqf1r2xmm10nkdnrgwkmgv8bh2d5"))=0A+=0A= +(define-public=20%bcmrpi-defconfig=0A+=20=20(make-raspi-defconfig=0A+=20= =20=20"arm"=20"bcmrpi_defconfig"=0A+=20=20=20= "0lcmr6nxdd53m3k8hqb5k6c5b7vbdgmfvcliqyl95snp45rxjjkw"))=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= "0xf38nczwinr0j8vhsn8nd8h4ysjn77xphg7xnssz04gclb7fndr"))=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= "01k098snd7kbmhz68j93mj2fwp39c56g9r8rgaw17js5r0w0zbhy"))=0A= --Apple-Mail=_B617970F-0E65-4178-8B28-B9F0969B3830 Content-Disposition: attachment; filename=06-gnu-raspberry-pi-add-helpers Content-Type: application/octet-stream; name="06-gnu-raspberry-pi-add-helpers" 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 a2ab300531..0707516f72 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=_B617970F-0E65-4178-8B28-B9F0969B3830 Content-Disposition: attachment; filename=07-gnu-raspberry-pi-new-function Content-Type: application/octet-stream; name="07-gnu-raspberry-pi-new-function" 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 0707516f72..d808f61ac2 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=_B617970F-0E65-4178-8B28-B9F0969B3830 Content-Disposition: attachment; filename=08-gnu-raspberry-pi-add-a Content-Type: application/octet-stream; name="08-gnu-raspberry-pi-add-a" 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 | 73 ++++++++++++++++++++ gnu/system/examples/raspberry-pi-64.tmpl | 77 +++++++++++++++++++++ 3 files changed, 169 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 d808f61ac2..d52a4a72c5 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-efi-64) + #: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..a1e41e3399 --- /dev/null +++ b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl @@ -0,0 +1,73 @@ +;; 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) + (target "/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 '("/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..7e18f00d86 --- /dev/null +++ b/gnu/system/examples/raspberry-pi-64.tmpl @@ -0,0 +1,77 @@ +;; 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) + (target "/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 '("/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=_B617970F-0E65-4178-8B28-B9F0969B3830--