From mboxrd@z Thu Jan 1 00:00:00 1970 From: Raghav Gururajan Subject: Re: Help with writing custom boot-loader configuration Date: Tue, 04 Jun 2019 11:40:40 -0400 Message-ID: References: <34bfe68c4431240cf1ad05c48ecf3d9ae00be787.camel@disroot.org> <87v9xmqimo.fsf@ngyro.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:56022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYBYQ-0006bo-An for help-guix@gnu.org; Tue, 04 Jun 2019 11:40:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYBYP-0006wd-5N for help-guix@gnu.org; Tue, 04 Jun 2019 11:40:50 -0400 Received: from knopi.disroot.org ([178.21.23.139]:55012) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hYBYO-0006sD-Np for help-guix@gnu.org; Tue, 04 Jun 2019 11:40:49 -0400 In-Reply-To: <87v9xmqimo.fsf@ngyro.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Timothy Sample Cc: help-guix@gnu.org > Putting together =E2=80=9Cexact Guile Scheme Code=E2=80=9D is a lot to = ask, but I can > give you the following. You will have to adjust it appropriately if, > for example, you are not using EFI. Note also that this is untested, > but it is certainly close. >=20 > What you want to do is create a custom bootloader that behaves just lik= e > GRUB except for the =E2=80=9Cinstaller=E2=80=9D. In Guix, each bootloa= der is defined by > a =E2=80=9Cbootloader=E2=80=9D record. Part of that record is an =E2=80= =9Cinstaller=E2=80=9D field, > which tells Guix how to install the bootloader onto the system. >=20 > In addition to whatever else you use for your config file, you will nee= d > the following modules: >=20 > (use-modules (gnu) > (guix gexp)) >=20 > Now you can make your custom bootloader: >=20 > (define grub-efi-bootloader-sans-install > (bootloader > (inherit grub-efi-bootloader) > (installer #~(const #t)))) >=20 > Here, =E2=80=9C(const #t)=E2=80=9D tells Guile to create a function tha= t always returns > =E2=80=9C#t=E2=80=9D, which means =E2=80=9Ctrue=E2=80=9D. The =E2=80=9C= #~=E2=80=9D part introduces a G-expression, > which is a handy way to write code that is intended to be run from the > build environment. >=20 > Finally, this should work as part of your configuration: >=20 > (operating-system > ;; ... > (bootloader (bootloader-configuration > ;; ... > (bootloader grub-efi-bootloader-sans-install)) >=20 > That is, you need to change your =E2=80=9Cbootloader-configuration=E2=80= =9D to use your > new custom bootloader. >=20 > I hope that helps! >=20 Thank you very much. Regards, RG.