From ed5a9f5260666679289c3d20d5068e374084a50c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 16 Jun 2023 10:52:58 +0200 Subject: linux-container: Pass '--disable-chroot' to 'guix-daemon'. This allows for the use of Guix within a non-privileged Docker container produced by 'guix system image -t docker'. * gnu/system/linux-container.scm (containerized-operating-system): Change 'guix-configuration' to add "--disable-chroot". --- gnu/system/linux-container.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm index 7c45dbccafb..485baea4c55 100644 --- a/gnu/system/linux-container.scm +++ b/gnu/system/linux-container.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 David Thompson -;;; Copyright © 2016-2017, 2019-2022 Ludovic Courtès +;;; Copyright © 2016-2017, 2019-2023 Ludovic Courtès ;;; Copyright © 2019 Arun Isaac ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2020 Google LLC @@ -160,6 +160,17 @@ containerized OS. EXTRA-FILE-SYSTEMS is a list of file systems to add to OS." (nscd-configuration (inherit (service-value s)) (caches %nscd-container-caches)))) + ((eq? guix-service-type (service-kind s)) + ;; Pass '--disable-chroot' so that + ;; guix-daemon can build thing even in + ;; Docker without '--privileged'. + (service guix-service-type + (guix-configuration + (inherit (service-value s)) + (extra-options + (cons "--disable-chroot" + (guix-configuration-extra-options + (service-value s))))))) (else s))) (operating-system-user-services os)))) (file-systems (append (map mapping->fs -- cgit v1.3 From 209204e23b39af09e0ea92540b6fa00a60e6a0ae Mon Sep 17 00:00:00 2001 From: Sergey Trofimov Date: Wed, 22 Mar 2023 13:53:28 +0100 Subject: image: Prefer gpt partition table for efi images * gnu/system/image.scm (efi-disk-image): Use gpt partition-table-type. (efi32-disk-image): Use gpt partition-table-type. (qcow2-image-type): Use mbr partition-table-type explicitly. * gnu/tests/image.scm: Assert partition table type of efi-disk-image. Signed-off-by: Josselin Poiret --- gnu/system/image.scm | 3 +++ gnu/tests/image.scm | 23 ++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 81346495c2a..841e7e0c7e2 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -148,11 +148,13 @@ parent image record." (define efi-disk-image (image-without-os (format 'disk-image) + (partition-table-type 'gpt) (partitions (list esp-partition root-partition)))) (define efi32-disk-image (image-without-os (format 'disk-image) + (partition-table-type 'gpt) (partitions (list esp32-partition root-partition)))) (define iso9660-image @@ -215,6 +217,7 @@ set to the given OS." (constructor (cut image-with-os (image (inherit efi-disk-image) + (partition-table-type 'mbr) (name 'image.qcow2) (format 'compressed-qcow2)) <>)))) diff --git a/gnu/tests/image.scm b/gnu/tests/image.scm index 99d34b7670e..be6852cae0a 100644 --- a/gnu/tests/image.scm +++ b/gnu/tests/image.scm @@ -20,7 +20,7 @@ #:use-module (gnu) #:use-module (gnu image) #:use-module (gnu tests) - #:autoload (gnu system image) (system-image root-offset) + #:autoload (gnu system image) (system-image root-offset image-with-os efi-disk-image) #:use-module (gnu system uuid) #:use-module (gnu system vm) #:use-module (gnu packages guile) @@ -153,6 +153,10 @@ (flags '(boot)) (initializer dummy-initializer)))))) +;; A efi disk image with default partitions +(define i6 + (image-with-os efi-disk-image %simple-efi-os)) + (define (run-images-test) (define test (with-imported-modules '((srfi srfi-64) @@ -202,10 +206,10 @@ (disk-get-primary-partition-count (disk-new d2-device))) (test-equal "test" - (let* ((disk (disk-new d2-device)) - (partitions (disk-partitions disk)) - (boot-partition (find normal-partition? partitions))) - (partition-get-name boot-partition))) + (let* ((disk (disk-new d2-device)) + (partitions (disk-partitions disk)) + (boot-partition (find normal-partition? partitions))) + (partition-get-name boot-partition))) ;; Image i3. (define i3-image @@ -259,6 +263,15 @@ (filter data-partition? (disk-partitions (disk-new d5-device))))) + ;; Image i6. + (define i6-image + #$(system-image i6)) + (define d6-device + (get-device i6-image)) + + (test-equal "gpt" + (disk-type-name (disk-probe d6-device))) + (test-end))))) (gexp->derivation "images-test" test)) -- cgit v1.3