diff --git a/gnu/build/image.scm b/gnu/build/image.scm index e8df5866a7..e7b0418182 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -77,7 +77,7 @@ (define* (make-ext-image partition target root (uuid (partition-uuid partition)) (journal-options "lazy_itable_init=1,lazy_journal_init=1")) (apply invoke - `("mke2fs" "-t" ,fs "-d" ,root + `("fakeroot" "mke2fs" "-t" ,fs "-d" ,root "-L" ,label "-U" ,(uuid->string uuid) "-E" ,(format #f "root_owner=~a:~a,~a" owner-uid owner-gid journal-options) @@ -93,7 +93,8 @@ (define* (make-vfat-image partition target root) "Handle the creation of VFAT partition images. See 'make-partition-image'." (let ((size (partition-size partition)) (label (partition-label partition))) - (invoke "mkdosfs" "-n" label "-C" target "-F" "16" "-S" "1024" + (invoke "fakeroot" "mkdosfs" "-n" label "-C" target + "-F" "16" "-S" "1024" (size-in-kib (if (eq? size 'guess) (estimate-partition-size root) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 9f210d9f0f..43217ddf86 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -255,18 +255,24 @@ (define (partition-image partition) (graph (match inputs (((names . _) ...) names))) - (root-builder + (type (partition-file-system partition)) + (image-builder (with-imported-modules* - (let* ((initializer #$(partition-initializer partition))) + (let ((initializer #$(partition-initializer partition)) + (inputs '#+(list e2fsprogs fakeroot dosfstools mtools + sed coreutils)) + (image-root "tmp-root")) (sql-schema #$schema) + (set-path-environment-variable "PATH" '("bin" "sbin") inputs) + ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be ;; decoded. (setenv "GUIX_LOCPATH" #+(file-append glibc-utf8-locales "/lib/locale")) (setlocale LC_ALL "en_US.utf8") - (initializer #$output + (initializer image-root #:references-graphs '#$graph #:deduplicate? #f #:system-directory #$os @@ -277,19 +283,12 @@ (define (partition-image partition) #+(bootloader-installer bootloader) #:bootcfg #$bootcfg #:bootcfg-location - #$(bootloader-configuration-file bootloader))))) - (image-root - (computed-file "partition-image-root" root-builder - #:options `(#:references-graphs ,inputs))) - (type (partition-file-system partition)) - (image-builder - (with-imported-modules* - (let ((inputs '#+(list e2fsprogs dosfstools mtools))) - (set-path-environment-variable "PATH" '("bin" "sbin") inputs) + #$(bootloader-configuration-file bootloader)) (make-partition-image #$(partition->gexp partition) #$output - #$image-root))))) - (computed-file "partition.img" image-builder))) + image-root))))) + (computed-file "partition.img" image-builder + #:options `(#:references-graphs ,inputs)))) (define (partition->config partition) ;; Return the genimage partition configuration for PARTITION.