From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EHg2FDc61WLbgQAAbAwnHQ (envelope-from ) for ; Mon, 18 Jul 2022 12:47:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qNXIEzc61WIk/QAAauVa8A (envelope-from ) for ; Mon, 18 Jul 2022 12:47:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 611D525F76 for ; Mon, 18 Jul 2022 12:47:18 +0200 (CEST) Received: from localhost ([::1]:38286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDOHV-0006mu-3x for larch@yhetil.org; Mon, 18 Jul 2022 06:47:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDOAV-0003BO-0x for guix-patches@gnu.org; Mon, 18 Jul 2022 06:40:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDOAU-0002Yh-Mk for guix-patches@gnu.org; Mon, 18 Jul 2022 06:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oDOAU-0006z1-Hg for guix-patches@gnu.org; Mon, 18 Jul 2022 06:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48314] [PATCH v3] Install guix system on Raspberry Pi Resent-From: Stefan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 18 Jul 2022 10:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48314 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48314@debbugs.gnu.org Cc: Vagrant Cascadian , dannym@scratchpost.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , phodina Received: via spool by 48314-submit@debbugs.gnu.org id=B48314.165814079526827 (code B ref 48314); Mon, 18 Jul 2022 10:40:02 +0000 Received: (at 48314) by debbugs.gnu.org; 18 Jul 2022 10:39:55 +0000 Received: from localhost ([127.0.0.1]:49259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDOAN-0006yd-8n for submit@debbugs.gnu.org; Mon, 18 Jul 2022 06:39:55 -0400 Received: from mr5.vodafonemail.de ([145.253.228.165]:38806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDOAL-0006yN-Dk for 48314@debbugs.gnu.org; Mon, 18 Jul 2022 06:39:54 -0400 Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr5.vodafonemail.de (Postfix) with ESMTPS id 4Lmdkq2LLcz1yD4; Mon, 18 Jul 2022 10:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-21dec; t=1658140787; bh=c+QhzsIUtddFEE6UMsGJyRunieEZI0UN+styDQZaUKU=; h=From:Message-Id:Content-Type:Subject:Date:In-Reply-To:To: References:X-Mailer:From; b=IEtaI+cL8khszkch2GjRaH8370dFbKilApDu7/SHG06NzXennyDm+yNfT8J+Im1C5 ZMdQYj73y55hArcmg6fcKVINjby8T6YiCIcG7FLj5TN3wkQECyiwX9hlmJPyCrrKtB 87wCNMifWdi28hesw/o49Firq84EZImXeLhH8k6Q= Received: from smtpclient.apple (aftr-62-216-210-100.dynamic.mnet-online.de [62.216.210.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4LmdkZ1sb2zMmvR; Mon, 18 Jul 2022 10:39:31 +0000 (UTC) Message-Id: <125F42BC-E90F-47A5-9997-7E0089AF07BF@vodafonemail.de> Content-Type: multipart/mixed; boundary="Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Date: Sun, 17 Jul 2022 18:48:09 +0200 In-Reply-To: References: <87tuadhq3d.fsf@contorta> <81366405-13FD-4F0E-8180-4DFCB16A6C1A@vodafonemail.de> <87zgk5b56p.fsf@contorta> X-Mailer: Apple Mail (2.3696.100.31) X-purgate-type: clean X-purgate: clean X-purgate-size: 144608 X-purgate-ID: 155817::1658140786-1C2F12A7-7D3003D7/0/0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Stefan X-ACL-Warn: , Stefan via Guix-patches From: Stefan via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658141239; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=c+QhzsIUtddFEE6UMsGJyRunieEZI0UN+styDQZaUKU=; b=ZpVh7bZsTyVvYxcEVbFH5K/qzCQIT/gT7a/c8WVyLtx42idHf4m+eUuB5N0NeIZZU3QsAY UuEgmQabEqFsMsRnNwc2PE8MV6KuhjyLI3yDZdrtg4mlCVyrq+lv7ddXn9cSla/Cx+k/A5 J2jsPIZw76/Xeg9Xbpdim4hpcoLcsqBKT6Ma9bvNONcF/bZJhGwKHOvSAv5Pre6SY/rSAz 0D0gpqhiOlNkscI7ee+Yt5DCC68bYApxjs74/XZlrjYRf+hWq48tc8qzKECCc9MuGzb8FA yMEi8EMLuwzqaOzyLKMWV3nFPK4k5NgjAAKG13T1NX4jTbx/feZonhJXnuOevg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658141239; a=rsa-sha256; cv=none; b=FKDSk4Dm2hM0QUNlopR6pT9JfJ+hkgg15fsw7F90tSddPc95iOxNGMpkdUWweqTAC8L909 UUpl5IRO9PkJV/01Se4nJBKaB1/EWb3bgYqLme3GQWjb9UZSNyv7YdPlGyTb0q1BNCUNm0 RMqfWcOxy/WJ2S+Po0UxaMhafQaZD0w4zbTQr3vJQgRzYqT/N3xI6kyNZe2yQ5bc8wchh1 2k7UJx5AEaOLKV+d6GIgvDYcpJ9V4RvF9BxdwUcErF8B/nK/92QSno8XfaDVWtv6XNwWWZ UDUVkpqj6OOa6wnyp3jsXIwCRWOMYw4TMDCIAi0vhixMvYHSJQfr9QvSYQWckg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=vodafonemail.de header.s=vfde-mb-mr2-21dec header.b=IEtaI+cL; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=vodafonemail.de header.s=vfde-mb-mr2-21dec header.b=IEtaI+cL; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 611D525F76 X-Spam-Score: -3.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: pJrxlcoPT/pf --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi! A new patch series based on 7558417360d2ae011ec23197c75ef8e411558810. I = tried to apply all review comments. Bye Stefan --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Disposition: attachment; filename=01-gnu-linux-fix-extra-version.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="01-gnu-linux-fix-extra-version.patch" Content-Transfer-Encoding: quoted-printable gnu:=20linux:=20Fix=20the=20extra-version=20parameter=20in=20= make-linux-libre*.=0A=0AFrom:=20Stefan=20=0A= =0A*=20gnu/packages/linux.scm=20(make-linux-libre*)=20= ['set-environment]:=20Make=0Athe=20Makefile=20accept=20EXTRAVERSION=20= from=20the=20environment.=20Fix=20the=20usage=20of=0Aan=20empty=20= extra-version=20string.=20Split=20this=20new=20phase=20out=20of=20and=20= adding=0Aif=20before=20=E2=80=A6=0A['configure]:=20=E2=80=A6=20to=20make=20= the=20phases=20more=20hackable.=0A---=0A=20gnu/packages/linux.scm=20|=20=20= =2017=20+++++++++++------=0A=201=20file=20changed,=2011=20insertions(+),=20= 6=20deletions(-)=0A=0Adiff=20--git=20a/gnu/packages/linux.scm=20= b/gnu/packages/linux.scm=0Aindex=2019ba30aa16..b00b46be47=20100644=0A---=20= a/gnu/packages/linux.scm=0A+++=20b/gnu/packages/linux.scm=0A@@=20-63,6=20= +63,7=20@@=0A=20;;;=20Copyright=20=C2=A9=202021=20Petr=20Hodina=20= =0A=20;;;=20Copyright=20=C2=A9=202022=20Artyom=20= V.=20Poptsov=20=0A=20;;;=20Copyright=20=C2=A9=20= 2022=20Rene=20Saavedra=20=0A+;;;=20Copyright=20=C2=A9= =202022=20Stefan=20=0A=20=0A=20;;;=0A=20;;;=20= This=20file=20is=20part=20of=20GNU=20Guix.=0A@@=20-823,8=20+824,8=20@@=20= for=20ARCH=20and=20optionally=20VARIANT,=20or=20#f=20if=20there=20is=20= no=20such=20configuration."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(lambda=20_=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(substitute*=20(find-files=20"."=20"^Makefile(\\.include)?$")=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (("/bin/pwd")=20"pwd"))))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (replace=20'configure=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(lambda*=20(#:key=20inputs=20target=20#:allow-other-keys)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(add-before=20'configure=20= 'set-environment=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (lambda*=20(#:key=20target=20#:allow-other-keys)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20Avoid=20introducing=20= timestamps.=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setenv=20"KCONFIG_NOTIMESTAMP"=20"1")=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(setenv=20"KBUILD_BUILD_TIMESTAMP"=0A@@=20= -846,11=20+847,15=20@@=20for=20ARCH=20and=20optionally=20VARIANT,=20or=20= #f=20if=20there=20is=20no=20such=20configuration."=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setenv=20= "CROSS_COMPILE"=20(string-append=20target=20"-"))=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(format=20#t=20= "`CROSS_COMPILE'=20set=20to=20`~a'~%"=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(getenv=20= "CROSS_COMPILE"))))=0A-=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20Allow=20EXTRAVERSION=20to=20be=20set=20via=20the=20= environment.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (substitute*=20"Makefile"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(("^=20*EXTRAVERSION[[:blank:]]*=3D")=20"EXTRAVERSION=20= ?=3D"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setenv=20"EXTRAVERSION"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20#$(and=20extra-version=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(string-append=20"-"=20extra-version)))=0A-=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(not=20(string-null?=20extra-version))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(string-append=20"-"=20extra-version)))))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(replace=20'configure=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(lambda*=20(#:key=20inputs=20= #:allow-other-keys)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(let=20((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=20=20=20=20=20=20= (config=20(assoc-ref=20inputs=20"kconfig")))=0A=20=0A@@=20-871,7=20= +876,7=20@@=20for=20ARCH=20and=20optionally=20VARIANT,=20or=20#f=20if=20= there=20is=20no=20such=20configuration."=0A=20=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(invoke=20"make"=20= "oldconfig"))))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (replace=20'install=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (lambda*=20(#:key=20inputs=20native-inputs=20#:allow-other-keys)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda*=20(#:key=20inputs=20= #:allow-other-keys)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(let=20((moddir=20(string-append=20#$output=20"/lib/modules"))=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(dtbdir=20(string-append=20#$output=20"/lib/dtbs")))=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Install=20kernel=20= image,=20kernel=20configuration=20and=20link=20map.=0A= --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Disposition: attachment; filename=02-gnu-bootloader-rework-chaining.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="02-gnu-bootloader-rework-chaining.patch" Content-Transfer-Encoding: quoted-printable gnu:=20bootloader:=20Rework=20chaining,=20add=20= grub-efi-netboot-removable-bootloader.=0A=0AFrom:=20Stefan=20= =0A=0A*=20doc/guix.texi=20(Bootloader=20= Configuration):=20Describe=20the=20new=0A= =E2=80=98grub-efi-netboot-removable-bootloader=E2=80=99.=20=20Mention=20= used=20sub-directories=20and=0Athat=20the=20UEFI=20Boot=20Manager=20is=20= not=20modified.=20=20Advice=20to=20disable=20write-access=0Aover=20TFTP.=0A= *=20gnu/bootloader.scm=20(efi-bootloader-profile):=20Allow=20a=20list=20= of=20packages=20and=0Acollect=20everything=20directly=20in=20the=20= profile,=20avoiding=20a=20separate=20collection=0Adirectory.=20=20= Renamed=20the=20profile=20from=20"bootloader-profile"=20to=0A= "efi-bootloader-profile".=0A[bootloader-collection]:=20Renamed=20to=20= =E2=80=A6=0A[efi-bootloader-profile-hook]:=20=E2=80=A6=20this=20and=20= removed=20unused=20modules=20and=20the=0Acreation=20of=20the=20now=20= unneeded=20collection=20directory.=0A(efi-bootloader-chain):=20Added=20= packages=20and=20disk-image-installer=20arguments.=0ARemoved=20handling=20= of=20the=20collection=20directory,=20now=20only=20calling=20the=20given=0A= installer=20procedure.=0A*=20gnu/bootloader/grub.scm=20= (make-grub-efi-netboot-installer):=20New=20helper.=0A= (make-grub-configuration):=20New=20helper=20based=20on=20= (grub-configuration-file).=0AAdding=20grub=20argument,=20fixed=20= indentation,=20removend=20code=20to=20get=20grub.=0A= (grub-configuration-file):=20Now=20using=20(make-grub-configuration).=0A= (grub-efi-configuration-file):=20New=20function=20using=20= (make-grub-configuration).=0AInstead=20of=20getting=20the=20grub-efi=20= package=20from=20the=20bootloader-configuration=0Athis=20function=20= refers=20to=20the=20grub-efi=20package=20directly.=0A(grub-cfg):=20New=20= variable=20to=20replace=20"/boot/grub/grub.cfg".=0A= (install-grub-efi-netboot):=20Removed,=20the=20functionality=20got=20= moved.=0A(make-grub-efi-netboot-installer):=20New=20helper=20function=20= to=20return=20a=20customized=0Ainstaller=20for=20a=20certain=20= efi-sub-directory.=20=20The=20installer=20basically=20copies=0Aa=20= pre-installed=20efi-bootloader-profile,=20and=20adds=20needed=20symlinks=20= for=20booting=0Aover=20network,=20or=20=E2=80=93=20on=20an=20ESP=20=E2=80=93= =20an=20intermediate=20grub-cfg=20to=20load=20the=20final=0Agrub-cfg=20= file.=0A(grub-bootloader):=20Now=20using=20the=20grub-cfg=20variable.=0A= (grub-efi-bootloader):=20Now=20using=20the=20grub-cfg=20variable.=20=20= Removed=20inheritance,=0Agiving=20complete=20set=20of=20fields.=0A= (make-grub-efi-netboot-bootloader):=20New=20helper=20function.=0A= (grub-efi-netboot-bootloader):=20Now=20using=20the=20helper.=0A= (grub-efi-netboot-removable-bootloader):=20New=20bootloader=20using=20= the=20helper.=0AIt=20uses=20the=20efi-sub-directory=20"efi/boot"=20for=20= removable=20media.=0A*=20gnu/packages/bootloaders.scm=20= (make-grub-efi-netboot):=20New=20function=20to=20return=0Aa=20grub-efi=20= package=20pre-installed=20via=20grub-mknetdir,=20customized=20for=20an=0A= efi-sub-directory=20and=20able=20to=20boot=20via=20network=20and=20local=20= storage.=0A=0AThe=20rework=20allows=20to=20use=20an=20= (efi-bootloader-chain)=20like=20this,=20which=20is=20able=0Ato=20boot=20= over=20network=20or=20local=20storage,=20depending=20on=20the=20= symlink-support=20at=0Athe=20bootloader-target:=0A=0A(operating-system=0A= =20(bootloader=0A=20=20=20(bootloader-configuration=0A=20=20=20=20=20= (bootloader=0A=20=20=20=20=20=20=20(efi-bootloader-chain=0A=20=20=20=20=20= =20=20=20=20grub-efi-netboot-removable-bootloader=0A=20=20=20=20=20=20=20= =20=20#:packages=20(list=20my-firmware-package=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20my-u-boot-package)=0A= =20=20=20=20=20=20=20=20=20#:files=20(list=20(plain-file=20"config.txt"=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20"kernel=3Du-boot.bin"))=0A=20=20=20=20=20=20= =20=20=20#:hooks=20my-special-bootloader-profile-manipulator))=0A=20=20=20= =20=20(target=20"/booti/efi")=0A=20=20=20=20=20=E2=80=A6))=0A=20=E2=80=A6)= =0A)=0A---=0A=20doc/guix.texi=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20|=20=20=2058=20+++++++---=0A=20gnu/bootloader.scm=20=20=20=20=20=20=20= =20=20=20=20|=20=20104=20+++++++++---------=0A=20gnu/bootloader/grub.scm=20= =20=20=20=20=20|=20=20241=20++++++++++++++++++++++++++----------------=0A= =20gnu/packages/bootloaders.scm=20|=20=20=2090=20++++++++++++++++=0A=204=20= files=20changed,=20331=20insertions(+),=20162=20deletions(-)=0A=0Adiff=20= --git=20a/doc/guix.texi=20b/doc/guix.texi=0Aindex=20= 8fc8f53d0e..e4fb4a6bc8=20100644=0A---=20a/doc/guix.texi=0A+++=20= b/doc/guix.texi=0A@@=20-36937,8=20+36937,9=20@@=20The=20type=20of=20a=20= bootloader=20configuration=20declaration.=0A=20@cindex=20BIOS,=20= bootloader=0A=20The=20bootloader=20to=20use,=20as=20a=20= @code{bootloader}=20object.=20=20For=20now=0A=20@code{grub-bootloader},=20= @code{grub-efi-bootloader},=0A-@code{grub-efi-netboot-bootloader},=20= @code{grub-efi-removable-bootloader},=0A-@code{extlinux-bootloader}=20= and=20@code{u-boot-bootloader}=20are=20supported.=0A= +@code{grub-efi-removable-bootloader},=20= @code{grub-efi-netboot-bootloader},=0A= +@code{grub-efi-netboot-removable-bootloader},=20= @code{extlinux-bootloader}=0A+and=20@code{u-boot-bootloader}=20are=20= supported.=0A=20=0A=20@cindex=20ARM,=20bootloaders=0A=20@cindex=20= AArch64,=20bootloaders=0A@@=20-36947,15=20+36948,29=20@@=20modules.=20=20= In=20particular,=20@code{(gnu=20bootloader=20u-boot)}=20contains=20= definitions=0A=20of=20bootloaders=20for=20a=20wide=20range=20of=20ARM=20= and=20AArch64=20systems,=20using=20the=0A=20= @uref{https://www.denx.de/wiki/U-Boot/,=20U-Boot=20bootloader}.=0A=20=0A= +@vindex=20grub-bootloader=0A+@code{grub-bootloader}=20allows=20you=20to=20= boot=20in=20particular=20Intel-based=20machines=0A+in=20``legacy''=20= BIOS=20mode.=0A+=0A=20@vindex=20grub-efi-bootloader=0A=20= @code{grub-efi-bootloader}=20allows=20to=20boot=20on=20modern=20systems=20= using=20the=0A=20@dfn{Unified=20Extensible=20Firmware=20Interface}=20= (UEFI).=20=20This=20is=20what=20you=20should=0A=20use=20if=20the=20= installation=20image=20contains=20a=20@file{/sys/firmware/efi}=20= directory=0A=20when=20you=20boot=20it=20on=20your=20system.=0A=20=0A= -@vindex=20grub-bootloader=0A-@code{grub-bootloader}=20allows=20you=20to=20= boot=20in=20particular=20Intel-based=20machines=0A-in=20``legacy''=20= BIOS=20mode.=0A+@vindex=20grub-efi-removable-bootloader=0A= +@code{grub-efi-removable-bootloader}=20allows=20you=20to=20boot=20your=20= system=20from=0A+removable=20media=20by=20writing=20the=20GRUB=20file=20= to=20the=20UEFI-specification=20location=20of=0A= +@file{/EFI/BOOT/BOOTX64.efi}=20of=20the=20boot=20directory,=20usually=20= @file{/boot/efi}.=0A+This=20is=20also=20useful=20for=20some=20UEFI=20= firmwares=20that=20``forget''=20their=20configuration=0A+from=20their=20= non-volatile=20storage.=20Like=20@code{grub-efi-bootloader},=20this=20= can=20only=0A+be=20used=20if=20the=20@file{/sys/firmware/efi}=20= directory=20is=20available.=0A+=0A+@quotation=20Note=0A+This=20= @emph{will}=20overwrite=20the=20GRUB=20file=20from=20any=20other=20= operating=20systems=20that=0A+also=20place=20their=20GRUB=20file=20in=20= the=20UEFI-specification=20location;=20making=20them=0A+unbootable.=0A= +@end=20quotation=0A=20=0A=20@vindex=20grub-efi-netboot-bootloader=0A=20= @code{grub-efi-netboot-bootloader}=20allows=20you=20to=20boot=20your=20= system=20over=20network=0A@@=20-36964,9=20+36979,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-36995,25=20+37011,33=20@@=20this=20constellation=20the=20symlinks=20= will=20work.=0A=20For=20other=20constellations=20you=20will=20have=20to=20= program=20your=20own=20bootloader=0A=20installer,=20which=20then=20takes=20= care=20to=20make=20necessary=20files=20from=20the=20store=0A=20= accessible=20through=20TFTP,=20for=20example=20by=20copying=20them=20= into=20the=20TFTP=20root=0A-directory=20to=20your=20@code{targets}.=0A= +directory=20for=20your=20@code{targets}.=0A=20=0A=20It=20is=20important=20= to=20note=20that=20symlinks=20pointing=20outside=20the=20TFTP=20root=20= directory=0A=20may=20need=20to=20be=20allowed=20in=20the=20configuration=20= of=20your=20TFTP=20server.=20=20Further=20the=0A=20store=20link=20= exposes=20the=20whole=20store=20through=20TFTP@.=20=20Both=20points=20= need=20to=20be=0A-considered=20carefully=20for=20security=20aspects.=0A= +considered=20carefully=20for=20security=20aspects.=20=20It=20is=20= advised=20to=20disable=20any=20TFTP=0A+write=20access!=0A+=0A+Please=20= note,=20that=20this=20bootloader=20will=20not=20modify=20the=20=E2=80=98UE= FI=20Boot=20Manager=E2=80=99=20of=0A+the=20system.=0A=20=0A=20Beside=20= the=20@code{grub-efi-netboot-bootloader},=20the=20already=20mentioned=20= TFTP=20and=0A=20NFS=20servers,=20you=20also=20need=20a=20properly=20= configured=20DHCP=20server=20to=20make=20the=20booting=0A=20over=20= netboot=20possible.=20=20For=20all=20this=20we=20can=20currently=20only=20= recommend=20you=20to=20look=0A=20for=20instructions=20about=20= @acronym{PXE,=20Preboot=20eXecution=20Environment}.=0A=20=0A-@vindex=20= grub-efi-removable-bootloader=0A-@code{grub-efi-removable-bootloader}=20= allows=20you=20to=20boot=20your=20system=20from=0A-removable=20media=20= by=20writing=20the=20GRUB=20file=20to=20the=20UEFI-specification=20= location=20of=0A-@file{/EFI/BOOT/BOOTX64.efi}=20of=20the=20boot=20= directory,=20usually=20@file{/boot/efi}.=0A-This=20is=20also=20useful=20= for=20some=20UEFI=20firmwares=20that=20``forget''=20their=20= configuration=0A-from=20their=20non-volatile=20storage.=20Like=20= @code{grub-efi-bootloader},=20this=20can=20only=0A-be=20used=20if=20the=20= @file{/sys/firmware/efi}=20directory=20is=20available.=0A+If=20a=20local=20= EFI=20System=20Partition=20(ESP)=20or=20a=20similar=20partition=20with=20= a=20FAT=20file=0A+system=20is=20mounted=20in=20@code{targets},=20then=20= symlinks=20cannot=20be=20created.=20=20In=20this=0A+case=20everything=20= will=20be=20prepared=20for=20booting=20from=20local=20storage,=20= simialar=20as=20if=0A+using=20@code{grub-efi-bootloader},=20with=20the=20= difference=20that=20all=20GRUB=20binaries=0A+reside=20on=20= @code{targets},=20too,=20like=20needed=20for=20booting=20over=20network.=0A= +=0A+@vindex=20grub-efi-netboot-removable-bootloader=0A= +@code{grub-efi-netboot-removable-bootloader}=20is=20identical=20to=0A= +@code{grub-efi-netboot-bootloader}=20with=20the=20exception=20that=20= the=20sub-directory=0A+@file{efi/boot}=20will=20be=20used=20instead=20of=20= @file{efi/Guix}=20to=20comply=20to=20the=20UEFI=0A+specification=20for=20= removable=20media.=0A=20=0A=20@quotation=20Note=0A=20This=20@emph{will}=20= overwrite=20the=20GRUB=20file=20from=20any=20other=20operating=20systems=20= that=0Adiff=20--git=20a/gnu/bootloader.scm=20b/gnu/bootloader.scm=0A= index=209cf5457873..797908e24a=20100644=0A---=20a/gnu/bootloader.scm=0A= +++=20b/gnu/bootloader.scm=0A@@=20-259,26=20+259,22=20@@=20instead~%")))=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20(force=20%bootloaders))=0A=20=20=20= =20=20=20=20(leave=20(G_=20"~a:=20no=20such=20bootloader~%")=20name)))=0A= =20=0A-(define=20(efi-bootloader-profile=20files=20bootloader-package=20= hooks)=0A-=20=20"Creates=20a=20profile=20with=20BOOTLOADER-PACKAGE=20and=20= a=20directory=20collection/=20with=0A-links=20to=20additional=20FILES=20= from=20the=20store.=20=20This=20collection=20is=20meant=20to=20be=20used=0A= -by=20the=20bootloader=20installer.=0A+(define=20(efi-bootloader-profile=20= packages=20files=20hooks)=0A+=20=20"Creates=20a=20profile=20from=20the=20= lists=20of=20PACKAGES=20and=20FILES=20from=20the=20store.=0A+This=20= profile=20is=20meant=20to=20be=20used=20by=20the=20bootloader-installer.=0A= =20=0A=20FILES=20is=20a=20list=20of=20file=20or=20directory=20names=20= from=20the=20store,=20which=20will=20be=0A-symlinked=20into=20the=20= collection/=20directory.=20=20If=20a=20directory=20name=20ends=20with=20= '/',=0A-then=20the=20directory=20content=20instead=20of=20the=20= directory=20itself=20will=20be=20symlinked=0A-into=20the=20collection/=20= directory.=0A+symlinked=20into=20the=20profile.=20=20If=20a=20directory=20= name=20ends=20with=20'/',=20then=20the=0A+directory=20content=20instead=20= of=20the=20directory=20itself=20will=20be=20symlinked=20into=20the=0A= +profile.=0A=20=0A-FILES=20may=20contain=20file=20like=20objects=20= produced=20by=20functions=20like=20plain-file,=0A+FILES=20may=20contain=20= file=20like=20objects=20produced=20by=20procedures=20like=20plain-file,=0A= =20local-file,=20etc.,=20or=20package=20contents=20produced=20with=20= file-append.=0A=20=0A=20HOOKS=20lists=20additional=20hook=20functions=20= to=20modify=20the=20profile."=0A-=20=20(define=20(bootloader-collection=20= manifest)=0A+=20=20(define=20(efi-bootloader-profile-hook=20manifest)=0A=20= =20=20=20=20(define=20build=0A-=20=20=20=20=20=20=20=20= (with-imported-modules=20'((guix=20build=20utils)=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(ice-9=20ftw)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(srfi=20srfi-1)=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(srfi=20srfi-26))=0A+=20=20=20=20=20=20=20=20= (with-imported-modules=20'((guix=20build=20utils))=0A=20=20=20=20=20=20=20= =20=20=20=20#~(begin=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= (use-modules=20((guix=20build=20utils)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#:select=20(mkdir-p=20= strip-store-file-name))=0A@@=20-302,7=20+298,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-311,11=20+307,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= -323,57=20+319,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=204f18c9b518..2406e204ab=20100644=0A= ---=20a/gnu/bootloader/grub.scm=0A+++=20b/gnu/bootloader/grub.scm=0A@@=20= -53,13=20+53,14=20@@=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-theme-gfxmode=0A=20=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= install-grub-efi-removable=0A-=20=20=20=20=20=20=20=20=20=20=20=20= install-grub-efi-netboot=0A+=20=20=20=20=20=20=20=20=20=20=20=20= make-grub-efi-netboot-installer=0A=20=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20grub-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi-removable-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi32-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi-netboot-bootloader=0A+=20=20=20=20=20=20=20=20=20=20=20=20= grub-efi-netboot-removable-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20grub-mkrescue-bootloader=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= grub-minimal-bootloader=0A=20=0A@@=20-353,7=20+354,7=20@@=20code."=0A=20=20= =20=20=20=20=20=20=20((or=20#f=20(?=20string?))=0A=20=20=20=20=20=20=20=20= =20=20#~(format=20#f=20"search=20--file=20--set=20~a"=20#$file)))))=0A=20= =0A-(define*=20(grub-configuration-file=20config=20entries=0A+(define*=20= (make-grub-configuration=20grub=20config=20entries=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20#:key=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(locale=20#f)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(system=20(%current-system))=0A@@=20-383,27=20= +384,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-440,9=20= +441,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-468,8=20+467,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-520,6=20+517,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-661,42=20= +668,31=20@@=20fi~%"))))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((target-arm?)=20= "--target=3Darm-efi"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"--efi-directory"=20target-esp)))))=0A=20=0A= -(define=20(install-grub-efi-netboot=20subdir)=0A-=20=20"Define=20a=20= grub-efi-netboot=20bootloader=20installer=20for=20installation=20in=20= SUBDIR,=0A-which=20is=20usually=20efi/Guix=20or=20efi/boot."=0A-=20=20= (let*=20((system=20(string-split=20(nix-system->gnu-triplet=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(or=20(%current-target-system)=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(%current-system)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#\-))=0A-=20=20=20=20=20=20=20= =20=20(arch=20(first=20system))=0A-=20=20=20=20=20=20=20=20=20= (boot-efi-link=20(match=20system=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20;;=20These=20are=20the=20= supportend=20systems=20and=20the=20names=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20defined=20by=20the=20= UEFI=20standard=20for=20removable=20media.=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(("i686"=20_=20...)=20= =20=20=20=20=20=20=20"/bootia32.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(("x86_64"=20_=20...)=20=20=20= =20=20=20"/bootx64.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(("arm"=20_=20...)=20=20=20=20=20=20=20=20= =20"/bootarm.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(("aarch64"=20_=20...)=20=20=20=20=20= "/bootaa64.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(("riscv"=20_=20...)=20=20=20=20=20=20=20= "/bootriscv32.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(("riscv64"=20_=20...)=20=20=20=20=20= "/bootriscv64.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20Other=20systems=20are=20not=20supported,=20= although=20defined.=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20(("riscv128"=20_=20...)=20= "/bootriscv128.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20(("ia64"=20_=20...)=20=20=20=20=20= "/bootia64.efi")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20((_=20...)=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20#f)))=0A-=20=20=20=20=20=20=20=20=20(core-efi=20(string-append=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20This=20is=20= the=20arch=20dependent=20file=20name=20of=20GRUB,=20e.g.=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20i368-efi/core.efi=20or=20= arm64-efi/core.efi.=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(match=20arch=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20("i686"=20=20=20=20"i386")=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20("aarch64"=20"arm64")=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20("riscv"=20=20=20= "riscv32")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(_=20=20=20=20=20=20=20=20=20arch))=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20"-efi/core.efi")))=0A-=20=20=20=20= (with-imported-modules=0A-=20=20=20=20=20'((guix=20build=20union))=0A-=20= =20=20=20=20#~(lambda=20(bootloader=20target=20mount-point)=0A-=20=20=20=20= =20=20=20=20=20"Install=20the=20BOOTLOADER,=20which=20must=20be=20the=20= package=20grub,=20as=20e.g.=0A-bootx64.efi=20or=20bootaa64.efi=20into=20= SUBDIR,=20which=20is=20usually=20efi/Guix=20or=20efi/boot,=0A-below=20= the=20directory=20TARGET=20for=20the=20system=20whose=20root=20is=20= mounted=20at=20MOUNT-POINT.=0A+(define*=20= (make-grub-efi-netboot-installer=20grub-efi=20grub-cfg=20subdir)=0A+=20=20= "Make=20a=20bootloader-installer=20for=20a=20grub-efi-netboot=20= bootloader,=20which=20expects=0A+its=20files=20in=20SUBDIR=20and=20its=20= configuration=20file=20in=20GRUB-CFG.=0A+=0A+As=20a=20grub-efi-netboot=20= package=20is=20already=20preinstalled=20by=20'grub-mknetdir',=20the=0A= +installer=20basically=20copies=20all=20files=20from=20the=20= bootloader-package=20(or=20profile)=0A+into=20the=20bootloader-target=20= directory.=0A+=0A+Additionally=20for=20network=20booting=20over=20TFTP,=20= two=20relative=20symlinks=20to=20the=20store=0A+and=20to=20the=20= GRUB-CFG=20file=20are=20necessary.=20=20Due=20to=20this=20a=20TFTP=20= root=20directory=20must=0A+not=20be=20located=20on=20a=20FAT=20= file-system.=0A+=0A+If=20the=20bootloader-target=20does=20not=20support=20= symlinks,=20then=20it=20is=20assumed=20to=20be=20a=0A+kind=20of=20EFI=20= System=20Partition=20(ESP).=20=20In=20this=20case=20an=20intermediate=20= configuration=0A+file=20is=20created=20with=20the=20help=20of=20GRUB-EFI=20= to=20load=20the=20GRUB-CFG.=0A+=0A+The=20installer=20is=20usable=20for=20= any=20efi-bootloader-chain,=20which=20prepares=20the=0A= +bootloader-profile=20in=20a=20way=20ready=20for=20copying.=0A+=0A+The=20= installer=20does=20not=20manipulate=20the=20system's=20'UEFI=20Boot=20= Manager'."=0A+=20=20(with-imported-modules=20'((guix=20build=20union))=0A= +=20=20=20=20#~(lambda=20(bootloader=20target=20mount-point)=0A+=20=20=20= =20=20=20=20=20"Copy=20the=20BOOTLOADER,=20which=20must=20be=20a=20= preinstalled=20grub-efi-netboot=0A+package=20with=20a=20SUBDIR=20like=20= efi/boot=20or=20efi/Guix,=20below=20the=20directory=0A+TARGET=20for=20= the=20system=20whose=20root=20is=20mounted=20at=20MOUNT-POINT.=0A=20=0A=20= MOUNT-POINT=20is=20the=20last=20argument=20in=20'guix=20system=20init=20= /etc/config.scm=20mnt/point'=0A=20or=20'/'=20for=20other=20'guix=20= system'=20commands.=0A@@=20-706,17=20+702,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-726,34=20+723,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-771,7=20+812,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-781,11=20+822,12=20@@=20= considered=20for=20security=20aspects."=0A=20=0A=20(define=20= grub-efi-bootloader=0A=20=20=20(bootloader=0A-=20=20=20(inherit=20= grub-bootloader)=0A+=20=20=20(name=20'grub-efi)=0A+=20=20=20(package=20= grub-efi)=0A=20=20=20=20(installer=20install-grub-efi)=0A=20=20=20=20= (disk-image-installer=20#f)=0A-=20=20=20(name=20'grub-efi)=0A-=20=20=20= (package=20grub-efi)))=0A+=20=20=20(configuration-file=20grub-cfg)=0A+=20= =20=20(configuration-file-generator=20grub-configuration-file)))=0A=20=0A= =20(define=20grub-efi-removable-bootloader=0A=20=20=20(bootloader=0A@@=20= -800,11=20+842,22=20@@=20considered=20for=20security=20aspects."=0A=20=20= =20=20(name=20'grub-efi32)=0A=20=20=20=20(package=20grub-efi32)))=0A=20=0A= -(define=20grub-efi-netboot-bootloader=0A+(define=20= (make-grub-efi-netboot-bootloader=20name=20subdir)=0A=20=20=20= (bootloader=0A-=20=20=20(inherit=20grub-efi-bootloader)=0A-=20=20=20= (name=20'grub-efi-netboot-bootloader)=0A-=20=20=20(installer=20= (install-grub-efi-netboot=20"efi/Guix"))))=0A+=20=20=20(name=20name)=0A+=20= =20=20(package=20(make-grub-efi-netboot=20(symbol->string=20name)=20= subdir))=0A+=20=20=20(installer=20(make-grub-efi-netboot-installer=20= grub-efi=20grub-cfg=20subdir))=0A+=20=20=20(disk-image-installer=20#f)=0A= +=20=20=20(configuration-file=20grub-cfg)=0A+=20=20=20= (configuration-file-generator=20grub-efi-configuration-file)))=0A+=0A= +(define=20grub-efi-netboot-bootloader=0A+=20=20= (make-grub-efi-netboot-bootloader=20'grub-efi-netboot-bootloader=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"efi/Guix"))=0A+=0A+(define=20= grub-efi-netboot-removable-bootloader=0A+=20=20= (make-grub-efi-netboot-bootloader=20= 'grub-efi-netboot-removable-bootloader=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "efi/boot"))=0A=20=0A=20(define=20grub-mkrescue-bootloader=0A=20=20=20= (bootloader=0Adiff=20--git=20a/gnu/packages/bootloaders.scm=20= b/gnu/packages/bootloaders.scm=0Aindex=2071a10f54d5..3dbd3c97e8=20100644=0A= ---=20a/gnu/packages/bootloaders.scm=0A+++=20= b/gnu/packages/bootloaders.scm=0A@@=20-16,6=20+16,7=20@@=0A=20;;;=20= Copyright=20=C2=A9=202021=20Vincent=20Legoll=20= =0A=20;;;=20Copyright=20=C2=A9=202021=20Brice=20= Waegeneire=20=0A=20;;;=20Copyright=20=C2=A9=202022=20= Denis=20'GNUtoo'=20Carikli=20=0A+;;;=20= Copyright=20=C2=A9=202021=20Stefan=20=0A=20= ;;;=0A=20;;;=20This=20file=20is=20part=20of=20GNU=20Guix.=0A=20;;;=0A@@=20= -67,13=20+68,17=20@@=0A=20=20=20#:use-module=20(gnu=20packages=20= virtualization)=0A=20=20=20#:use-module=20(gnu=20packages=20xorg)=0A=20=20= =20#:use-module=20(guix=20build-system=20gnu)=0A+=20=20#:use-module=20= (guix=20build-system=20trivial)=0A=20=20=20#:use-module=20(guix=20= download)=0A+=20=20#:use-module=20(guix=20gexp)=0A=20=20=20#:use-module=20= (guix=20git-download)=0A=20=20=20#:use-module=20((guix=20licenses)=20= #:prefix=20license:)=0A=20=20=20#:use-module=20(guix=20packages)=0A=20=20= =20#:use-module=20(guix=20utils)=0A=20=20=20#:use-module=20(srfi=20= srfi-1)=0A=20=20=20#:use-module=20(srfi=20srfi-26)=0A+=20=20#:use-module=20= (ice-9=20match)=0A+=20=20#:use-module=20(ice-9=20optargs)=0A=20=20=20= #:use-module=20(ice-9=20regex))=0A=20=0A=20(define=20unifont=0A@@=20= -379,6=20+384,91=20@@=20menu=20to=20select=20one=20of=20the=20installed=20= operating=20systems.")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(scandir=20input-dir))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20#t)))))))))=0A=20=0A+(define-public=20= (make-grub-efi-netboot=20name=20subdir)=0A+=20=20"Make=20a=20= grub-efi-netboot=20package=20named=20NAME,=20which=20will=20be=20able=20= to=20boot=20over=0A+network=20via=20TFTP=20by=20accessing=20its=20files=20= in=20the=20SUBDIR=20of=20a=20TFTP=20root=20directory.=0A+This=20package=20= is=20also=20able=20to=20boot=20from=20local=20storage=20devices.=0A+=0A= +A=20bootloader-installer=20basically=20needs=20to=20copy=20the=20= package=20content=20into=20the=0A+bootloader-target=20directory,=20which=20= will=20usually=20be=20the=20TFTP=20root,=20as=0A+'grub-mknetdir'=20will=20= be=20invoked=20already=20during=20the=20package=20creation.=0A+=0A= +Alternatively=20the=20bootloader-target=20directory=20can=20be=20a=20= mounted=20EFI=20System=0A+Partition=20(ESP),=20or=20a=20similar=20= partition=20with=20a=20FAT=20file=20system,=20for=20booting=0A+from=20= local=20storage=20devices.=0A+=0A+The=20name=20of=20the=20GRUB=20EFI=20= binary=20will=20conform=20to=20the=20UEFI=20specification=20for=0A= +removable=20media.=20=20Depending=20on=20the=20system=20it=20will=20be=20= e.g.=20bootx64.efi=20or=0A+bootaa64.efi=20below=20SUBDIR.=0A+=0A+The=20= SUBDIR=20argument=20needs=20to=20be=20set=20to=20\"efi/boot\"=20to=20= create=20a=20package=20which=0A+conforms=20to=20the=20UEFI=20= specification=20for=20removable=20media.=0A+=0A+The=20SUBDIR=20argument=20= defaults=20to=20\"efi/Guix\",=20as=20it=20is=20also=20the=20case=20for=0A= +'grub-efi-bootloader'."=0A+=20=20(package=0A+=20=20=20=20(name=20name)=0A= +=20=20=20=20(version=20(package-version=20grub-efi))=0A+=20=20=20=20;;=20= Source=20is=20not=20needed,=20but=20it=20cannot=20be=20omitted.=0A+=20=20= =20=20(source=20#f)=0A+=20=20=20=20(build-system=20trivial-build-system)=0A= +=20=20=20=20(arguments=0A+=20=20=20=20=20(let*=20((system=20= (string-split=20(nix-system->gnu-triplet=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (or=20(%current-target-system)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (%current-system)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#\-))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20(arch=20(first=20system))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20(boot-efi=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(match=20= system=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20These=20are=20= the=20supportend=20systems=20and=20the=20names=20defined=20by=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20the=20UEFI=20standard=20for=20= removable=20media.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (("i686"=20_=20...)=20=20=20=20=20=20=20=20"/bootia32.efi")=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(("x86_64"=20_=20...)=20=20=20=20=20=20= "/bootx64.efi")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(("arm"=20= _=20...)=20=20=20=20=20=20=20=20=20"/bootarm.efi")=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(("aarch64"=20_=20...)=20=20=20=20=20= "/bootaa64.efi")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (("riscv"=20_=20...)=20=20=20=20=20=20=20"/bootriscv32.efi")=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(("riscv64"=20_=20...)=20=20=20=20=20= "/bootriscv64.efi")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= Other=20systems=20are=20not=20supported,=20although=20defined.=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20(("riscv128"=20_=20...)=20= "/bootriscv128.efi")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= (("ia64"=20_=20...)=20=20=20=20=20"/bootia64.efi")=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20((_=20...)=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20#f)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20(core-efi=20= (string-append=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20This=20is=20the=20arch=20dependent=20file=20name=20of=20= GRUB,=20e.g.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20i368-efi/core.efi=20or=20arm64-efi/core.efi.=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(match=20= arch=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20("i686"=20=20=20=20"i386")=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20("aarch64"=20"arm64")=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ("riscv"=20=20=20"riscv32")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(_=20=20=20=20=20=20=20=20=20arch))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "-efi/core.efi")))=0A+=20=20=20=20=20=20=20`(#:modules=20((guix=20build=20= utils))=0A+=20=20=20=20=20=20=20=20=20#:builder=0A+=20=20=20=20=20=20=20=20= =20(begin=0A+=20=20=20=20=20=20=20=20=20=20=20(use-modules=20(guix=20= build=20utils))=0A+=20=20=20=20=20=20=20=20=20=20=20(let*=20((bootloader=20= (assoc-ref=20%build-inputs=20"grub-efi"))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(net-dir=20(assoc-ref=20%outputs=20"out"))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(sub-dir=20= (string-append=20net-dir=20"/"=20,subdir=20"/"))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(boot-efi=20(string-append=20sub-dir=20= ,boot-efi))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (core-efi=20(string-append=20sub-dir=20,core-efi)))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Install=20GRUB,=20which=20refers=20to=20the=20= grub.cfg,=20with=20support=20for=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20encrypted=20partitions,=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (setenv=20"GRUB_ENABLE_CRYPTODISK"=20"y")=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20(invoke/quiet=20(string-append=20bootloader=20= "/bin/grub-mknetdir")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(string-append=20"--net-directory=3D"=20= net-dir)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(string-append=20"--subdir=3D"=20,subdir)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= These=20modules=20must=20be=20preloaded=20to=20allow=20booting=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20from=20an=20ESP=20or=20a=20similar=20partition=20with=20a=20FAT=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20file=20system.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(string-append=20"--modules=3Dpart_msdos=20= part_gpt=20fat"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Move=20= GRUB's=20core.efi=20to=20the=20removable=20media=20name.=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20(false-if-exception=20(delete-file=20boot-efi))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20(rename-file=20core-efi=20= boot-efi))))))=0A+=20=20=20=20(inputs=20`(("grub-efi"=20,grub-efi)))=0A+=20= =20=20=20(synopsis=20(package-synopsis=20grub-efi))=0A+=20=20=20=20= (description=20(package-description=20grub-efi))=0A+=20=20=20=20= (home-page=20(package-home-page=20grub-efi))=0A+=20=20=20=20(license=20= (package-license=20grub-efi))))=0A+=0A=20(define-public=20syslinux=0A=20=20= =20(let=20((commit=20"bb41e935cc83c6242de24d2271e067d76af3585c"))=0A=20=20= =20=20=20(package=0A= --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Disposition: attachment; filename=03-build-kconfig-add-new-module.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="03-build-kconfig-add-new-module.patch" 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(config-string->pair,=20(pair->config-string,=0A= defconfig->alist,=20modify-defconfig,=20verify-config):=20New=20file=20= with=20some=20new=0Afunctions=20for=20handling=20of=20defconfig=20and=20= .config=20files.=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=2088=20+++++++++-----------=0A=20= guix/build/kconfig.scm=20=20=20=20=20=20=20|=20=20184=20= ++++++++++++++++++++++++++++++++++++++++++=0A=203=20files=20changed,=20= 223=20insertions(+),=2050=20deletions(-)=0A=20create=20mode=20100644=20= guix/build/kconfig.scm=0A=0Adiff=20--git=20a/Makefile.am=20b/Makefile.am=0A= index=20e5363140fb..8f53bb54bc=20100644=0A---=20a/Makefile.am=0A+++=20= b/Makefile.am=0A@@=20-233,6=20+233,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=203dbd3c97e8..c4f23f239e=20100644=0A= ---=20a/gnu/packages/bootloaders.scm=0A+++=20= b/gnu/packages/bootloaders.scm=0A@@=20-760,8=20+760,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-779,8=20+780,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-791,9=20+795,19=20@@=20board-independent=20= tools.")))=0A=20=20=20=20=20=20=20=20=20=20(modify-phases=20= %standard-phases=0A=20=20=20=20=20=20=20=20=20=20=20=20(replace=20= 'configure=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda*=20(#:key=20= outputs=20make-flags=20#:allow-other-keys)=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(let=20((config-name=20(string-append=20,board=20= "_defconfig")))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (if=20(file-exists?=20(string-append=20"configs/"=20config-name))=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(apply=20invoke=20= "make"=20`(,@make-flags=20,config-name))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(let*=20((config-name=20(string-append=20,board=20= "_defconfig"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(config-file=20(string-append=20"configs/"=20config-name))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (defconfig=20,defconfig)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(configs=20',configs))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(when=20defconfig=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20Replace=20the=20board-specific=20= defconfig=20with=20the=20given=20one.=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(copy-file=20defconfig=20config-file))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20(file-exists?=20= config-file)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(begin=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(when=20configs=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(modify-defconfig=20config-file=20= configs))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(apply=20invoke=20"make"=20`(,@make-flags=20,config-name))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (verify-config=20".config"=20config-file))=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(begin=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(display=20"Invalid=20board=20= name.=20Valid=20board=20names=20are:"=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (current-error-port))=0A@@=20-847,7=20+861,11=20@@=20board-independent=20= tools.")))=0A=20=20=20(make-u-boot-package=20"malta"=20= "mips64el-linux-gnuabi64"))=0A=20=0A=20(define-public=20= u-boot-am335x-boneblack=0A-=20=20(let=20((base=20(make-u-boot-package=20= "am335x_evm"=20"arm-linux-gnueabihf")))=0A+=20=20(let=20((base=20= (make-u-boot-package=20"am335x_evm"=20"arm-linux-gnueabihf"=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20Patch=20out=20other=20device=20= trees=20to=20build=20image=20small=20enough=20to=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20fit=20within=20typical=20partitioning=20= schemes=20where=20the=20first=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20partition=20begins=20at=20sector=202048.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20#:configs=20'("CONFIG_OF_LIST=3D\"am335x-evm=20= am335x-boneblack\""))))=0A=20=20=20=20=20(package=0A=20=20=20=20=20=20=20= (inherit=20base)=0A=20=20=20=20=20=20=20(name=20= "u-boot-am335x-boneblack")=0A@@=20-856,25=20+874,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-904,20=20+910,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-968,25=20+964,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.=20=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..e32503c9c3=0A---=20/dev/null=0A+++=20= b/guix/build/kconfig.scm=0A@@=20-0,0=20+1,184=20@@=0A+;;;=20GNU=20Guix=20= ---=20Functional=20package=20management=20for=20GNU=0A+;;;=20Copyright=20= =C2=A9=202020=20Stefan=20=0A+;;;=0A+;;;=20= This=20file=20is=20part=20of=20GNU=20Guix.=0A+;;;=0A+;;;=20GNU=20Guix=20= is=20free=20software;=20you=20can=20redistribute=20it=20and/or=20modify=20= it=0A+;;;=20under=20the=20terms=20of=20the=20GNU=20General=20Public=20= License=20as=20published=20by=0A+;;;=20the=20Free=20Software=20= Foundation;=20either=20version=203=20of=20the=20License,=20or=20(at=0A= +;;;=20your=20option)=20any=20later=20version.=0A+;;;=0A+;;;=20GNU=20= Guix=20is=20distributed=20in=20the=20hope=20that=20it=20will=20be=20= useful,=20but=0A+;;;=20WITHOUT=20ANY=20WARRANTY;=20without=20even=20the=20= implied=20warranty=20of=0A+;;;=20MERCHANTABILITY=20or=20FITNESS=20FOR=20= A=20PARTICULAR=20PURPOSE.=20=20See=20the=0A+;;;=20GNU=20General=20Public=20= License=20for=20more=20details.=0A+;;;=0A+;;;=20You=20should=20have=20= received=20a=20copy=20of=20the=20GNU=20General=20Public=20License=0A+;;;=20= along=20with=20GNU=20Guix.=20=20If=20not,=20see=20= .=0A+=0A+(define-module=20(guix=20build=20= kconfig)=0A+=20=20#:use-module=20=20(ice-9=20rdelim)=0A+=20=20= #:use-module=20=20(ice-9=20regex)=0A+=20=20#:use-module=20=20(srfi=20= srfi-1)=0A+=20=20#:use-module=20=20(srfi=20srfi-26)=0A+=20=20#:export=20= (modify-defconfig=0A+=20=20=20=20=20=20=20=20=20=20=20=20verify-config))=0A= +=0A+;;=20Commentary:=0A+;;=0A+;;=20Builder-side=20code=20to=20modify=20= configurations=20for=20the=20Kconfig=20build=20system=20as=0A+;;=20used=20= by=20Linux=20and=20U-Boot.=0A+;;=0A+;;=20Code:=0A+=0A+(define=20= (config-string->pair=20config-string)=0A+=20=20"Parse=20a=20= configuration=20string=20like=20\"CONFIG_EXAMPLE=3Dm\"=20into=20a=20= key-value=20pair.=0A+An=20error=20is=20thrown=20for=20invalid=20= configurations.=0A+=0A+\"CONFIG_A=3Dy\"=20=20=20=20=20=20=20=20=20=20=20=20= ->=20'(\"CONFIG_A\"=20.=20\"y\")=0A+\"CONFIG_B=3D\\\"\\\"\"=20=20=20=20=20= =20=20=20=20->=20'(\"CONFIG_B\"=20.=20\"\\\"\\\"\")=0A+\"#=20CONFIG_E=20= is=20not=20set\"=20->=20'(\"CONFIG_E\"=20.=20#f)=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+\"#=20Any=20comment\"=20=20=20=20=20=20=20=20= =20->=20'(#f=20.=20\"#=20Any=20comment\")=0A+\"\"=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20->=20'(#f=20.=20\"\")=0A+\"#=20= CONFIG_E=3Dy\"=20=20=20=20=20=20=20=20=20=20->=20(error=20\"Invalid=20= configuration\")=0A+\"CONFIG_E=20is=20not=20set\"=20=20=20->=20(error=20= \"Invalid=20configuration\")=0A+\"Anything=20else\"=20=20=20=20=20=20=20=20= =20->=20(error=20\"Invalid=20configuration\")"=0A+=20=20(define=20= config-regexp=0A+=20=20=20=20(make-regexp=0A+=20=20=20=20=20;;=20= (match:substring=20(string-match=20"=3D(.*)"=20"=3D")=201)=20returns=20= "",=20but=20the=0A+=20=20=20=20=20;;=20pattern=20"=3D(.+)?"=20makes=20it=20= return=20#f=20instead.=20=20For=20a=20"CONFIG_A=3D"=20we=20like=0A+=20=20= =20=20=20;;=20to=20get=20#f,=20which=20later=20emits=20"#=20=E2=80=A6=20= is=20not=20set".=0A+=20=20=20=20=20"^=20*(#[\\t=20= ]*)?(CONFIG_[a-zA-Z0-9_]+)([\\t=20]*=3D[\\t=20]*(.+)?|([\\t=20]+is[\\t=20= ]+not[\\t=20]+set))?$"))=0A+=0A+=20=20(define=20config-comment-regexp=0A= +=20=20=20=20(make-regexp=20"^(|=20[\\t=20]*|=20*#.*)$"))=0A+=0A+=20=20= (let=20((match=20(regexp-exec=20config-regexp=20(string-trim-right=20= config-string))))=0A+=20=20=20=20(if=20match=0A+=20=20=20=20=20=20=20=20= (let*=20((comment=20(match:substring=20match=201))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(key=20(match:substring=20match=202))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(unset=20(match:substring=20match=20= 5))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(value=20(and=20(not=20= comment)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(not=20unset)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(match:substring=20match=20= 4))))=0A+=20=20=20=20=20=20=20=20=20=20(if=20(eq?=20(not=20comment)=20= (not=20unset))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20The=20= key=20is=20uncommented=20and=20set=20or=20commented=20and=20unset.=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(cons=20key=20value)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20;;=20The=20key=20is=20set=20or=20unset=20= ambigiously.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(error=20= (format=20#f=20"Invalid=20configuration,=20did=20you=20mean=20\"~a\"?"=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(pair->config-string=20(cons=20key=20#f)))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20config-string)))=0A+=20= =20=20=20=20=20=20=20;;=20This=20is=20not=20a=20valid=20or=20ambigious=20= config-string,=20but=20mayby=20a=20comment.=0A+=20=20=20=20=20=20=20=20= (if=20(regexp-exec=20config-comment-regexp=20config-string)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20;;=20We=20keep=20valid=20comments.=0A+=20=20=20=20= =20=20=20=20=20=20=20=20(cons=20#f=20config-string)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20(error=20"Invalid=20configuration"=20= config-string)))))=0A+=0A+(define=20(pair->config-string=20pair)=0A+=20=20= "Convert=20a=20PAIR=20back=20to=20a=20config-string."=0A+=20=20(let*=20= ((key=20(first=20pair))=0A+=20=20=20=20=20=20=20=20=20(value=20(cdr=20= pair)))=0A+=20=20=20=20(if=20(string?=20key)=0A+=20=20=20=20=20=20=20=20= (if=20(string?=20value)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (string-append=20key=20"=3D"=20value)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20(string-append=20"#=20"=20key=20"=20is=20not=20set"))=0A+=20=20=20=20=20= =20=20=20value)))=0A+=0A+(define=20(defconfig->alist=20defconfig)=0A+=20=20= "Convert=20the=20content=20of=20a=20DEFCONFIG=20(or=20.config)=20file=20= into=20an=20alist."=0A+=20=20(with-input-from-file=20defconfig=0A+=20=20=20= =20(lambda=20()=0A+=20=20=20=20=20=20(let=20loop=20((alist=20'())=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(line=20(read-line)))=0A+=20= =20=20=20=20=20=20=20(if=20(eof-object?=20line)=0A+=20=20=20=20=20=20=20=20= =20=20=20=20;;=20Building=20the=20alist=20is=20done,=20now=20check=20for=20= duplicates.=0A+=20=20=20=20=20=20=20=20=20=20=20=20(let=20loop=20((keys=20= (map=20first=20(filter=20first=20alist)))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(duplicates=20'()))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(if=20(null?=20keys)=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20The=20search=20for=20duplicates=20= is=20done.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= Return=20the=20alist=20or=20throw=20an=20error=20on=20duplicates.=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20(null?=20= duplicates)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20alist=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(error=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(format=20#f=20"Duplicate=20configurations=20in=20~a"=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=20duplicates))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20;;=20Continue=20the=20search=20for=20duplicates.=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(loop=20(cdr=20keys)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (member=20(first=20keys)=20(cdr=20keys)=20equal?)=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cons=20= (first=20keys)=20duplicates)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20duplicates))))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Build=20the=20alist.=0A+=20=20=20=20=20=20=20=20= =20=20=20=20(loop=20(cons=20(config-string->pair=20line)=20alist)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(read-line)))))))=0A+=0A= +(define=20(modify-defconfig=20defconfig=20configs)=0A+=20=20"This=20= function=20can=20modify=20a=20given=20DEFCONFIG=20(or=20.config)=20file=20= by=20adding,=0A+changing=20or=20removing=20the=20list=20of=20strings=20= in=20CONFIGS.=20=20This=20allows=20customization=0A+of=20Kconfig=20based=20= projects=20like=20the=20kernel=20Linux=20or=20the=20bootloader=20'Das=20= U-Boot'.=0A+=0A+These=20are=20examples=20for=20CONFIGS=20to=20add,=20= change=20or=20remove=20configurations=20to/from=0A+DEFCONFIG:=0A+=0A= +'(\"CONFIG_A=3D\\\"a\\\"\"=0A+=20=20\"CONFIG_B=3D0\"=0A+=20=20= \"CONFIG_C=3Dy\"=0A+=20=20\"CONFIG_D=3Dm\"=0A+=20=20\"CONFIG_E=3D\"=0A+=20= =20\"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(let*=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-pairs=20(map=20config-string->pair=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (append-map=20(cut=20string-split=20<>=20=20#\newline)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(if=20(string?=20configs)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(list=20configs)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20configs))))=0A+=20=20=20=20=20= =20=20=20=20;;=20Generate=20a=20blocklist=20from=20all=20valid=20keys=20= in=20config-pairs.=0A+=20=20=20=20=20=20=20=20=20(blocklist=20(delete=20= #f=20(map=20first=20config-pairs)))=0A+=20=20=20=20=20=20=20=20=20;;=20= Generate=20an=20alist=20from=20the=20defconifg=20without=20the=20keys=20= in=20blocklist.=0A+=20=20=20=20=20=20=20=20=20(filtered-defconfig-pairs=20= (remove=20(lambda=20(pair)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(member=20(first=20pair)=20blocklist))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(defconfig->alist=20defconfig))))=0A= +=20=20=20=20(with-output-to-file=20defconfig=0A+=20=20=20=20=20=20= (lambda=20()=0A+=20=20=20=20=20=20=20=20(for-each=0A+=20=20=20=20=20=20=20= =20=20=20=20(lambda=20(pair)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (display=20(pair->config-string=20pair))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20(newline))=0A+=20=20=20=20=20=20=20=20=20=20=20(append=20= filtered-defconfig-pairs=20config-pairs))))))=0A+=0A+(define=20= (verify-config=20config=20defconfig)=0A+=20=20"Verify=20that=20the=20= CONFIG=20file=20contains=20all=20configurations=20from=20the=20DEFCONFIG=0A= +file=20and=20return=20#t=20in=20this=20case.=20Otherwise=20throw=20an=20= error=20with=20the=20mismatching=0A+keys=20and=20their=20values."=0A+=20=20= (let*=20((config-pairs=20(defconfig->alist=20config))=0A+=20=20=20=20=20=20= =20=20=20(defconfig-pairs=20(defconfig->alist=20defconfig))=0A+=20=20=20=20= =20=20=20=20=20(mismatching-pairs=0A+=20=20=20=20=20=20=20=20=20=20= (remove=20(lambda=20(pair)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Remove=20all=20configurations,=20whose=20values=20= are=20#f=20and=20whose=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20keys=20are=20not=20in=20config-pairs,=20as=20not=20in=20= config-pairs=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20means=20unset,=20=E2=80=A6=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(and=20(not=20(cdr=20pair))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20= (assoc-ref=20config-pairs=20(first=20pair)))))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20;;=20=E2=80=A6=20from=20the=20= defconfig-pairs=20different=20to=20config-pairs.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(lset-difference=20equal?=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20;;=20Remove=20comments=20by=20filtering=20with=20= first.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(filter=20first=20= defconfig-pairs)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20config-pairs))))=0A+=20= =20=20=20(if=20(null?=20mismatching-pairs)=0A+=20=20=20=20=20=20=20=20#t=0A= +=20=20=20=20=20=20=20=20(error=20(format=20#f=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"Mismatching=20= configurations=20in=20~a=20and=20~a"=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20config=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20defconfig)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(map=20(lambda=20(mismatching-pair)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(let*=20((key=20= (first=20mismatching-pair))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(defconfig-value=20(cdr=20= mismatching-pair))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(config-value=20(assoc-ref=20= config-pairs=20key)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(cons=20key=20(list=20(list=20config-value=20= defconfig-value)))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20mismatching-pairs)))))=0A= --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Disposition: attachment; filename=04-gnu-bootloader-add-u-boot.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="04-gnu-bootloader-add-u-boot.patch" Content-Transfer-Encoding: 7bit gnu: bootloader: Add U-Boot packages for Raspberry Pi models. From: Stefan * gnu/packages/bootloader.scm (make-u-boot-package): Add keyword parameters 'name-suffix' and 'append-description'. (make-u-boot-bin-package): New function to make minimal packages. (%u-boot-rpi-efi-configs): New helper list with config strings. (%u-boot-rpi-description-32-bit, %u-boot-rpi-description-64-bit, %u-boot-rpi-efi-description, %u-boot-rpi-efi-description-32-bit): New helper strings. (u-boot-rpi-2{,-efi,-bin,-efi-bin}, u-boot-rpi-3-32b{,-efi,-bin,-efi-bin}, u-boot-rpi-4-32b{,-efi,-bin,-efi-bin}, u-boot-rpi-arm64{,-efi,-bin,-efi-bin}): New packages. --- gnu/packages/bootloaders.scm | 198 +++++++++++++++++++++++++++++++++--------- 1 file changed, 155 insertions(+), 43 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index c4f23f239e..16112c7e4b 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -756,13 +756,21 @@ def test_ctrl_c")) (setenv "PAGER" "cat") (apply invoke "make" test-target make-flags)))) '())))) - (description "U-Boot is a bootloader used mostly for ARM boards. It -also initializes the boards (RAM etc). This package provides its -board-independent tools."))) - -(define*-public (make-u-boot-package board triplet #:key defconfig configs) - "Returns a u-boot package for BOARD cross-compiled for TRIPLET with the -optional DEFCONFIG file and optional configuration changes from CONFIGS." + (description (string-append (package-description u-boot) + " This package provides board-independent +tools of U-Boot.")))) + +(define*-public (make-u-boot-package board + triplet + #:key + defconfig + configs + name-suffix + append-description) + "Returns a U-Boot package for BOARD cross-compiled for TRIPLET with the +optional DEFCONFIG file and optional configuration changes from CONFIGS. +A NAME-SUFFIX will be appended to the package name. An APPEND-DESCRIPTION will +be appended to the package description." (let ((same-arch? (lambda () (string=? (%current-system) (gnu-triplet->nix-system triplet))))) @@ -770,7 +778,12 @@ optional DEFCONFIG file and optional configuration changes from CONFIGS." (inherit u-boot) (name (string-append "u-boot-" (string-replace-substring (string-downcase board) - "_" "-"))) + "_" "-") + (or name-suffix ""))) + (description (if append-description + (string-append (package-description u-boot) + "\n\n" append-description) + (package-description u-boot))) (native-inputs `(,@(if (not (same-arch?)) `(("cross-gcc" ,(cross-gcc triplet)) @@ -861,20 +874,15 @@ optional DEFCONFIG file and optional configuration changes from CONFIGS." (make-u-boot-package "malta" "mips64el-linux-gnuabi64")) (define-public u-boot-am335x-boneblack - (let ((base (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf" - ;; Patch out other device trees to build image small enough to - ;; fit within typical partitioning schemes where the first - ;; partition begins at sector 2048. - #:configs '("CONFIG_OF_LIST=\"am335x-evm am335x-boneblack\"")))) - (package - (inherit base) - (name "u-boot-am335x-boneblack") - (description "U-Boot is a bootloader used mostly for ARM boards. It -also initializes the boards (RAM etc). - -This U-Boot is built for the BeagleBone Black, which was removed upstream, -adjusted from the am335x_evm build with several device trees removed so that -it fits within common partitioning schemes.")))) + (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf" + ;; Patch out other device trees to build an image small enough to fit within + ;; typical partitioning schemes where the first partition begins at sector + ;; 2048. + #:configs '("CONFIG_OF_LIST=\"am335x-evm am335x-boneblack\"") + #:name-suffix "-boneblack" + #:append-description "This U-Boot is built for the BeagleBone Black, which +was removed upstream, adjusted from the am335x_evm build with several device +trees removed so that it fits within common partitioning schemes.")) (define-public u-boot-am335x-evm (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf")) @@ -929,7 +937,14 @@ it fits within common partitioning schemes.")))) (define-public u-boot-nintendo-nes-classic-edition (let ((base (make-u-boot-package "Nintendo_NES_Classic_Edition" - "arm-linux-gnueabihf"))) + "arm-linux-gnueabihf" + #:append-description "This version is for +the Nintendo NES Classic Edition. It is assumed that you have added a serial +port to pins PB0 and PB1 as described on +@url{https://linux-sunxi.org/Nintendo_NES_Classic_Edition}. + +In order to use FEL mode on the device, hold the Reset button on the +device while it's being turned on (and a while longer)."))) (package (inherit base) ;; Starting with 2019.01, FEL doesn't work anymore on A33. @@ -944,15 +959,6 @@ it fits within common partitioning schemes.")))) "0znkwljfwwn4y7j20pzz4ilqw8znphrfxns0x1lwdzh3xbr96z3k")) (patches (search-patches "u-boot-nintendo-nes-serial.patch")))) - (description "U-Boot is a bootloader used mostly for ARM boards. It -also initializes the boards (RAM etc). - -This version is for the Nintendo NES Classic Edition. It is assumed that -you have added a serial port to pins PB0 and PB1 as described on -@url{https://linux-sunxi.org/Nintendo_NES_Classic_Edition}. - -In order to use FEL mode on the device, hold the Reset button on the -device while it's being turned on (and a while longer).") (native-inputs `(("python" ,python-2) ,@(package-native-inputs base)))))) @@ -964,17 +970,13 @@ device while it's being turned on (and a while longer).") (make-u-boot-package "mx6cuboxi" "arm-linux-gnueabihf")) (define-public u-boot-novena - (let ((base (make-u-boot-package "novena" "arm-linux-gnueabihf" - ;; Patch configuration to disable loading u-boot.img from FAT - ;; partition, allowing it to be installed at a device offset. - #:configs '("CONFIG_SPL_FS_FAT=")))) - (package - (inherit base) - (description "U-Boot is a bootloader used mostly for ARM boards. It -also initializes the boards (RAM etc). - -This U-Boot is built for Novena. Be advised that this version, contrary -to Novena upstream, does not load u-boot.img from the first partition.")))) + (make-u-boot-package "novena" "arm-linux-gnueabihf" + ;; Patch configuration to disable loading u-boot.img from FAT partition, + ;; allowing it to be installed at a device offset. + #:configs '("CONFIG_SPL_FS_FAT=") + #:append-description "This U-Boot is built for Novena. Be advised that this +version, contrary to Novena upstream, does not load u-boot.img from the first +partition.")) (define-public u-boot-cubieboard (make-u-boot-package "Cubieboard" "arm-linux-gnueabihf")) @@ -1130,6 +1132,116 @@ BOOT_TARGET_NVME(func) \\ `(("firmware" ,arm-trusted-firmware-rk3399) ,@(package-native-inputs base)))))) +(define*-public (make-u-boot-bin-package u-boot-package + #:key + (u-boot-bin "u-boot.bin")) + "Return a package with a single U-BOOT-BIN file from the U-BOOT-PACKAGE. +The package name will be that of the U-BOOT package suffixed with \"-bin\"." + (package + (name (string-append (package-name u-boot-package) "-bin")) + (version (package-version u-boot-package)) + (source #f) + (build-system trivial-build-system) + (arguments + `(#:builder + (begin + (let ((out (assoc-ref %outputs "out"))) + (mkdir out) + (symlink (string-append (assoc-ref %build-inputs "u-boot") + "/libexec/" + ,u-boot-bin) + (string-append out "/" ,u-boot-bin)))))) + (inputs `(("u-boot" ,u-boot-package))) + (home-page (package-home-page u-boot-package)) + (synopsis (package-synopsis u-boot-package)) + (description (format #f (string-append + (package-description u-boot-package) + "\n\nThis package only contains the file ~a.") + u-boot-bin)) + (license (package-license u-boot-package)))) + +(define-public %u-boot-rpi-efi-configs + '("CONFIG_OF_EMBED=" + "CONFIG_OF_BOARD=y" + "CONFIG_BOOTDELAY=1")) + +(define %u-boot-rpi-description-32-bit + "This is a 32-bit build of U-Boot.") + +(define %u-boot-rpi-description-64-bit + "This is a common 64-bit build of U-Boot for all 64-bit capable Raspberry Pi +variants.") + +(define %u-boot-rpi-efi-description + "It allows network booting and uses the device-tree from the firmware, +allowing the usage of overlays. It can act as an EFI firmware for the +grub-efi-netboot-removable-bootloader.") + +(define %u-boot-rpi-efi-description-32-bit + (string-append %u-boot-rpi-efi-description " " + %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-2 + (make-u-boot-package "rpi_2" "arm-linux-gnueabihf" + #:append-description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-3-32b + (make-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf" + #:append-description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-4-32b + (make-u-boot-package "rpi_4_32b" "arm-linux-gnueabihf" + #:append-description %u-boot-rpi-description-32-bit)) + +(define-public u-boot-rpi-arm64 + (make-u-boot-package "rpi_arm64" "aarch64-linux-gnu" + #:append-description %u-boot-rpi-description-64-bit)) + +(define-public u-boot-rpi-2-efi + (make-u-boot-package "rpi_2" "arm-linux-gnueabihf" + #:name-suffix "-efi" + #:configs %u-boot-rpi-efi-configs + #:append-description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-3-32b-efi + (make-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf" + #:name-suffix "-efi" + #:configs %u-boot-rpi-efi-configs + #:append-description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-4-32b-efi + (make-u-boot-package "rpi_4_32b" "arm-linux-gnueabihf" + #:name-suffix "-efi" + #:configs %u-boot-rpi-efi-configs + #:append-description %u-boot-rpi-efi-description-32-bit)) + +(define-public u-boot-rpi-arm64-efi + (make-u-boot-package "rpi_arm64""aarch64-linux-gnu" + #:name-suffix "-efi" + #:configs %u-boot-rpi-efi-configs + #:append-description (string-append + %u-boot-rpi-efi-description " " + %u-boot-rpi-description-64-bit))) + +(define-public u-boot-rpi-2-bin (make-u-boot-bin-package u-boot-rpi-2)) + +(define-public u-boot-rpi-3_32b-bin (make-u-boot-bin-package u-boot-rpi-3-32b)) + +(define-public u-boot-rpi-4_32b-bin (make-u-boot-bin-package u-boot-rpi-4-32b)) + +(define-public u-boot-rpi-arm64-bin (make-u-boot-bin-package u-boot-rpi-arm64)) + +(define-public u-boot-rpi-2-efi-bin (make-u-boot-bin-package u-boot-rpi-2-efi)) + +(define-public u-boot-rpi-3-32b-efi-bin + (make-u-boot-bin-package u-boot-rpi-3-32b-efi)) + +(define-public u-boot-rpi-4-32b-efi-bin + (make-u-boot-bin-package u-boot-rpi-4-32b-efi)) + +(define-public u-boot-rpi-arm64-efi-bin + (make-u-boot-bin-package u-boot-rpi-arm64-efi)) + (define-public vboot-utils (package (name "vboot-utils") --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Disposition: attachment; filename=05-gnu-linux-new-function-to.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="05-gnu-linux-new-function-to.patch" Content-Transfer-Encoding: quoted-printable gnu:=20linux:=20New=20function=20to=20modify=20the=20configuration=20of=20= a=20Linux=20kernel.=0A=0AFrom:=20Stefan=20=0A= =0A*=20gnu/packages/linux.scm=20(system->linux-srcarch):=20New=20= function=20to=20return=20the=0Arelevent=20folder=20name=20below=20arch/=20= in=20the=20Linux=20source=20code.=0A(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=20124=20= ++++++++++++++++++++++++++++++++++++++++++++++++=0A=201=20file=20= changed,=20124=20insertions(+)=0A=0Adiff=20--git=20= a/gnu/packages/linux.scm=20b/gnu/packages/linux.scm=0Aindex=20= b00b46be47..4febdbdece=20100644=0A---=20a/gnu/packages/linux.scm=0A+++=20= b/gnu/packages/linux.scm=0A@@=20-185,8=20+185,27=20@@=0A=20=20=20= #:use-module=20(srfi=20srfi-2)=0A=20=20=20#:use-module=20(srfi=20= srfi-26)=0A=20=20=20#:use-module=20(ice-9=20match)=0A+=20=20#:use-module=20= (ice-9=20optargs)=0A=20=20=20#:use-module=20(ice-9=20regex))=0A=20=0A= +(define-public=20(linux-srcarch)=0A+=20=20"Return=20the=20linux=20= SRCARCH=20name,=20which=20is=20set=20in=20the=20toplevel=20Makefile=20of=0A= +Linux=20and=20denotes=20the=20architecture=20specific=20directory=20= name=20below=20arch/=20in=20its=0A+source=20code.=20=20Some=20few=20= architectures=20share=20a=20common=20folder.=20=20It=20resembles=20the=0A= +definition=20of=20SRCARCH=20based=20on=20ARCH=20in=20the=20Makefile=20= and=20may=20be=20used=20to=20place=20a=0A+defconfig=20file=20in=20the=20= proper=20path."=0A+=20=20(let=20((linux-arch=20= (platform-linux-architecture=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(lookup-platform-by-target-or-system=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20= (%current-target-system)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(%current-system))))))=0A+=20=20=20= =20(match=20linux-arch=0A+=20=20=20=20=20=20("i386"=20=20=20=20"x86")=0A= +=20=20=20=20=20=20("x86_64"=20=20"x86")=0A+=20=20=20=20=20=20("sparc32"=20= "sparc")=0A+=20=20=20=20=20=20("sparc64"=20"sparc")=0A+=20=20=20=20=20=20= ("sh64"=20=20=20=20"sh")=0A+=20=20=20=20=20=20(_=20=20=20=20=20=20=20=20=20= linux-arch))))=0A+=0A=20(define-public=20(system->defconfig=20system)=0A=20= =20=20"Some=20systems=20(notably=20powerpc-linux)=20require=20a=20= special=20target=20for=20kernel=0A=20defconfig.=20=20Return=20the=20= appropriate=20make=20target=20if=20applicable,=20otherwise=20return=0A@@=20= -1180,6=20+1199,111=20@@=20It=20has=20been=20modified=20to=20remove=20= all=20non-free=20binary=20blobs.")=0A=20=20=20=20=20=20=20(inputs=20= (modify-inputs=20(package-inputs=20base-linux-libre)=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(prepend=20cpio))))))=0A=20=0A+=0C=0A= +;;;=0A+;;;=20Linux=20kernel=20customization=20functions.=0A+;;;=0A+=0A= +(define*-public=20(modify-linux=20#:key=20name=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(linux=20linux-libre)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= source=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20defconfig=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(configs=20"")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= extra-version)=0A+=20=20"Make=20a=20Linux=20package=20NAME=20as=20a=20= modification=20of=20another=20LINUX=20package.=0A+=0A+If=20NAME=20is=20= not=20given,=20then=20it=20defaults=20to=20the=20same=20name=20as=20the=20= LINUX=20package.=0A+=0A+Unless=20SOURCE=20is=20given=20the=20source=20of=20= LINUX=20is=20used.=0A+=0A+A=20DEFCONFIG=20file=20to=20be=20used=20can=20= be=20given=20as=20an=20origin,=20as=20a=20file=20like=20object=0A= +(file-append,=20local-file=20etc.),=20or=20as=20a=20string=20with=20the=20= name=20of=20a=20defconfig=20file=0A+available=20in=20the=20Linux=20= sources.=20=20If=20DEFCONFIG=20is=20not=20given,=20then=20a=20defconfig=0A= +file=20will=20be=20saved=20from=20the=20LINUX=20package=20= configuration.=0A+=0A+Additional=20CONFIGS=20will=20be=20used=20to=20= modify=20the=20given=20or=20saved=20defconfig,=20which=0A+will=20finally=20= be=20used=20to=20build=20Linux.=0A+=0A+CONFIGS=20can=20be=20a=20list=20= of=20strings,=20with=20one=20configuration=20per=20line.=20=20The=20= usual=0A+defconfig=20syntax=20has=20to=20be=20used,=20but=20there=20is=20= a=20special=20extension=20to=20ease=20the=0A+removal=20of=20= configurations.=20=20Comment=20lines=20are=20supported=20as=20well.=0A+=0A= +Here=20is=20an=20explaining=20usage=20example:=0A+=0A+=20=20'(;;=20This=20= string=20defines=20the=20version=20tail=20in=20'uname=20-r'.=0A+=20=20=20= =20\"CONFIG_LOCALVERSION=3D\\\"-handcrafted\\\"=0A+=20=20=20=20;;=20This=20= '#=20CONFIG_=E2=80=A6=20is=20not=20set'=20syntax=20has=20to=20match=20= exactly!=0A+=20=20=20=20\"#=20CONFIG_BOOT_CONFIG=20is=20not=20set\"=0A+=20= =20=20=20\"CONFIG_NFS_SWAP=3Dy\"=0A+=20=20=20=20;;=20This=20is=20a=20= multiline=20configuration:=0A+=20=20=20=20\"CONFIG_E1000=3Dy=0A+#=20This=20= is=20a=20comment,=20below=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=20(replace=20'configure=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(lambda*=20(#:key=20inputs=20#:allow-other-keys=20#:rest=20= arguments)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setenv=20= "EXTRAVERSION"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20#$(and=20extra-version=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20= (string-null?=20extra-version))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(string-append=20= "-"=20extra-version)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (let*=20((configs=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(string-append=20"arch/"=20#$(linux-srcarch)=20= "/configs/"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(guix_defconfig=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(string-append=20configs=20= "guix_defconfig")))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20#$(cond=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20((not=20defconfig)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20#~(begin=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20;;=20Call=20the=20original=20'configure=20= phase.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(apply=20(assoc-ref=20#$phases=20'configure)=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=20= =20;;=20Save=20a=20defconfig=20file.=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(invoke=20"make"=20= "savedefconfig")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Move=20the=20saved=20defconfig=20to=20the=20= proper=20location.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(rename-file=20"defconfig"=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20guix_defconfig)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20((string?=20defconfig)=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Use=20another=20= existing=20defconfig=20from=20the=20Linux=20sources.=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20#~(rename-file=20= (string-append=20configs=20#$defconfig)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20guix_defconfig))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(else=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Copy=20the=20defconfig=20input=20to=20the=20proper=20= location.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20#~(copy-file=20(assoc-ref=20inputs=20"guix_defconfig")=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20guix_defconfig)))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(chmod=20guix_defconfig=20#o644)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(modify-defconfig=20guix_defconfig=20= '#$configs)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (invoke=20"make"=20"guix_defconfig")=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(verify-config=20".config"=20guix_defconfig))))))))=0A= +=20=20=20=20(native-inputs=0A+=20=20=20=20=20(append=20(if=20(or=20(not=20= defconfig)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(string?=20defconfig))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20'()=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20The=20= defconfig=20should=20be=20an=20origin=20or=20file-like=20object.=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20`(("guix_defconfig"=20= ,defconfig)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (package-native-inputs=20linux)))))=0A+=0A+(define-public=20= (make-defconfig=20uri=20sha256-as-base32)=0A+=20=20(origin=20(method=20= url-fetch)=0A+=20=20=20=20=20=20=20=20=20=20(uri=20uri)=0A+=20=20=20=20=20= =20=20=20=20=20(sha256=20(base32=20sha256-as-base32))))=0A=20=0A=20=0C=0A= =20;;;=0A= --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Disposition: attachment; filename=06-gnu-raspberry-pi-add-defconfig.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="06-gnu-raspberry-pi-add-defconfig.patch" Content-Transfer-Encoding: quoted-printable gnu:=20raspberry-pi:=20Add=20defconfig=20objects=20to=20build=20= customized=20Linux=20kernels.=0A=0AFrom:=20Stefan=20= =0A=0Agnu/packages/raspberry-pi.scm=20= (make-raspi-defconig):=20New=20function=20to=20make=0Adownloaded=20= defconfig=20objects=20from=20the=20Linux=20repository=20of=20the=20= Raspberry=20Pi=0AFoundation.=0A(%bcm2709-defconfig,=20= %bcm2711-defconfig,=20%bcm2711-defconfig-64,=0A%bcmrpi3-defconfig):=20= New=20variables=20containing=20defconfig=20objects=20to=20build=0ALinux=20= kernels=20customized=20for=20Raspberry=20Pi=20single=20board=20= computers.=0A---=0A=20gnu/packages/raspberry-pi.scm=20|=20=20=2037=20= ++++++++++++++++++++++++++++++++++++-=0A=201=20file=20changed,=2036=20= insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/gnu/packages/raspberry-pi.scm=20b/gnu/packages/raspberry-pi.scm=0A= index=20bb38b8b218..8949d2237a=20100644=0A---=20= a/gnu/packages/raspberry-pi.scm=0A+++=20b/gnu/packages/raspberry-pi.scm=0A= @@=20-1,5=20+1,6=20@@=0A=20;;;=20GNU=20Guix=20---=20Functional=20package=20= management=20for=20GNU=0A=20;;;=20Copyright=20=C2=A9=202020=20Danny=20= Milosavljevic=20=0A+;;;=20Copyright=20=C2=A9=20= 2021=20Stefan=20=0A=20;;;=0A=20;;;=20This=20= file=20is=20part=20of=20GNU=20Guix.=0A=20;;;=0A@@=20-25,9=20+26,10=20@@=0A= =20=20=20#:use-module=20(gnu=20packages=20commencement)=0A=20=20=20= #:use-module=20(gnu=20packages=20cross-base)=0A=20=20=20#:use-module=20= (gnu=20packages=20documentation)=0A+=20=20#:use-module=20(gnu=20packages=20= embedded)=0A=20=20=20#:use-module=20(gnu=20packages=20file)=0A=20=20=20= #:use-module=20(gnu=20packages=20gcc)=0A-=20=20#:use-module=20(gnu=20= packages=20embedded)=0A+=20=20#:use-module=20(gnu=20packages=20linux)=0A=20= =20=20#:use-module=20(guix=20build-system=20gnu)=0A=20=20=20#:use-module=20= (guix=20download)=0A=20=20=20#:use-module=20(guix=20git-download)=0A@@=20= -235,3=20+237,36=20@@=20Raspberry=20Pi.=20=20Note:=20It=20does=20not=20= work=20on=20Raspberry=20Pi=201.")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(install-file=20"arm64.bin"=20libexec)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20#t))))))))=0A=20=20=20=20=20(supported-systems=20= '("aarch64-linux"))))=0A+=0A+(define=20(make-raspi-defconfig=20arch=20= defconfig=20sha256-as-base32)=0A+=20=20"Make=20for=20the=20architecture=20= ARCH=20a=20file-like=20object=20from=20the=20DEFCONFIG=20file=0A+with=20= the=20hash=20SHA256-AS-BASE32.=20=20This=20object=20can=20be=20used=20as=20= the=20#:defconfig=0A+argument=20of=20the=20function=20(modify-linux)."=0A= +=20=20(make-defconfig=0A+=20=20=20(string-append=0A+=20=20=20=20;;=20= This=20is=20from=20commit=207838840=20on=20branch=20rpi-5.18.y,=0A+=20=20= =20=20;;=20see=20https://github.com/raspberrypi/linux/tree/rpi-5.18.y/=0A= +=20=20=20=20;;=20and=20= https://github.com/raspberrypi/linux/commit/7838840b5606a2051b31da4c598466= df7b1c3005=0A+=20=20=20=20= "https://raw.githubusercontent.com/raspberrypi/linux/7838840b5606a2051b31d= a4c598466df7b1c3005/arch/"=0A+=20=20=20=20arch=20"/configs/"=20= defconfig)=0A+=20=20=20sha256-as-base32))=0A+=0A+(define-public=20= %bcm2709-defconfig=0A+=20=20(make-raspi-defconfig=0A+=20=20=20"arm"=20= "bcm2709_defconfig"=0A+=20=20=20= "1hcxmsr131f92ay3bfglrggds8ajy904yj3vw7c42i4c66256a79"))=0A+=0A= +(define-public=20%bcm2711-defconfig=0A+=20=20(make-raspi-defconfig=0A+=20= =20=20"arm"=20"bcm2711_defconfig"=0A+=20=20=20= "1n7g5yq0hdp8lh0x6bfxph2ff8yn8zisdj3qg0gbn83j4v8i1zbd"))=0A+=0A= +(define-public=20%bcm2711-defconfig-64=0A+=20=20(make-raspi-defconfig=0A= +=20=20=20"arm64"=20"bcm2711_defconfig"=0A+=20=20=20= "0k9q7qvw826v2hrp49xnxnw93pnnkicwx869chvlf7i57461n4i7"))=0A+=0A= +(define-public=20%bcmrpi3-defconfig=0A+=20=20(make-raspi-defconfig=0A+=20= =20=20"arm64"=20"bcmrpi3_defconfig"=0A+=20=20=20= "1bfnl4p0ddx3200dg91kmh2pln36w95y05x1asc312kixv0jgd81"))=0A= --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Disposition: attachment; filename=07-gnu-raspberry-pi-add-helpers.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="07-gnu-raspberry-pi-add-helpers.patch" Content-Transfer-Encoding: 7bit gnu: raspberry-pi: Add helpers for config.txt file generation. From: Stefan * gnu/packages/raspberry-pi.scm (raspi-config-file, raspi-custom-txt): New functions. (%raspi-config-txt, %raspi-bcm27-dtb-txt, %raspi-bcm28-dtb-txt %raspi-u-boot-bootloader-txt): New variables. --- gnu/packages/raspberry-pi.scm | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gnu/packages/raspberry-pi.scm b/gnu/packages/raspberry-pi.scm index 8949d2237a..12a919d5c6 100644 --- a/gnu/packages/raspberry-pi.scm +++ b/gnu/packages/raspberry-pi.scm @@ -238,6 +238,59 @@ Raspberry Pi. Note: It does not work on Raspberry Pi 1.") #t)))))))) (supported-systems '("aarch64-linux")))) +(define-public (raspi-config-file name content) + "Make a configuration file like config.txt for the Raspberry Pi firmware. +CONTENT can be a list of strings, which are concatenated with a newline +character. Alternatively CONTENT can be a string with the full file content." + (plain-file + name + (if (list? content) + (string-join content "\n" 'suffix) + content))) + +(define-public %raspi-config-txt + ;; A config.txt file to start the ARM cores up in 64-bit mode if necessary + ;; and to include a dtb.txt, bootloader.txt, and a custom.txt, each with + ;; separated configurations for the Raspberry Pi firmware. + (raspi-config-file + "config.txt" + `("# See https://www.raspberrypi.org/documentation/configuration/config-txt/README.md for details." + "" + ,(string-append "arm_64bit=" (if (target-aarch64?) "1" "0")) + "include dtb.txt" + "include bootloader.txt" + "include custom.txt"))) + +(define-public %raspi-bcm27-dtb-txt + ;; A dtb.txt file to be included by the config.txt to ensure that the + ;; downstream device tree files bcm27*.dtb will be used. + (raspi-config-file + "dtb.txt" + "upstream_kernel=0")) + +(define-public %raspi-bcm28-dtb-txt + ;; A dtb.txt file to be included by the config.txt to ensure that the + ;; upstream device tree files bcm28*.dtb will be used. + ;; This also implies the use of the dtoverlay=upstream. + (raspi-config-file + "dtb.txt" + "upstream_kernel=1")) + +(define-public %raspi-u-boot-bootloader-txt + ;; A bootloader.txt file to be included by the config.txt to load the + ;; U-Boot bootloader. + (raspi-config-file + "bootloader.txt" + '("dtoverlay=upstream" + "enable_uart=1" + "kernel=u-boot.bin"))) + +(define-public (raspi-custom-txt content) + "Make a custom.txt file for the Raspberry Pi firmware. +CONTENT can be a list of strings, which are concatenated with a newline +character. Alternatively CONTENT can be a string with the full file content." + (raspi-config-file "custom.txt" content)) + (define (make-raspi-defconfig arch defconfig sha256-as-base32) "Make for the architecture ARCH a file-like object from the DEFCONFIG file with the hash SHA256-AS-BASE32. This object can be used as the #:defconfig --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Disposition: attachment; filename=08-gnu-raspberry-pi-new-function.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="08-gnu-raspberry-pi-new-function.patch" Content-Transfer-Encoding: 7bit gnu: raspberry-pi: New function to make a package with device-tree files. From: Stefan * gnu/packages/raspberry-pi.scm (make-raspi-bcm28-dtbs): New function to make a package with device-tree files for Raspberry Pi models from the kernel given as argument. --- gnu/packages/raspberry-pi.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/raspberry-pi.scm b/gnu/packages/raspberry-pi.scm index 12a919d5c6..92f5d22677 100644 --- a/gnu/packages/raspberry-pi.scm +++ b/gnu/packages/raspberry-pi.scm @@ -30,6 +30,7 @@ #:use-module (gnu packages file) #:use-module (gnu packages gcc) #:use-module (gnu packages linux) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix download) #:use-module (guix git-download) @@ -291,6 +292,26 @@ CONTENT can be a list of strings, which are concatenated with a newline character. Alternatively CONTENT can be a string with the full file content." (raspi-config-file "custom.txt" content)) +(define-public (make-raspi-bcm28-dtbs linux) + "Make a package with the device-tree files for Raspberry Pi models from the +kernel LINUX." + (package + (inherit linux) + (name "raspi-bcm28-dtbs") + (source #f) + (build-system copy-build-system) + (arguments + `(#:phases (modify-phases %standard-phases (delete 'unpack)) + #:install-plan + (list (list (string-append (assoc-ref %build-inputs "linux") + "/lib/dtbs/broadcom/") + "." #:include-regexp '("/bcm....-rpi.*\\.dtb"))))) + (inputs `(("linux" ,linux))) + (synopsis "Device-tree files for a Raspberry Pi") + (description + (simple-format #f "The device-tree files for Raspberry Pi models from ~a." + (package-name linux))))) + (define (make-raspi-defconfig arch defconfig sha256-as-base32) "Make for the architecture ARCH a file-like object from the DEFCONFIG file with the hash SHA256-AS-BASE32. This object can be used as the #:defconfig --Apple-Mail=_932B5A3D-1E15-46AB-A634-391CEB07DFD4 Content-Disposition: attachment; filename=09-gnu-raspberry-pi-add-a.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="09-gnu-raspberry-pi-add-a.patch" Content-Transfer-Encoding: 7bit gnu: raspberry-pi: Add a bootloader-chain for the Raspberry Pi and os examples. From: Stefan * gnu/packages/raspberry-pi.scm (grub-efi-bootloader-chain-raspi-64): New bootloader variable, capable to boot a Raspberry Pi over network or from a local storage. * gnu/system/examples/raspberry-pi-64.tmpl: New operating-system example. * gnu/system/examples/raspberry-pi-64-nfs-root.tmpl: New operating-system example for booting over network. --- gnu/packages/raspberry-pi.scm | 19 +++++ gnu/system/examples/raspberry-pi-64-nfs-root.tmpl | 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 92f5d22677..3d62b028ba 100644 --- a/gnu/packages/raspberry-pi.scm +++ b/gnu/packages/raspberry-pi.scm @@ -18,11 +18,14 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages raspberry-pi) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages algebra) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages bootloaders) #:use-module (gnu packages commencement) #:use-module (gnu packages cross-base) #:use-module (gnu packages documentation) @@ -312,6 +315,22 @@ kernel LINUX." (simple-format #f "The device-tree files for Raspberry Pi models from ~a." (package-name linux))))) +(define-public grub-efi-bootloader-chain-raspi-64 + ;; A bootloader capable to boot a Raspberry Pi over network via TFTP or from + ;; a local storage like a micro SD card. + ;; It neither installs firmware nor device-tree files for the Raspberry Pi. + ;; It just assumes them to be existing in boot/efi in the same way that some + ;; UEFI firmware with ACPI data is usually assumed to be existing on PCs. + ;; It creates firmware configuration files and a bootloader-chain with U-Boot + ;; to provide an EFI API for the final GRUB bootloader. + ;; It also serves as a blue-print to create an own bootloader-chain with + ;; firmwre and device-tree packages or files. + (efi-bootloader-chain grub-efi-netboot-removable-bootloader + #:packages (list u-boot-rpi-arm64-efi-bin) + #:files (list %raspi-config-txt + %raspi-bcm27-dtb-txt + %raspi-u-boot-bootloader-txt))) + (define (make-raspi-defconfig arch defconfig sha256-as-base32) "Make for the architecture ARCH a file-like object from the DEFCONFIG file with the hash SHA256-AS-BASE32. This object can be used as the #:defconfig diff --git a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl new file mode 100644 index 0000000000..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=_932B5A3D-1E15-46AB-A634-391CEB07DFD4--