Archived
1
0
Fork 0

build: image: Account for fixed-size file system structures.

Workaround for <https://issues.guix.gnu.org/53194>.

* gnu/build/image.scm (estimate-partition-size): Enforce a 1-MiB minimum.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Tobias Geerinckx-Rice 2022-01-11 20:31:27 +01:00 committed by Maxim Cournoyer
parent 805af862c6
commit 472680a28d
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -3,7 +3,7 @@
;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org> ;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org>
;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name> ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com> ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2020, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
@ -62,8 +62,10 @@
(define (estimate-partition-size root) (define (estimate-partition-size root)
"Given the ROOT directory, evaluate and return its size. As this doesn't "Given the ROOT directory, evaluate and return its size. As this doesn't
take the partition metadata size into account, take a 25% margin." take the partition metadata size into account, take a 25% margin. As this in
(* 1.25 (file-size root))) turn doesn't take any constant overhead into account, force a 1-MiB minimum."
(max (ash 1 20)
(* 1.25 (file-size root))))
(define* (make-ext-image partition target root (define* (make-ext-image partition target root
#:key #:key