From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Craven Subject: [PATCH 0/8] WIP: Better support for non-grub bootloaders. Date: Tue, 14 Feb 2017 16:28:25 +0100 Message-ID: <20170214152834.19651-1-david@craven.ch> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdf2g-0002I1-5y for guix-devel@gnu.org; Tue, 14 Feb 2017 10:29:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdf2c-0002Wl-QE for guix-devel@gnu.org; Tue, 14 Feb 2017 10:29:22 -0500 Received: from so254-10.mailgun.net ([198.61.254.10]:21305) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdf2c-0002UO-IZ for guix-devel@gnu.org; Tue, 14 Feb 2017 10:29:18 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org These patches make changes to the bootloader API and will break operating-system's and some scripts (--no-grub is renamed to --no-bootloader). I would like some feedback on the API and also ideas on how to handle API changes with minimal discomfort to our users. The most interesting commit is 8a01985d7a936809102b10d494dc2286b3f8c6f2 which defines a record. extlinux-configuration, grub-configuration and syslinux-configuration are designed as transformation passes on a bootloader-configuration record. The idea is that someone that wants to add support for a new bootloader can use (bootloader (bootloader-configuration ...)) and users that want to use a supported bootloader can configure it like this (bootloader (grub-configuration (bootloader-configuration (device "/dev/sda1")))) another important API change is that an operating-system does not need to set the bootloader when it is only intended to run through guix system vm or on an embedded system that has an extlinux compatible bootloader in ROM. Things that don't work yet: * system tests are broken due to API changes * grub-efi needs an installation procedure and the vm code needs support for alternative firmware like ovmf, gpt partition table and EFI boot partition. * The syslinux and grub bootloader configurations still require guix/scripts/system.scm to handle the new API on init and reconfigure and requires extensive testing on real hardware. * No automated system tests yet. Here is an example for testing: (use-modules (gnu) (gnu system bootloader)) ;; defaults to extlinux-configuration ;; works for everything that only requires a gc-root and for most ;; embedded systems that have a bootloader in rom. (define extlinux-os (operating-system (host-name "host-name") (timezone "Europe/Zurich") (file-systems (cons (file-system (device "my-root") (title 'label) (mount-point "/") (type "ext4")) %base-file-systems)))) (define syslinux-os (operating-system (inherit extlinux-os) (bootloader (syslinux-configuration)))) (define grub-os (operating-system (inherit extlinux-os) (bootloader (grub-configuration)))) (define grub-efi-os (operating-system (inherit extlinux-os) (bootloader (grub-efi-configuration)) (file-systems (cons (file-system (device "my-efi") (title 'label) (mount-point "/boot") (type "vfat") (needed-for-boot? #t)) (operating-system-file-systems extlinux-os))))) ;; Test with $(./pre-inst-env guix system vm bootloader-test.scm --full-boot) syslinux-os David Craven (8): file-systems: Add FAT32 support. system: Pass to grub. system: Add extlinux support. scripts: system: Rename --no-grub option to --no-bootloader. vm: Remove hard coded kernel file name. vm: Improve readability of run-vm.sh generation. vm: Fix full-boot? option. bootloader: Add install procedures and use them. gnu/build/file-systems.scm | 66 +++++++++++++-- gnu/build/install.scm | 36 ++------ gnu/build/vm.scm | 17 ++-- gnu/local.mk | 1 + gnu/system.scm | 31 ++++--- gnu/system/bootloader.scm | 205 +++++++++++++++++++++++++++++++++++++++++++++ gnu/system/grub.scm | 41 ++++++--- gnu/system/vm.scm | 140 ++++++++++++++++++------------- guix/scripts/system.scm | 48 +++++------ tests/guix-system.sh | 2 - tests/system.scm | 2 - 11 files changed, 435 insertions(+), 154 deletions(-) create mode 100644 gnu/system/bootloader.scm -- 2.11.1