From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBIeB-0006Ac-Mx for guix-patches@gnu.org; Thu, 18 May 2017 06:27:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBIe8-00028q-Iz for guix-patches@gnu.org; Thu, 18 May 2017 06:27:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:49287) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dBIe8-00028j-Ef for guix-patches@gnu.org; Thu, 18 May 2017 06:27:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dBIe6-0006NM-9n for guix-patches@gnu.org; Thu, 18 May 2017 06:27:02 -0400 Subject: bug#26339: [PATCH] tests: Add syslinux gpt test. References: <20170402134916.2871-1-m.othacehe@gmail.com> In-Reply-To: <20170402134916.2871-1-m.othacehe@gmail.com> Resent-Message-ID: From: Mathieu Othacehe Date: Thu, 18 May 2017 12:26:18 +0200 Message-Id: <20170518102618.24842-1-m.othacehe@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26339@debbugs.gnu.org * gnu/tests/install.scm (%test-installed-syslinux-os): New exported variable. (%minimal-syslinux-os, %minimal-syslinux-os-source): New variables. (%syslinux-gpt-installation-script): New variable. * gnu/system/install.scm (installation-os)[packages]: Add syslinux. --- Hi, Here's a test installing a GuixSD system with extlinux-bootloader-gpt as a bootloader. I had to rewrite %minimal-syslinux-os as a copy of %minimal-os, but the only change is the bootloader field. A better idea to avoid rewritting is welcome :) Thanks, Mathieu gnu/system/install.scm | 1 + gnu/tests/install.scm | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 9a6febfeb..888998347 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -343,6 +343,7 @@ Use Alt-F2 for documentation. (packages (cons* (canonical-package glibc) ;for 'tzselect' & co. parted gptfdisk ddrescue grub ;mostly so xrefs to its manual work + syslinux cryptsetup mdadm dosfstools ;mkfs.fat, for the UEFI boot partition diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index b104efcfd..9dcb41ba1 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -18,6 +18,7 @@ (define-module (gnu tests install) #:use-module (gnu) + #:use-module (gnu bootloader extlinux) #:use-module (gnu tests) #:use-module (gnu tests base) #:use-module (gnu system) @@ -34,6 +35,7 @@ #:use-module (guix gexp) #:use-module (guix utils) #:export (%test-installed-os + %test-installed-syslinux-os %test-separate-store-os %test-separate-home-os %test-raid-root-os @@ -77,6 +79,39 @@ (guix combinators))))) %base-services)))) +(define-os-with-source (%minimal-syslinux-os + %minimal-syslinux-os-source) + (use-modules (gnu) (gnu tests) (gnu bootloader extlinux) + (srfi srfi-1)) + + (operating-system + (host-name "liberigilo") + (timezone "Europe/Paris") + (locale "en_US.UTF-8") + + (bootloader (bootloader-configuration + (bootloader extlinux-bootloader-gpt) + (device "/dev/vdb"))) + (kernel-arguments '("console=ttyS0")) + (file-systems (cons (file-system + (device "my-root") + (title 'label) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (users (cons (user-account + (name "alice") + (comment "Bob's sister") + (group "users") + (supplementary-groups '("wheel" "audio" "video")) + (home-directory "/home/alice")) + %base-user-accounts)) + (services (cons (service marionette-service-type + (marionette-configuration + (imported-modules '((gnu services herd) + (guix combinators))))) + %base-services)))) + (define (operating-system-with-current-guix os) "Return a variant of OS that uses the current Guix." (operating-system @@ -121,6 +156,30 @@ guix system init /mnt/etc/config.scm /mnt --no-substitutes sync reboot\n") +(define %syslinux-gpt-installation-script + ;; Shell script of a simple installation. + ;; As syslinux 6.0.3 does not handle 64bits ext4 partitions, + ;; we make sure to pass -O '^64bit' to mkfs. + "\ +. /etc/profile +set -e -x +guix --version + +export GUIX_BUILD_OPTIONS=--no-grafts +guix build isc-dhcp +parted --script /dev/vdb mklabel gpt \\ + mkpart ext2 1M 1G \\ + set 1 legacy_boot on +mkfs.ext4 -L my-root -O '^64bit' /dev/vdb1 +mount /dev/vdb1 /mnt +df -h /mnt +herd start cow-store /mnt +mkdir /mnt/etc +cp /etc/target-config.scm /mnt/etc/config.scm +guix system init /mnt/etc/config.scm /mnt --no-substitutes +sync +reboot\n") + (define* (run-install target-os target-os-source #:key (script %simple-installation-script) @@ -232,6 +291,20 @@ build (current-guix) and then store a couple of full system images.") (run-basic-test %minimal-os command "installed-os"))))) +(define %test-installed-syslinux-os + (system-test + (name "installed-syslinux-os") + (description + "...") + (value + (mlet* %store-monad ((image (run-install %minimal-syslinux-os + %minimal-syslinux-os-source + #:script + %syslinux-gpt-installation-script)) + (command (qemu-command/writable-image image))) + (run-basic-test %minimal-syslinux-os command + "installed-syslinux-os"))))) + ;;; ;;; Separate /home. -- 2.13.0