From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timothy Sample Subject: Re: Help with writing custom boot-loader configuration Date: Mon, 03 Jun 2019 20:49:51 -0400 Message-ID: <87v9xmqimo.fsf@ngyro.com> References: <34bfe68c4431240cf1ad05c48ecf3d9ae00be787.camel@disroot.org> 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]:53136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXxeJ-00025M-3Z for help-guix@gnu.org; Mon, 03 Jun 2019 20:50:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXxeI-0002ZI-2Z for help-guix@gnu.org; Mon, 03 Jun 2019 20:49:59 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:46675) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hXxeH-0002Wc-A6 for help-guix@gnu.org; Mon, 03 Jun 2019 20:49:57 -0400 In-Reply-To: <34bfe68c4431240cf1ad05c48ecf3d9ae00be787.camel@disroot.org> (Raghav Gururajan's message of "Mon, 03 Jun 2019 19:27:20 -0400") 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: Raghav Gururajan Cc: help-guix@gnu.org Hi Raghav, Raghav Gururajan writes: > On Thu, 2019-05-30 at 10:11 +0000, Raghav Gururajan wrote: >> Hello Guix! >>=20 >> If I want to make the "grub-bootloader" to invoke ONLY >> "grub-mkconfig" and NOT "grub-install", how should I modify the >> "bootloader" part of "operating-system" section of system >> configuration (config.scm)? I am looking for exact Guile Scheme Code >> to achieve the same. >>=20 >> Thank you! >>=20 >> Regards, >> RG. > > Hello Ludo and Rekado! > > May be with your expertise in Guile Scheme, can you please help me with t= he > above? 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. What you want to do is create a custom bootloader that behaves just like GRUB except for the =E2=80=9Cinstaller=E2=80=9D. In Guix, each bootloader = is defined by a =E2=80=9Cbootloader=E2=80=9D record. Part of that record is an =E2=80=9C= installer=E2=80=9D field, which tells Guix how to install the bootloader onto the system. In addition to whatever else you use for your config file, you will need the following modules: (use-modules (gnu) (guix gexp)) Now you can make your custom bootloader: (define grub-efi-bootloader-sans-install (bootloader (inherit grub-efi-bootloader) (installer #~(const #t)))) Here, =E2=80=9C(const #t)=E2=80=9D tells Guile to create a function that al= ways 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. Finally, this should work as part of your configuration: (operating-system ;; ... (bootloader (bootloader-configuration ;; ... (bootloader grub-efi-bootloader-sans-install)) That is, you need to change your =E2=80=9Cbootloader-configuration=E2=80=9D= to use your new custom bootloader. I hope that helps! -- Tim