guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/8] WIP: Better support for non-grub bootloaders.


From: David Craven
Subject: [PATCH 0/8] WIP: Better support for non-grub bootloaders.
Date: Tue, 14 Feb 2017 16:28:25 +0100

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 <bootloader-configuration> 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 <bootloader-parameter> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]